Skip to content

fix(ci): fail the stale label cleanup when listing the labelled pull requests fails - #14191

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
MarcZX10:ci/stale-conflicts-fail-on-list-error
Nov 2, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
MarcZX10:ci/stale-conflicts-fail-on-list-error

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

stale-conflicts.yml pipes gh pr list into a while read loop that removes the stale label from pull requests that have a needs rebase label. The run step has no shell set, so on Linux it runs bash -e without pipefail, and the step's status is the status of the loop. When gh pr list fails (API error, rate limit, token problem), the loop runs zero times, the step stays green, and no stale label is cleaned up. Nothing is reported.

Fix, in two commits:

  • c407ae115a: shell: bash on the step, which gives it pipefail, so the failed listing fails the step.
  • e09eb54933: tools/tests/test_stale_conflicts_workflow.py reads the step and requires shell: bash. It is registered in CMakeLists.txt after pad_input.

Impact is low: the failure only leaves stale labels in place until the next scheduled run.

Tested

Linux, Python 3.11.2, on upstream/main 1bc97b9527 plus these commits:

  • python3 tools/tests/test_stale_conflicts_workflow.py: OK with the fix.
  • Negative control: on the unfixed workflow the test fails with 'shell: bash' not found in the step's text.
  • stale-conflicts.yml parses as YAML (PyYAML) and the step's shell is bash.
  • python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main: clean.

Not run: the scheduled workflow. A maintainer can check the next run's log.

Overlap: #13993 (open, same author) adds timeout-minutes to the job header of stale-conflicts.yml, a few lines above the step changed here. The two edits do not share a line.

The overlap check fails closed on ten open pull requests that touch CMakeLists.txt and conflict with main (#1835, #5021, #7642, #9539, #10193, #10897, #11104, #13578, #13928, #13929). I searched their CMakeLists.txt patches for pad_input and stale_conflicts_workflow: none mentions them. This PR's registration sits after pad_input.

Checklist

  • Based on current main
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

…requests fails

The cleanup step pipes gh pr list into a while loop. The run step had no shell set, so the default on Linux runs bash -e without pipefail, and the step's status was the loop's status. A failed or rate-limited listing ran the loop zero times and the step stayed green, with no stale label removed and nothing reported. shell: bash gives the step pipefail.
The test reads the step that runs gh pr list in stale-conflicts.yml and checks that it sets shell: bash. Against the previous step it fails.
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1835 CMakeLists.txt
PR 5021 CMakeLists.txt
PR 7642 CMakeLists.txt
PR 9539 CMakeLists.txt
PR 10193 CMakeLists.txt
PR 13578 CMakeLists.txt
PR 13928 CMakeLists.txt
PR 13929 CMakeLists.txt
PR 14212 CMakeLists.txt
PR 14264 CMakeLists.txt

@github-actions github-actions Bot added build ci .github labels Oct 31, 2026
@oneandonlydean oneandonlydean self-assigned this Nov 1, 2026
@maskym

maskym commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Windows result for head e09eb54933, merged alone into main f2d874c1fd (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Python 3.13.5.

python -m unittest tools.tests.test_stale_conflicts_workflow: OK, three runs. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@oneandonlydean
oneandonlydean merged commit 48b244d into boykopovar:main Nov 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants