Skip to content

Commit d5ecac3

Browse files
committed
docs(agents): retry CI via empty commit, not gh run rerun
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]>
1 parent 9b0fe37 commit d5ecac3

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎AGENTS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ working with the **Cozystack** project.
2323
- Read: [`overview.md`](./docs/agents/overview.md)
2424
- Action: Read relevant sections to understand project structure and conventions
2525

26+
- **Retrying CI after a flake** (e.g., "rerun CI", "retry the failed run", "the build flaked, kick it again")
27+
- Read: [`contributing.md`](./docs/agents/contributing.md), section "Retrying a CI run after a flake"
28+
- 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
29+
2630
- **General questions about contributing**
2731
- Read: [`contributing.md`](./docs/agents/contributing.md)
2832
- Action: Read the file to understand git workflow, commit format, PR process

‎docs/agents/contributing.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,19 @@ Fill in the template at [`.github/PULL_REQUEST_TEMPLATE.md`](../../.github/PULL_
8686

8787
Create the PR with `gh pr create --title "type(scope): brief description" --body-file <file>`.
8888

89+
## Retrying a CI run after a flake
90+
91+
Do NOT use `gh run rerun --failed` (or the "Re-run failed jobs" button) on a PR branch. Push an empty commit instead:
92+
93+
```bash
94+
git commit --allow-empty --message "chore: retry CI after <flake-name>"
95+
git push origin <branch>
96+
```
97+
98+
The `.github/workflows/pull-requests.yaml` workflow is configured with `concurrency.cancel-in-progress: true`, which cancels older runs when a new push arrives on the same PR. A rerun restarts jobs under the *same* `run_id` as a new attempt, which does not re-register into the concurrency group — so if a real fix-commit lands while the rerun is in flight, both runs race to completion and operators pay twice. The empty-commit path participates in the concurrency group cleanly, so the next real push cancels it as expected.
99+
100+
If you already fired `gh run rerun` and need to push a follow-up, cancel the old run manually before pushing: `gh run cancel <run-id> --repo cozystack/cozystack`.
101+
89102
## Fetching Unresolved Review Comments
90103

91104
Cozystack uses GitHub review threads with resolution status. Only unresolved threads are actionable — resolved threads are already handled.

0 commit comments

Comments
 (0)