Skip to content

docs(agents): retry CI via empty commit, not gh run rerun - #2489

Closed
Aleksei Sviridkin (lexfrei) wants to merge 3 commits into
mainfrom
docs/agents-ci-retry-empty-commit
Closed

Aleksei Sviridkin (lexfrei) wants to merge 3 commits into
mainfrom
docs/agents-ci-retry-empty-commit

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

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.yaml sets concurrency.cancel-in-progress: true, which cancels older in-progress runs when a new push arrives on the same PR. Rerun attempts (gh run rerun --failed or the "Re-run failed jobs" button) restart jobs under the same run_id as 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

NONE

Summary by CodeRabbit

  • Documentation
    • Added guide for safely retrying CI after flaky test failures on pull requests.
    • Recommends pushing an empty commit instead of using the rerun UI to prevent duplicate concurrent runs.
    • Includes fallback procedure for canceling in-progress runs when necessary.

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]>
@coderabbitai

coderabbitai Bot commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Documentation updates to AGENTS.md and contributing.md introduce guidance for retrying CI runs on PR branches. The changes recommend using git commit --allow-empty to trigger new workflow runs instead of gh run rerun, ensuring proper concurrency group behavior and preventing duplicate in-flight runs.

Changes

Cohort / File(s) Summary
CI Retry Procedures Documentation
AGENTS.md, docs/agents/contributing.md
New documentation sections explaining the safe procedure for retrying CI after flaky failures: disallow gh run rerun and recommend empty commits instead; includes manual escape hatch to cancel previous runs when needed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A commit with naught but air,
No flakes shall catch us unaware,
We push, we run, concurrency bright,
No duplicates in flight!
The workflows dance, synchronized true. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: documenting the recommended method to retry CI runs using empty commits instead of gh run rerun, which is the core purpose of this documentation update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/agents-ci-retry-empty-commit

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Documentation Update: Added a new section to the contributing documentation explaining the preferred method for retrying CI runs after a flake.
  • Workflow Guidance: Explicitly advised against using 'gh run rerun' to avoid concurrency issues and unnecessary CI costs.
  • New Best Practice: Introduced the use of empty commits as the standard way to trigger a fresh, concurrency-aware CI run.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +94 to +95
git commit --allow-empty --message "chore: retry CI after <flake-name>"
git push origin <branch>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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>
References
  1. Each commit must have a Signed-off-by: trailer (produced by git commit --signoff). (link)
  2. Each commit must follow Conventional Commits format: type(scope): brief description. (link)

Comment thread AGENTS.md

- **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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. Each commit must have a Signed-off-by: trailer (produced by git commit --signoff). (link)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9b0fe37 and d5ecac3.

📒 Files selected for processing (2)
  • AGENTS.md
  • docs/agents/contributing.md

Comment on lines +93 to +96
```bash
git commit --allow-empty --message "chore: retry CI after <flake-name>"
git push origin <branch>
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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>"
Based on learnings: "Use Conventional Commits format (`type(scope): description`) with `--signoff` flag for all git commits."
🤖 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]>
Aleksei Sviridkin (lexfrei) added a commit that referenced this pull request Apr 26, 2026
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]>
Aleksei Sviridkin (lexfrei) added a commit that referenced this pull request May 1, 2026
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]>
Aleksei Sviridkin (lexfrei) added a commit that referenced this pull request May 2, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant