fix(ci): set up Python before pip in the bricked-PR audit, so it can run at all - #244
Merged
Merged
Conversation
…run at all Bugbot HIGH on the staging promotion PR #243. `bricked-prs.yml` runs `pip install --quiet pyyaml` on `ubuntu-latest` with no `actions/setup-python`. Ubuntu 24.04 marks its system Python externally managed (PEP 668), so pip refuses, the step fails, and THE AUDIT NEVER RUNS. The dependency is real, not incidental: bricked-prs.py loads caller-drift.py for the protection reader, and that module hard-fails without PyYAML by design. So the install cannot simply be dropped. Worse than a broken job. This audit's whole purpose is to find PRs blocked by a required check that never reports -- a silence. A guard that cannot start produces exactly the same silence as a clean fleet, so its failure looks like its success. Nothing else would have said so. bricked-prs-selftest.yml already sets up Python 3.12 before the identical install, so this is that shape rather than a new decision -- the audit and its selftest now agree, which is also why the selftest never caught this. Checked the class rather than the instance: this was the ONLY workflow in the repo with a `pip install` and no `setup-python`. actionlint clean; YAML parses; setup-python pinned by SHA with its version comment per the action-pins gate.
saqlainsyed007
approved these changes
Aug 13, 2026
saqlainsyed007
left a comment
There was a problem hiding this comment.
Review — APPROVE
What this does: Inserts actions/setup-python@…be951 # v5.6.0 (Python 3.12) immediately after checkout in bricked-prs.yml, so the subsequent pip install --quiet pyyaml runs against a managed interpreter instead of the system Python that Ubuntu 24.04 marks externally-managed (PEP 668).
Correctness — verified:
- The root cause is real: the job did
pip install pyyaml→python3 scripts/bricked-prs.pywith nosetup-python, andbricked-prs.pyhard-fails without PyYAML (via thecaller-drift.pyprotection reader). Onubuntu-latest(24.04) the install would abort under PEP 668 and the audit never runs. - The fix mirrors the sibling exactly:
bricked-prs-selftest.ymlalready uses the identicalsetup-pythonSHA pin, version comment, and step order before the same install. - After
setup-python,pip,python, andpython3all resolve to the same 3.12 interpreter, so PyYAML installed by thepipstep is importable by thepython3audit step. Consistent. - Confirmed the "only workflow" sweep: on
develop,bricked-prs.ymlwas the sole workflow withpip installand nosetup-python(the other four —bricked-prs-selftest,caller-drift,standards-sync,version-bump-gate-selftest— all already set it up).
Conventions / security: Action pinned by commit SHA with its version comment, per the action-pins gate. Workflow-only change; no auth or data-path impact.
Minimal, correct, and consistent with the established pattern. LGTM.
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.
Bugbot High on the staging promotion PR #243.
The audit cannot start
bricked-prs.ymlrunspip install --quiet pyyamlonubuntu-latestwith noactions/setup-python. Ubuntu 24.04 marks its system Python externally managed (PEP 668), so pip refuses, the step fails, and the audit never runs.The dependency is real:
bricked-prs.pyloadscaller-drift.pyfor the protection reader, and that module hard-fails without PyYAML by design. The install cannot just be dropped.Why this is worse than an ordinary broken job
This audit exists to find PRs blocked by a required check that never reports — it hunts a silence. A guard that cannot start produces exactly the same silence as a clean fleet, so its failure is indistinguishable from its success, and nothing else in the org would have said otherwise.
The fix is the sibling shape, not a new idea
bricked-prs-selftest.ymlalready sets up Python 3.12 before the identical install. The audit and its selftest now agree — which is also why the selftest never caught this: it was testing a correctly-configured job.Checked the class, not the instance
Swept every workflow in the repo: this was the only one with a
pip installand nosetup-python.actionlint clean, YAML parses,
setup-pythonpinned by SHA with its version comment per the action-pins gate.Note
Low Risk
Workflow-only change mirroring an existing sibling job; no application, auth, or data-path changes.
Overview
The scheduled bricked PRs audit was failing on
ubuntu-latestbecausepip install pyyamlran against the system Python withoutactions/setup-python, triggering PEP 668 on Ubuntu 24.04 and aborting beforebricked-prs.pyever ran.This change inserts
actions/setup-python(3.12) immediately after checkout—the same step order and pin already used inbricked-prs-selftest.yml—so PyYAML installs into a managed interpreter and the org-wide “required check that never reports” guard can actually execute.Reviewed by Cursor Bugbot for commit d319338. Bugbot is set up for automated code reviews on this repo. Configure here.