Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -809,14 +809,30 @@ jobs:
if: ${{ !cancelled() }}
run: |
python3 scripts/global_sink_isolation.py --self-test
# #10980: the lock-downgrade gate runs at MERGE time, not per-PR
# (a branch that merely predates a bump is not at fault, and failing
# those trains people to bypass it). Only its self-test belongs here
# -- it proves the detector still catches a downgrade and still
# passes every legitimate move.
python3 scripts/lock_no_downgrade.py --self-test
python3 scripts/global_sink_isolation.py

# #10980/#11025: Cargo.lock is a shipping input, and a regenerated lock
# can lower one consumer's resolved dependency while a newer version of
# that dependency remains elsewhere in the graph. Keep the detector's
# proof independent from unrelated lint steps so it always reports.
- name: Lockfile downgrade detector self-test
if: ${{ !cancelled() }}
run: python3 scripts/lock_no_downgrade.py --self-test

# actions/checkout checks out the synthetic merge commit for a
# pull_request event. Comparing that tree with the event's base SHA asks
# the useful question: would THIS merge move any shared consumer's pin
# backwards? A branch that merely predates a bump inherits the base's
# lock in the merge result and stays green.
- name: Cargo.lock may not downgrade vs. pull request base
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
git cat-file -e "$BASE_SHA^{commit}" 2>/dev/null \
|| git fetch --no-tags --depth=1 origin "$BASE_SHA"
python3 scripts/lock_no_downgrade.py --vs "$BASE_SHA"

# #10944's asserted-global ratchet, merge-base half. The gate above
# fails on a NEW bare process-global that a test asserts on; this
# rejects the other way round it -- a diff that adds one and records it
Expand Down
5 changes: 5 additions & 0 deletions changelog.d/11032-lock-downgrade-pr-gate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Fixed

Pull request CI now rejects `Cargo.lock` changes that lower a dependency for a
shared consumer, including `tempfile` resolving `getrandom` from 0.4.2 back to
0.3.4, before the merge can silently undo a newer pin.
Loading