ci: post-merge-verify v1.1——修 startup failure(P2-6,ADR-0041) - #112
Conversation
0-job startup failure 实测(run 32337015373):workflow_call+push 混用时 inputs.smoke 在 push 运行中是 Unrecognized named-value。v1 收敛为纯 push (治理仓自检);业务仓接入走 ADR-0041 后续逐仓注册。另修告警步骤 SHA/URL env(原先引用他步 env 为空)。
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoFix post-merge verification startup and alert context
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Successful reverts trigger alerts
|
| run: | | ||
| gh issue create --repo "$REPO" --title "P0: post-merge 冒烟失败且自动 revert 未执行(run ${{ github.run_id }})" --body "合并 ${SHA:-HEAD} 后冒烟失败。自动 revert 未执行的原因:App 令牌不可用(未安装本仓?)/ 防回环闸(嵌套 revert 或 1h 限频)/ 无关联 PR。人工复核并回滚:${{ github.server_url }}/${REPO}/actions/runs/${{ github.run_id }}(ADR-0041)" --label auto-revert-alert || \ | ||
| gh issue create --repo "$REPO" --title "P0: post-merge 冒烟失败且自动 revert 未执行(run ${{ github.run_id }})" --body "同上(label 创建失败兜底)" No newline at end of file | ||
| gh issue create --repo "$REPO" \ |
There was a problem hiding this comment.
1. Fallback uses workflow token 📘 Rule violation ⛨ Security
The modified fallback creates GitHub issues using ${{ github.token }} instead of a
single-repository cloudbrid-agent token obtained through scripts/gh-app-token.sh. This bypasses
the required bot identity and authentication path.
Agent Prompt
## Issue description
The fallback GitHub issue operation authenticates with the workflow token rather than a cloudbrid-agent single-repository token issued by `scripts/gh-app-token.sh`.
## Issue Context
All authenticated GitHub operations must use the mandated script and must scope the resulting installation token to the current repository. If App authentication is unavailable, preserve a failed check rather than falling back to another identity.
## Fix Focus Areas
- .github/workflows/post-merge-verify.yml[102-113]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| run: | | ||
| gh issue create --repo "$REPO" --title "P0: post-merge 冒烟失败且自动 revert 未执行(run ${{ github.run_id }})" --body "合并 ${SHA:-HEAD} 后冒烟失败。自动 revert 未执行的原因:App 令牌不可用(未安装本仓?)/ 防回环闸(嵌套 revert 或 1h 限频)/ 无关联 PR。人工复核并回滚:${{ github.server_url }}/${REPO}/actions/runs/${{ github.run_id }}(ADR-0041)" --label auto-revert-alert || \ | ||
| gh issue create --repo "$REPO" --title "P0: post-merge 冒烟失败且自动 revert 未执行(run ${{ github.run_id }})" --body "同上(label 创建失败兜底)" No newline at end of file | ||
| gh issue create --repo "$REPO" \ |
There was a problem hiding this comment.
2. Alert creates repository issue 📘 Rule violation § Compliance
The modified bot fallback creates a repository issue, while the automation standard permits machine feedback only through failed check runs or ordinary PR comments. This introduces an undocumented feedback channel for the workflow.
Agent Prompt
## Issue description
The post-merge bot publishes failure feedback by creating a repository issue, which is not one of the feedback channels permitted by `standards/automation/`.
## Issue Context
The existing failed workflow check is already an approved feedback mechanism. Remove the issue creation or, where suitable and authenticated correctly, report through an ordinary PR comment.
## Fix Focus Areas
- .github/workflows/post-merge-verify.yml[102-113]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if [ -n "${{ inputs.smoke }}" ]; then | ||
| bash -c '${{ inputs.smoke }}' |
There was a problem hiding this comment.
3. Successful reverts trigger alerts 🐞 Bug ≡ Correctness
Once removing the invalid inputs.smoke references allows the workflow to run, the fallback alert executes even after a successful automatic revert because failure() remains true from the failed ancestor smoke job. Every successful auto-revert therefore creates a false “revert not executed” P0 issue, potentially prompting an unnecessary manual rollback.
Agent Prompt
## Issue description
The now-operational workflow always enters the alert step after a smoke failure, even when the automatic revert succeeds, because `failure()` includes failures from ancestor jobs.
## Issue Context
Give the guard and automatic-revert steps IDs, then base the fallback condition on their explicit outcomes and the guard/App outputs. Preserve alerts for guard failures, token failures, blocked reverts, missing PRs, and failed revert commands without treating the expected upstream smoke failure as a revert failure.
## Fix Focus Areas
- .github/workflows/post-merge-verify.yml[43-46]
- .github/workflows/post-merge-verify.yml[58-103]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if [ -n "${{ inputs.smoke }}" ]; then | ||
| bash -c '${{ inputs.smoke }}' |
There was a problem hiding this comment.
4. Revert rate limit bypass 🐞 Bug ☼ Reliability
The now-activated loop guard examines only the 20 newest PRs, so an auto-revert created earlier in the same hour is missed whenever at least 20 newer PRs exist. A subsequent smoke failure can then create another revert despite the stated one-per-hour limit.
Agent Prompt
## Issue description
The one-hour auto-revert rate-limit guard only checks the first 20 pull requests and can miss a qualifying revert PR on a later page.
## Issue Context
Fetch and aggregate all pages needed to cover the one-hour window before counting matching `[auto-revert]` titles. Ensure the resulting `RECENT` value is one aggregate integer rather than one count per page.
## Fix Focus Areas
- .github/workflows/post-merge-verify.yml[70-73]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
摘要
修 #110 合入后的 0-job startup failure(run 32337015373):workflow_call+push 混用时
inputs.smoke在 push 运行中是 Unrecognized named-value。v1 收敛为纯 push(治理仓自检冒烟);业务仓接入走 ADR-0041 后续逐仓注册(文件头注释记录了该坑)。另修告警步骤的 SHA/RUN_URL env 归属。验证
Summary by CodeRabbit
main分支推送时自动触发。P0标签,便于快速识别和处理。