Skip to content

The nightly ignored the ref it was dispatched onto - #2399

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/nightly-dispatch-ref-ignored
Aug 21, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
fix/nightly-dispatch-ref-ignored

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Found while building a 3.5.1 release candidate to soak before tagging: I dispatched nightly.yml onto release/3.5.1 and got artifacts built from dev.

check      ref: dev          <- hardcoded
build      ref: dev          <- hardcoded  (builds + publishes the artifacts)
darling-pg ref: <dispatched> <- correct
linux      ref: dev          <- hardcoded

So the run tested release/3.5.1 and shipped dev.

The reason this is worth more than a one-line fix: nothing that would normally confirm what you built disagrees. The run's head SHA, the API, and the Actions UI all report release/3.5.1, because that genuinely is what was dispatched — only the checkout went elsewhere. I verified the head SHA matched the branch tip and that it contained #2388/#2390/#2397, and every one of those checks passed while the artifact was still dev.

What actually gave it away was the asset name: PerformanceMonitorDarling-3.5.0-nightly.20260821.zip on a branch whose Lite/PerformanceMonitorLite.csproj says 3.5.1. Both version steps read that file, so the stamped version is a direct readout of which tree was checked out — visible only if you read the filename and know what to expect.

The workflow's own comment already stated the intent:

Everything below runs only in a workflow_dispatch run — the scheduled re-dispatch or a manual one — which executes from the dispatched ref (dev for the scheduled path).

so the pins contradicted the documented design rather than expressing it. All four checkouts now resolve identically, falling back to dev for the scheduled path — which re-dispatches with --ref dev regardless.

check, build and linux pinned `ref: dev`; only darling-pg resolved the
dispatched ref. So `gh workflow run nightly.yml --ref release/3.5.1` ran
the Darling PostgreSQL tests against release/3.5.1 and built, packaged and
PUBLISHED dev -- tests on one tree, artifacts from another.

The mismatch is invisible from every surface that would normally confirm
it. The run's head SHA, the API and the Actions UI all report the
dispatched ref, because that is genuinely what was dispatched; only the
artifact came from somewhere else. It surfaced here as a 3.5.1
release-candidate build producing assets stamped 3.5.0 -- the version step
reads Lite/PerformanceMonitorLite.csproj, which says 3.5.1 on that branch
and 3.5.0 on dev -- and that is only noticeable if you read the asset name
and happen to care.

The workflow's own comment already described the intended behavior ("which
executes from the dispatched ref"), so the pins contradicted the design
rather than expressing it. All four now resolve identically, falling back
to dev for the scheduled path, which re-dispatches with --ref dev anyway.

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

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown

Reviewed. The fix itself is correct and minimal: all four checkouts (check, build, linux, and the pre-existing darling-pg) now resolve ${{ github.event_name == 'workflow_dispatch' && github.ref_name || 'dev' }} consistently, matching the pattern darling-pg already used. Since check/build/linux are all gated (directly or transitively via needs: check) on github.event_name == 'workflow_dispatch', the 'dev' fallback is inert during workflow_dispatch runs and only matters if these jobs were ever reached another way — harmless as written.

One loose end worth fixing while this file is open: .github/workflows/nightly.yml:271-274, the comment on the darling-pg checkout step, is now stale and self-contradicting:

the artifact-publishing build job stays pinned to dev either way, so a branch dispatch can never ship branch binaries

That described the old, buggy behavior. After this PR, build's checkout (line 101) resolves the dispatched ref exactly like darling-pg does — a branch dispatch can now ship branch binaries from build, which is the entire point of this fix. Left uncorrected, a future reader could read that comment as documenting intended design and "fix" build back to ref: dev, reintroducing this exact bug. (I couldn't leave an inline comment there since those lines are outside the diff hunk — flagging here instead.)

No T-SQL, no Lite/Darling app-code touched, so the style guide and parity concerns don't apply to this change.

@erikdarlingdata
erikdarlingdata merged commit 72d5811 into dev Aug 21, 2026
6 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/nightly-dispatch-ref-ignored branch August 21, 2026 10:35
erikdarlingdata added a commit that referenced this pull request Aug 21, 2026
Both were found by asking what in this release is verified by anything
other than reading the diff. The checksum fix was half-applied (#2384 fixed
the release workflow, not the nightly), and the dispatch-ref bug meant the
release candidate I built to soak was not the branch I dispatched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant