Skip to content

lock-refresh: land main's refresh on the main it finds at push time (closes #15144) - #15151

Open
TrapsterDK wants to merge 1 commit into
mainfrom
lock-refresh-lands
Open

TrapsterDK wants to merge 1 commit into
mainfrom
lock-refresh-lands

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Closes #15144.

Root cause: a push run of lock-refresh takes 40 or more minutes. Its "Push to main" step could only land if main still pointed at the run's own commit. Main merges every few minutes, so the push was always rejected. Each run then left the job to "the run for the newer push", which hit the same rejection, so no run ever landed.

Fix: if the push is rejected because main moved, the job applies the downloaded records onto the main it finds at push time:

  • git reset --hard to the fetched main
  • the same lock merge, normalisation and nested_cache_update
  • then a push

The records are still valid only if the host-dependent extension inputs have not changed since the recorded commit. After normalising on the new main, the job compares the digests of every os: keyed extension entry. This is the same check as host_dependent_extensions_are_locked_for_every_ci_platform. If the digests differ, the job lands nothing and the run for the newer push re-records.

To make that one code path, the merge, normalise and nested steps are now a single apply function in one step. The crate repin step, which runs only on dispatch, now runs before the merge. Normalisation still runs after it.

Checks: tools/dx check --affected passes except //tools/ci:config_consistency_test. That test fails on main with the stale rules_python entry this change lets lock-refresh fix. The jq check returns false for main's current lock and true for the lock before #15081.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvdpJxYihWhnWtH8yv

This branch has not been deployed

No deployments
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.

lock-refresh: main's lock refresh never lands

1 participant