Repository navigation
Conversation
背景 ---- 首次 live 审计中三个仓库同时报 `[WORKFLOW_LIST] active workflow 缺少合法 path`, 但该信息不含任何标识,无法判断是哪个 workflow,也无法区分"项目把 workflow 放错 位置"(该改项目)与"GitHub 平台内建的 dynamic/ workflow 不在仓库里"(该改基线 跳过列表)。错误码存在的意义是定位公共 MUST,这条做不到。 改动 ---- - path 不合法分支回显 workflow name 与 path。 - 平台内建跳过列表抽出为 SKIPPED_PLATFORM_WORKFLOWS,未知 dynamic/ 路径保持 fail-closed,不放宽边界。 - 新增 fixture dynamic-unknown-workflow,复现 CodeQL default setup 形态并断言 name 与 path 都出现在输出中。 - 同步 contracts/error-codes.md、README 与 CHANGELOG。 验证 ---- - bash tests/test-audit.sh 全绿;ruff、shellcheck 通过。 - 新错误信息实测输出: [WORKFLOW_LIST] active workflow 'CodeQL' 的 path 不在 .github/workflows/ 下: 'dynamic/github-code-scanning/codeql' Claude-Session: https://claude.ai/code/session_01HqomJN4HxRYdoenUgZ1KfP
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
背景
----
首次 live 审计报四个仓库都需要关闭 Auto-merge,但实际四个仓库的 Allow auto-merge
本来就没有勾选。
根因:判定写作 `metadata.get("allow_auto_merge") is not False`。字段缺失时 `.get()`
返回 `None`,`None is not False` 成立,于是报漂移。而 GitHub 只在认证身份具备 admin
权限时才返回这组合并策略字段,只读审计 App 拿不到,导致连续数周误报,并把维护者
指引去关一个本来就关着的开关——真正该查的是 App 权限。
这与本轮引入的分级原则一致:判定不了不等于漂移。
改动
----
- Auto-merge 判定区分三态:`true` 报 `[REPOSITORY_MERGE_POLICY]`;`false` 通过;
缺失或非布尔值报 `[API_UNAVAILABLE]`,并在信息中给出实际值与权限排查方向。
- 新增 RepositorySource.unavailable:判定不了的项改为收集而非抛异常。此前的实现
会中断整个仓库审计、丢掉其余 findings;现在其余检查照常执行,一次就能看到全部
问题,仅整体结论标记为不可信。
- 新增 fixture repository-auto-merge-unknown,断言缺失字段走退出码 3 而非漂移。
- default-branch-main fixture 补上 allow_auto_merge,恢复单一条件隔离。
- 同步 contracts/error-codes.md 与 CHANGELOG。
验证
----
- bash tests/test-audit.sh 全绿;ruff、shellcheck 通过。
- 组合场景实测:缺字段 + default_branch 不符时,两条都出现在输出中,退出码 3。
Claude-Session: https://claude.ai/code/session_01HqomJN4HxRYdoenUgZ1KfP
This branch has not been deployed
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.
背景
合并 #8 后的首次 live 审计中,三个仓库(
fusion-api、fusion-ui、ai-audio-assistant-ui)同时报:这条信息不含任何标识,导致无法判断:
dynamic/workflow 根本不在仓库里(该改基线的跳过列表)。错误码存在的意义就是定位公共 MUST,而这一条做不到——只能靠猜。
改动
SKIPPED_PLATFORM_WORKFLOWS常量;未知dynamic/路径保持 fail-closed,不放宽任何边界;dynamic-unknown-workflow,复现 CodeQL default setup 的形态(dynamic/github-code-scanning/codeql),并断言 name 与 path 都出现在输出中;contracts/error-codes.md、README 与 CHANGELOG。新错误信息实测输出:
验证
bash tests/test-audit.sh全绿;ruff check、ruff format --check、shellcheck通过。注意:本 PR 不修复漂移
这只是让下一次 live 审计能说清楚问题出在哪。四个仓库的真实漂移仍待处理:
[REPOSITORY_MERGE_POLICY][ENV_SECRET_BOUNDARY]/[REPO_SECRET_BOUNDARY]fusion-apidevEnvironment 后删除 repo scope 副本[WORKFLOW_LIST]按 MAINTENANCE 的发布流程,
v1.1.0tag 需等四仓全部PASS后再打。Generated by Claude Code