Skip to content

feat(release-status): add --watch, and find the tag's run by branch - #150

Merged
CybotTM merged 1 commit into
mainfrom
fix/release-status-run
Sep 22, 2026
Merged

CybotTM merged 1 commit into
mainfrom
fix/release-status-run

Conversation

@CybotTM

@CybotTM CybotTM commented Sep 22, 2026

Copy link
Copy Markdown
Member

Merging this makes release-status.sh find a release's workflow run however many other runs happened after the tag, and adds --watch, which waits for that run to complete before giving the verdict. Until now the script reported workflow : none for releases whose run had succeeded, and would have missed a failed one the same way.

The defect

The script took the 12 newest runs of every workflow and filtered them for the tag on its own side. Renovate, a merge queue and CI push a release run out of that window within hours. Measured on 2026-09-22: netresearch/raybeam v1.2.0, whose Release run 32944806553 succeeded, and netresearch/terraform-provider-ad v0.5.3 both printed workflow : none.

Changes

  • The lookup asks GitHub for the tag's runs with --branch "v$declared".
  • One tag push can start CI beside Release, so the run whose name says release or publish is preferred; only without one is the newest run on the tag taken.
  • A failed lookup prints unknown rather than none, so a broken query does not read as a missing run.
  • A running run prints in_progress/-. gh gives it conclusion: "", which jq's // treats as present, so the old filter printed in_progress/.
  • --watch waits while the tag's publishing workflow has not completed, prints each state change to stderr and then gives the normal verdict. RELEASE_STATUS_WATCH_INTERVAL and RELEASE_STATUS_WATCH_TIMEOUT tune it. The release side had no counterpart to pr-status.sh --watch; one session wrote the same hand-made loop four times.
  • SKILL.md, commands/release-status.md and CHANGELOG.md name the new option.

Testing done

The new test section stubs gh so that run list honours --branch and applies the --jq filter with real jq, with twelve newer runs of another workflow in front of the tag's runs. Those foreign runs are cancelled, so a foreign run cannot pass for the tag's successful one.

Each part was checked by breaking it and watching the suite fail, every run completing all 29 cases:

mutation failing cases
the original query from main, restored verbatim 6
no --branch 4
no release-name preference 4
a failed lookup reads as none 1
empty conclusion not handled 1
--watch ignored 3

The watch test sets a 3-second timeout, so a broken watch fails the suite in seconds instead of holding it for the default 45 minutes — an earlier version of the test without it hung on exactly that. All eight files under scripts/tests/ pass, run the way script-tests.yml runs them, and shellcheck reports nothing on the two changed scripts.

Assisted by claude-code:claude-opus-5-5 — Session

@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0e3f51bd-9a9a-4c7b-b11d-0742c70874e1

📥 Commits

Reviewing files that changed from the base of the PR and between 4992e1c and 82584c1.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • commands/release-status.md
  • skills/github-release/SKILL.md
  • skills/github-release/scripts/release-status.sh
  • skills/github-release/scripts/tests/release-status.test.sh

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.

@CybotTM
CybotTM marked this pull request as ready for review September 22, 2026 20:07
Copilot AI lite review requested due to automatic review settings September 22, 2026 20:07
@github-actions github-actions Bot added documentation Improvements or additions to documentation skill labels Sep 22, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

release-status.sh looked for the tag's workflow run among the 12 newest
runs of every workflow. Renovate, a merge queue and CI push the release
run out of that window within hours, so the script reported
"workflow : none" for releases whose run had succeeded:
netresearch/raybeam v1.2.0 (run 32944806553) and
netresearch/terraform-provider-ad v0.5.3, both on 2026-09-22. A failed
release run falls out of the window the same way, and then nothing
reports it.

The lookup now asks GitHub for the tag's runs with --branch. Among them
it prefers the run whose name says release or publish, because one tag
push can also start CI. A failed lookup prints "unknown" rather than
"none", so a broken query no longer reads as a missing run. A running
run prints "in_progress/-": gh gives it conclusion "", and jq's `//`
treats the empty string as present, so the old filter printed
"in_progress/".

--watch waits while the tag's publishing workflow has not completed,
prints each state change to stderr, and then gives the normal verdict.
The release side had no counterpart to pr-status.sh --watch, so every
wait on a release run was a hand-written loop; one session on
2026-09-22 wrote the same loop four times.

The new test stubs gh so that `run list` honours --branch and applies
the --jq filter with real jq, behind twelve newer runs of another
workflow. Each part was checked by breaking it: restoring the original
query from main verbatim fails six cases, and dropping --branch, the
release preference, the "unknown" fallback, the empty-conclusion
handling or the --watch flag each fails at least one case, every run
completing all 29 cases.

Assisted-by: claude-code:claude-opus-5-5
Agent-Session: https://claude.ai/code/session_01GY5RqMQzgKbEvCALQ7r1ec
Agent-Host: 0493f0
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@CybotTM
CybotTM force-pushed the fix/release-status-run branch from 90a52fe to 82584c1 Compare September 22, 2026 20:45
@sonarqubecloud

Copy link
Copy Markdown

@CybotTM

CybotTM commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

Self-review: 82584c1

Copilot could not review (its review is the quota error, on an earlier head) and CodeRabbit refused this head as rate-limited, so the author reviewed it.

Against real repositories. The script from this head, run with -R against four repositories released on 2026-09-22:

repository tag workflow line right?
netresearch/raybeam v1.3.0 completed/success yes — CI and Release both ran on the tag; the Release run was picked
netresearch/terraform-provider-ad v0.5.4 completed/success yes
netresearch/go-development-skill v1.16.0 completed/success yes, on the second run — see below
netresearch/ofelia v1.0.1 completed/failure yes for the run the tag push started; see the known limit

The script on main printed workflow : none for netresearch/raybeam v1.2.0 and netresearch/terraform-provider-ad v0.5.3 earlier the same day; it was not run against the other two.

One unexplained answer. The first run against go-development-skill printed none. A trace of the script a minute later showed the same gh run list --branch v1.16.0 call returning the Release run, and eight repeats of the call returned it every time. I could not reproduce or explain the empty answer; the script's logic handled both answers as intended.

Known limit, not changed here. ofelia's tag-push Release run failed on a transient network error and was repeated by a manual dispatch on main, which does not carry the tag as its branch. The script reports the tag's own run, so it shows the failure. gh run rerun <id> --failed, which references/release-discipline.md recommends for that case, reruns the same run and would have updated it. The verdict for ofelia is ok either way, because it is decided by the release body.

Code. --watch only loops while the tag is annotated and the run is not completed; watch lines go to stderr, so --json output stays parseable. A failed lookup is unknown and keeps --watch polling until the timeout, which is the intended reading of "the query failed". The six mutations listed in the description each fail the suite, every run completing all 29 cases.

Gate at this head: mergeState=CLEAN, 22 checks pass and 1 skipped of 23, 0 unresolved threads.

Assisted by claude-code:claude-opus-5-5 — Session

@CybotTM
CybotTM merged commit a926e63 into main Sep 22, 2026
24 checks passed
@CybotTM
CybotTM deleted the fix/release-status-run branch September 22, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants