Skip to content

ci(bump-callers): harden the main-tip lookup in the 5 sibling entrypoints (BE-4683) - #82

Merged
mattmillerai merged 1 commit into
mainfrom
matt/be-4683-harden-main-tip-lookup
Jul 28, 2026
Merged

ci(bump-callers): harden the main-tip lookup in the 5 sibling entrypoints (BE-4683)#82
mattmillerai merged 1 commit into
mainfrom
matt/be-4683-harden-main-tip-lookup

Conversation

@mattmillerai

Copy link
Copy Markdown
Contributor

ELI-5

Five of our "bump the pinned SHA in every caller repo" workflows looked up the current tip of main like this: main_tip=$(git ls-remote origin refs/heads/main | cut -f1). A shell pipeline reports the exit status of its last command, so bash -e only ever saw cut succeed — a failed ls-remote (network blip, remote hiccup, rate limit) quietly left main_tip empty. Empty then compared unequal to github.sha, so the guard printed "stale run/re-run; nothing to bump" and exit 0. The workflow reported success while bumping nothing, and a green run that bumped nothing looks exactly like a green run that bumped everything unless a human reads the log. That is precisely the silent-drift failure this machinery exists to prevent (AGENTS.md records a pin that never moved causing a real ci-groom.yml startup failure).

This runs ls-remote on its own so its exit status is actually checked, rejects empty output, and only then compares against github.sha. A lookup we couldn't perform is not evidence of staleness — so it now fails loudly instead of pretending the run was stale.

What changed

The fix already landed in bump-auto-label-callers.yml (commit 7b360ed, branch ci/auto-label-bump-fleet / #81) is ported verbatim to the five sibling entrypoints that #81 left untouched:

  • .github/workflows/bump-cursor-review-callers.yml
  • .github/workflows/bump-groom-callers.yml
  • .github/workflows/bump-assign-reviewers-callers.yml
  • .github/workflows/bump-pr-size-callers.yml
  • .github/workflows/bump-agents-md-callers.yml

Each file's surrounding explanatory comment is preserved and the stale-run branch itself is byte-for-byte unchanged — the only behavior change is that a failed or empty lookup now exits 1 with a ::error:: annotation instead of falling through to the stale-run exit 0.

Verification

  • bash .github/bump-callers/tests/test_bump_callers.sh123 passed, 0 failed.
  • shellcheck -x .github/bump-callers/bump-callers.sh .github/bump-callers/tests/test_bump_callers.sh → clean.
  • These tests cover the shared script, not the entrypoints' inline run: blocks, so additionally: all five files parse as YAML, and each edited run: block passes bash -n and shellcheck -s bash after extraction.
  • All three branches of the new guard exercised locally: success parses a 40-hex SHA (daf635a…); a bogus remote exits 1 with ::error::Could not look up the current main tip; a non-existent ref (empty output) exits 1 with ::error::git ls-remote returned no SHA. Confirmed under both set -euo pipefail and plain set -e (GitHub's default run shell), since if ! var=$(cmd) suspends -e in the condition and must not swallow the failure.

Risk / falsification

The change converts a silent skip into a hard failure, so the one real risk is git ls-remote origin not working in the runner at all — it runs after actions/checkout with persist-credentials: false. Falsified empirically against the real runner, not assumed: the log of run 30222872404 (bump-groom-callers, 2026-07-26, success) shows the ls-remote line executing, no stale-tip message, and the job reaching groom bump complete for all callers. The repo is public, so anonymous HTTPS ls-remote succeeds; reproduced locally against https://github.com/Comfy-Org/github-workflows.git.

Judgment calls / notes

Closes BE-4683.

…ints (BE-4683)

`main_tip=$(git ls-remote origin refs/heads/main | cut -f1)` reports the
exit status of `cut`, not of `ls-remote`, so the step's `bash -e` never sees
a failed lookup. On an ls-remote failure (network blip, remote hiccup, rate
limit) main_tip was set to the empty string, the staleness guard compared
empty != github.sha, printed the stale-run message and `exit 0` — a green run
that bumped nothing, indistinguishable from a green run that bumped
everything unless someone read the log. That is precisely the silent-drift
failure mode this machinery exists to prevent.

Port the shape already landed in the auto-label entrypoint: run ls-remote on
its own so its status is checked, reject empty output, and only then compare
against github.sha. A lookup we could not perform is not evidence of
staleness — fail loudly instead.

Applied verbatim to all five siblings (cursor-review, groom,
assign-reviewers, pr-size, agents-md); each file's surrounding comment is
preserved and the stale-run branch is unchanged.
@mattmillerai mattmillerai added cursor-review Multi-model cursor review agent-coded Authored by the agent-work loop labels Jul 27, 2026
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e516ab57-bca7-46d6-a60f-215b76cdc05e

📥 Commits

Reviewing files that changed from the base of the PR and between daf635a and feda217.

📒 Files selected for processing (5)
  • .github/workflows/bump-agents-md-callers.yml
  • .github/workflows/bump-assign-reviewers-callers.yml
  • .github/workflows/bump-cursor-review-callers.yml
  • .github/workflows/bump-groom-callers.yml
  • .github/workflows/bump-pr-size-callers.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matt/be-4683-harden-main-tip-lookup
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch matt/be-4683-harden-main-tip-lookup

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

✅ No high-signal findings.

Panel: 8/8 reviewers contributed findings.

@mattmillerai
mattmillerai merged commit 5fbfc7f into main Jul 28, 2026
26 checks passed
@mattmillerai
mattmillerai deleted the matt/be-4683-harden-main-tip-lookup branch July 28, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-coded Authored by the agent-work loop cursor-review Multi-model cursor review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants