Fix nightly smoke dispatch picking a stale create-release run - #14949
Merged
Merged
Conversation
A source=nightly dispatch with an empty run-id sometimes picked a months-old create-release run. The workflow runs listing, when filtered by branch and status, intermittently returns an outdated result set: repeated identical calls returned runs from May, June or two weeks ago instead of the latest. The May run had expired artifacts, which surfaced as "produced none of the expected artifacts"; a run within the 90-day artifact retention would instead have been tested silently as if it were the latest nightly. Listing without server-side filters and selecting the newest successful main run in jq returned the correct run on every call. The listing is still external state, so an auto-resolved run older than three days now fails with a message asking for an explicit run-id rather than testing a stale build. An explicit run-id bypasses the check.
Integer division to whole days truncated partial days, so a run just under four days old passed the three-day limit.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
test-smokes-built.ymlis dispatched withsource=nightlyand an emptyrun-id, the resolve job sometimes picks a create-release run from weeks or months ago. If that run's artifacts have expired, the job fails with "produced none of the expected artifacts". If they have not (retention is 90 days), the nightly legs test an old build as if it were the latest, with no error.The automatic trigger after a nightly build passes the run ID directly and is not affected.
Root Cause
The lookup added in #14706 uses
gh run list --branch main --status success --limit 1. The workflow runs listing, when filtered by branch or status, intermittently returns an outdated result set. Over 30 identical calls, 3 returned a run from June or from September 10 instead of the September 24 nightly. The same listing without server-side filters returned the latest run on every call.Fix
List the last 30 create-release runs without filters and select the newest successful
mainrun in jq. The listing is still external state, so an auto-resolved run older than three days now fails with a message asking for an explicitrun-idinstead of being tested. An explicitrun-idskips this check.Test Plan
run-idpathssource=nightlyand emptyrun-idresolved the latest nightly, then cancelled after the resolve job: https://github.com/quarto-dev/quarto-cli/actions/runs/36020984336