Skip to content

Fix rc-smoke.yml resolving the wrong branch on automatic trigger - #465

Merged
Kobikg78 merged 1 commit into
developmentfrom
fix-rc-smoke-release-branch-resolution
Jul 26, 2026
Merged

Fix rc-smoke.yml resolving the wrong branch on automatic trigger#465
Kobikg78 merged 1 commit into
developmentfrom
fix-rc-smoke-release-branch-resolution

Conversation

@Kobikg78

Copy link
Copy Markdown
Collaborator

Summary

rc-smoke.yml's automatic (workflow_run) trigger has never actually smoke-tested a real RC since it was added in #446 (2026-04-26). Root cause: workflow_run events only expose head_sha/head_branch for the ref rc-release.yml was dispatched with (e.g. development), never the releases/** branch its own prepare-branch job creates during the run. So every automatic smoke run checked out development, saw its stale (last real release's) pubspec.yaml version, concluded "not an RC," and silently skipped — with conclusion: success, so nothing ever flagged it as broken.

Confirmed directly against the 6.18.1-rc1/rc2 RCs cut in this session: both automatic smoke runs skipped with pubspec version is not an RC (6.18.0); skipping. The manual workflow_dispatch path (with explicit rc_version/release_branch inputs) was unaffected and worked correctly both times.

Fix

Instead of trusting workflow_run.head_sha/head_branch, resolve the actual RC from the GitHub prerelease that create-prerelease just published:

  • Query GET /repos/{owner}/{repo}/releases, filter to prerelease: true, take the most recently created one.
  • Sanity-check its created_at is within 30 minutes of the triggering run's completion (workflow_run.updated_at) — guards against picking up a stale/unrelated tag.
  • Derive the release branch from the tag using the same releases/${MAJOR}.x.x/${MAJOR_MINOR}.x/${VERSION} convention rc-release.yml already computes.
  • Check out that branch, and keep a defensive re-check that pubspec.yaml on it actually matches the resolved version.

No new secrets required — this only reads public release metadata via the default GITHUB_TOKEN.

Test plan

  • ruby -ryaml -e "YAML.load_file(...)" — valid YAML.
  • Next real RC cut should show rc-smoke/pub.dev actually running (not silently skipping) on its automatic trigger.

🤖 Generated with Claude Code

workflow_run events only expose head_sha/head_branch for the ref
rc-release.yml was dispatched WITH (e.g. development), never the
releases/** branch its own prepare-branch job creates during the run.
Trusting those fields meant every automatic smoke run checked out
development (still at the last real release's version), saw a
non-RC pubspec version, and silently skipped — since rc-smoke.yml
was added in #446 (Apr 26, 2026), the automatic path has never
actually smoke-tested a real RC.

Fix: resolve the actual RC from the GitHub prerelease that
create-prerelease just published (tag_name + created_at, sanity
checked against the triggering run's completion time within 30 min),
derive the release branch from that tag using the same naming
convention rc-release.yml computes, and check that branch out
instead. Manual workflow_dispatch path (rc_version/release_branch
inputs) is unaffected — it already worked correctly, as verified by
manually running it for 6.18.1-rc1/rc2.

No new secrets needed — reading releases via the API only requires
the default GITHUB_TOKEN's existing read access.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@Dani-Koza-AF Dani-Koza-AF left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks like a legit fix

@Kobikg78
Kobikg78 merged commit 7204ffb into development Jul 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants