Repository navigation
docs(agents): retry CI via empty commit, not gh run rerun - #2489
Aleksei Sviridkin (lexfrei) wants to merge 3 commits into
Conversation
Rerun attempts restart jobs under the same run_id and do not re-register into the workflow's concurrency group. When a real fix-commit lands while a rerun is in flight, cancel-in-progress cannot gate the old rerun, so two runs race to completion and operators pay CI twice. Push an empty commit (`git commit --allow-empty`) instead — it participates in the concurrency group cleanly and the next real push cancels it as expected. Add the guidance to docs/agents/contributing.md and wire a trigger in AGENTS.md so any agent asked to "rerun CI" or "retry the failed build" reaches for the empty commit first. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
📝 WalkthroughWalkthroughDocumentation updates to Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the project documentation to clarify the recommended procedure for retrying CI workflows on pull request branches. By shifting from using GitHub's built-in rerun functionality to pushing empty commits, the project ensures that CI runs correctly respect concurrency settings, preventing redundant builds and resource waste. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds documentation to AGENTS.md and docs/agents/contributing.md explaining how to retry CI runs after a flake using empty commits. This approach ensures that the project's concurrency groups correctly cancel older runs, preventing duplicate jobs. The review feedback correctly points out that the provided git command examples should be updated to include the mandatory --signoff flag and follow the conventional commit format (e.g., using a 'ci' scope) to ensure that retry commits themselves pass CI validation.
| git commit --allow-empty --message "chore: retry CI after <flake-name>" | ||
| git push origin <branch> |
There was a problem hiding this comment.
The project strictly requires all commits to be signed off (as noted in the 'Commit Format' section and the repository style guide). Additionally, the project follows the type(scope): format for conventional commits. The suggested command should include the --signoff flag and a valid scope (e.g., ci) to ensure the retry commit passes CI validation.
| git commit --allow-empty --message "chore: retry CI after <flake-name>" | |
| git push origin <branch> | |
| git commit --signoff --allow-empty --message "chore(ci): retry CI after <flake-name>" | |
| git push origin <branch> |
|
|
||
| - **Retrying CI after a flake** (e.g., "rerun CI", "retry the failed run", "the build flaked, kick it again") | ||
| - Read: [`contributing.md`](./docs/agents/contributing.md), section "Retrying a CI run after a flake" | ||
| - Action: Push an empty commit with `git commit --allow-empty`. Do NOT use `gh run rerun` — it bypasses the concurrency group and leaves duplicate runs in flight |
There was a problem hiding this comment.
Since this file provides direct instructions for AI agents, the action should explicitly include the --signoff flag. This ensures that agents adhere to the project's mandatory commit signing policy without needing to infer it from other documents, which prevents them from creating invalid commits that would be rejected by CI.
References
- Each commit must have a Signed-off-by: trailer (produced by git commit --signoff). (link)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/agents/contributing.md`:
- Around line 93-96: The example retry commit omits the required --signoff and
uses a non-scoped message; update the sample git commit to include the --signoff
flag and a Conventional Commit scoped type (e.g., use "chore(ci): retry CI after
<flake-name>") so it follows the repo's mandatory commit policy and signoff
rule, then push as before; update the snippet in the contributing docs
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dd1ad901-ac48-42b1-acbe-1789620de897
📒 Files selected for processing (2)
AGENTS.mddocs/agents/contributing.md
| ```bash | ||
| git commit --allow-empty --message "chore: retry CI after <flake-name>" | ||
| git push origin <branch> | ||
| ``` |
There was a problem hiding this comment.
Align retry commit example with mandatory commit policy.
At Line 94, the sample command omits --signoff and uses a non-scoped commit message, which conflicts with this same file’s required format (type(scope): description) and signoff rule.
Suggested doc fix
-git commit --allow-empty --message "chore: retry CI after <flake-name>"
+git commit --allow-empty --signoff --message "chore(ci): retry CI after <flake-name>"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/agents/contributing.md` around lines 93 - 96, The example retry commit
omits the required --signoff and uses a non-scoped message; update the sample
git commit to include the --signoff flag and a Conventional Commit scoped type
(e.g., use "chore(ci): retry CI after <flake-name>") so it follows the repo's
mandatory commit policy and signoff rule, then push as before; update the
snippet in the contributing docs accordingly.
Empty commit to retrigger E2E that flaked on vminstance test (Create a VM Instance / Create a VM Disk) — known KubeVirt flake on a docs-only PR. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
Empty commit to retrigger Build that lost the OCI registry tag race on the previous attempt. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
Empty commit to retrigger E2E that flaked on KubeVirt vminstance test (Create a VM Instance — VMI did not get IP in 20s timeout). Same flake that hit #2489 earlier in this session; not related to the admission-chain or VAP changes in this PR. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
Empty commit to retrigger E2E that flaked on KubeVirt vminstance test (Create a VM Instance — VMI did not get IP in 20s timeout). Same flake that hit #2489 earlier in this session; not related to the admission-chain or VAP changes in this PR. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
Empty commit to retrigger E2E that flaked on KubeVirt vminstance test (Create a VM Instance — VMI did not get IP in 20s timeout). Same flake that hit #2489 earlier in this session; not related to the admission-chain or VAP changes in this PR. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
What this PR does
Document the correct way to retry a CI run after a flake on a PR branch: push an empty commit, not
gh run rerun.Why
.github/workflows/pull-requests.yamlsetsconcurrency.cancel-in-progress: true, which cancels older in-progress runs when a new push arrives on the same PR. Rerun attempts (gh run rerun --failedor the "Re-run failed jobs" button) restart jobs under the samerun_idas a new attempt, which does not re-register the run into the concurrency group. If a real fix-commit lands while a rerun is in flight, the two runs race to completion and CI minutes are spent twice.Pushing an empty commit creates a fresh workflow run that participates in the concurrency group cleanly, so the next real push cancels it as designed.
Changes
docs/agents/contributing.md— new section "Retrying a CI run after a flake" with the empty-commit recipe and a manual-cancel fallback for when a rerun is already in flight.AGENTS.md— new trigger entry for "rerun CI" / "retry the failed run" that routes to the new section.No runtime code or chart changes.
Release note
Summary by CodeRabbit