Skip to content

ci(nightly): trigger from a nightly PR label - #2645

Merged
max-sixty merged 4 commits into
mainfrom
nightly-label
May 8, 2026
Merged

max-sixty merged 4 commits into
mainfrom
nightly-label

Conversation

@max-sixty

@max-sixty max-sixty commented May 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add a nightly PR label as an iteration knob for nightly-only failures on top of the existing path-based auto-trigger — both work.

The nightly workflow now runs on PR events when either:

  • the PR diff touches **/Cargo.toml, Cargo.lock, rust-toolchain.toml, or .github/workflows/nightly.yaml (existing behaviour, preserved), or
  • the PR has the nightly label (new — for fixes that don't touch those paths, like the nix-flake sandbox suite).

A single gate job decides via dorny/paths-filter@v3; downstream jobs gate on needs.gate.outputs.run == 'true'. Cron, workflow_dispatch, and main-push paths-trigger pass through unchanged. The pattern mirrors prql's tests.yaml rules job.

The nightly label has been created on the repo.

Test plan

  • YAML parses (python -c 'import yaml; yaml.safe_load(...)').
  • Unlabelled PR with no Cargo diff: gate.outputs.run == 'false', downstream skipped (this PR exercises that path until labelled).
  • Add nightly label: gate reruns, outputs.run == 'true', downstream runs.
  • PR touching Cargo.toml without label: gate detects path change, outputs.run == 'true'.

🤖 Generated with Claude Code

The nightly workflow only ran on cron, on workflow_dispatch, and on
PRs/pushes that touched `Cargo.toml`/`Cargo.lock`/`rust-toolchain.toml`/
`nightly.yaml`. Iterating on fixes for nightly-only failures (e.g. the
nix-flake sandbox tests on #2642) meant either waiting for the cron
run or invoking `gh workflow run --ref <branch>` by hand and watching
the run page.

Add a `nightly` label as the iteration knob. Drop the `paths` filter on
the `pull_request` trigger and gate every job on a single `gate` job
whose `if:` runs only when the event isn't a PR or the PR carries the
`nightly` label. `synchronize` re-runs while the label remains
attached, so subsequent pushes get checked without re-labelling.

The cron run still catches drift that isn't commit-correlated, and the
push-to-main path filter still catches Cargo-affecting changes after
merge — so the only behaviour change is "PRs touching Cargo.toml no
longer auto-trigger nightly". The label can be added in those cases
when desired.

Label created on the repo (`nightly`, light blue).

Co-Authored-By: Claude <noreply@anthropic.com>
Restore the auto-trigger on dependency/toolchain-affecting PR diffs that
the previous commit dropped. The `gate` job now ORs the `nightly` label
against a path check (`gh pr view --json files`), and downstream jobs
gate on `needs.gate.outputs.run == 'true'`.

Drops the requirement to label every Cargo bump manually while keeping
the label as the iteration knob for fixes that don't touch those paths
(nix-flake sandbox tests, etc.).

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

@worktrunk-bot worktrunk-bot 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.

One issue: the else branch's diagnostic has unescaped backticks inside a double-quoted string, so bash treats them as a command substitution running nightly. Result: stderr emits nightly: command not found and the printed line silently drops the word — run=false (no label, no cargo-affecting paths). The GITHUB_OUTPUT write is unaffected (gating still works), it's just a logged-output bug.

Inline suggestion below.

Comment thread .github/workflows/nightly.yaml Outdated
worktrunk-bot and others added 2 commits May 8, 2026 16:09
…literal

Backticks inside `"..."` open a command substitution, so the else-branch
diagnostic ran `nightly` and dropped the word from the printed message
(plus a `nightly: command not found` to stderr). Single-quote the message
so it renders verbatim. The `GITHUB_OUTPUT` write was unaffected — gating
still worked, this was a logged-output-only bug.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the bespoke `gh pr view --json files | grep` shell with the
standard `dorny/paths-filter@v3` action — declarative pattern list,
glob-aware (`**/Cargo.toml` now covers workspace member manifests),
no shell parsing, no auth wiring.

Mirror the `**/Cargo.toml` glob into the `push` paths trigger so both
sites stay aligned. Mirrors the pattern in the prql repo's tests.yaml.

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty
max-sixty merged commit 6ad7630 into main May 8, 2026
34 of 35 checks passed
@max-sixty
max-sixty deleted the nightly-label branch May 8, 2026 18:09
max-sixty added a commit that referenced this pull request May 8, 2026
## Summary

Comment out the `nix-flake` job in the nightly workflow. The cron-driven
run keeps creating tracking issues from a known cluster of
sandbox-specific
failures (bare `wt_command()` inheriting CWD, `target/debug` vs
`target/release`
snapshot hardcoding) that need real fixes, not noise.

The `nightly` PR-label trigger added in #2645 still works — a follow-up
PR will re-enable the job locally on its own branch and iterate on fixes
under the label, without blocking the cron from passing in the meantime.

## Test plan

- [x] YAML still parses; remaining jobs unchanged
- [x] `create-issue-on-nightly-failure.needs` no longer references the
disabled job

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <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.

2 participants