Repository navigation
ci: 严格质量检查通过后才允许发版 - #2
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
已实现:严格质量检查通过后才允许发版
基线 main
7070fd93d786e115ef8c4cf57a1ef22a127d9f32(v0.0.22);本PR提交87a2cac91fe5bbd3ec39a02a2fe3b109221340aa。未合并、未发布新版本。合并到 main 后自动发布才会使用新门禁。 不修改生产Go代码、公开API、配置、版本号或Zap依赖。
发布依赖链
preflight -> audit (quality + security -> Strict quality gate) -> releasequality-audit.yml新增workflow_call,保留PR和只读手动检查。发布作业必须等待完整检查成功,并验证输出的SHA等于本次触发提交;失败、取消、跳过、缺失结果和错误SHA均拒绝。quality_gate.sh/security_gate.sh:只检查格式、不自动改写源码;脚本测试、依赖校验、精确100%根模块语句覆盖、完整race/vet、路径fuzz、独立基准模块输出正确性/race/vet及五轮基准、受支持工具链race与govulncheck。continue-on-error、无跳过质量的参数、无secrets: inherit;只有发布作业持有contents: write。gh release --verify-tag不允许在未验证提交上自动建标签。release.sh保留原调用入口,但同样在最终版本提交后执行完整门禁;推送失败不再被吞掉。真实GitHub CI:全部通过
运行:https://github.com/PinableAgents/mlog/actions/runs/35577897317
该PR运行验证的合并候选SHA:
0b1f6afd66c19cefa432bf18ad263ba8076b5641。两个验证作业均记录此SHA,最终汇总检查成功。已下载并核验CI artifact SHA256:
bbf67aea418ab2dc9b3302dea9d149f240962ea5df3d3ea861249e8ae399ea2dbd5e25351cdbce3fe08bea95df7fdf07d3a5775b296f565e5a18ba2d957107ec本地完整Go质量检查也已通过;9个变更文件的Git blob与远端逐一一致。另以真实本地bare Git仓库验证:源分支在检查后前进时,atomic push同时拒绝分支与标签,未产生远端标签。
失败注入工具仅存在于隔离临时目录,用来验证各阶段非零退出、取消/跳过、错误SHA、脏工作区、旧分支与推送失败的阻断行为,不冒充真实Go测试或扫描。正常Go测试和扫描是上表的真实执行。
验证与权限边界
未通过真实发版来做演练;PR阶段已执行实际检查、工作流语法/依赖契约测试及隔离发布失败测试。完整Auto Release路径在合并后的push执行,并对最终候选重新检查。
100%是Go根模块(含examples)的语句覆盖,不代表Python/Shell覆盖率100%或无漏洞;扫描结论限本次工具链、平台和漏洞库。管理员仍可能直接推送标签/API创建Release;组织级禁止绕过需独立ruleset/环境权限,本PR不擅自改管理员权限。
发布说明与失败恢复见
.github/workflows/README.md。