Skip to content

Fix nightly smoke dispatch picking a stale create-release run - #14949

Merged
cderv merged 2 commits into
mainfrom
fix/test-smokes-built-nightly-empty-run-id
Sep 25, 2026
Merged

cderv merged 2 commits into
mainfrom
fix/test-smokes-built-nightly-empty-run-id

Conversation

@cderv

@cderv cderv commented Sep 24, 2026

Copy link
Copy Markdown
Member

When test-smokes-built.yml is dispatched with source=nightly and an empty run-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 main run 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 explicit run-id instead of being tested. An explicit run-id skips this check.

Test Plan

  • Old and new lookup against the live API, 30 calls each: old picked a stale run 3 times, new 0 times
  • Resolve logic run locally for the normal, stale, no-match and explicit run-id paths
  • Dispatch from this branch with source=nightly and empty run-id resolved the latest nightly, then cancelled after the resolve job: https://github.com/quarto-dev/quarto-cli/actions/runs/36020984336

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.
@posit-snyk-bot

posit-snyk-bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv
cderv merged commit 4eed4a3 into main Sep 25, 2026
59 of 66 checks passed
@cderv
cderv deleted the fix/test-smokes-built-nightly-empty-run-id branch September 25, 2026 09:01
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