Skip to content

fix(push): allow explicit exact-head leases for rewritten history (Refs #4896) - #4937

Merged
zackees merged 2 commits into
masterfrom
fix/4896-push-rewrite
Nov 17, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/4896-push-rewrite

Conversation

@zackees

@zackees zackees commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

./push rejects an intentional history rewrite even after its client proofs and final signing succeed. Add ./push --replace-remote-head <old-sha> so a caller can explicitly authorize replacement of the exact current remote commit. The option checks the actual push destination and uses --force-with-lease=refs/heads/<branch>:<old-sha>. Missing branches, mismatched heads, abbreviated SHAs and symbolic refs are refused. A concurrent update remains protected by Git's atomic lease. Default fast-forward and automatic pure re-stamp behavior remain unchanged.

Refs #4896. This extends #4904 for rebased or reset-and-cherry-picked branches and leaves the umbrella issue open. The option is documented beside the existing push instructions in docs/ci-tooling.md.

Validation:

  • Local RED commit c88a9c96b: uv run --no-project python ci/tests/test_push_rungs.py RestampPublication ran 15 tests and failed nine assertions/subcases. Matching rewrites were rejected; mismatched and missing heads were not rejected before attempting publication; invalid SHA arguments were ignored.
  • GREEN: uv run --no-project python ci/tests/test_push_rungs.py passed all 46 tests in 38.171 seconds. Real temporary Git repositories cover reset/cherry-pick rewrites, default refusal, exact-lease success, stale-SHA refusal, missing branches, separate push URLs and a concurrent remote update.
  • One full SOLDR_PORCELAIN=0 timeout 1200s ./lint run passed (exit 0, lint lane 91.7 seconds).
  • This is a CI/tooling change; OBS C/Rust port and protocol test tiers do not apply. Hosted validation remains required for this trust-surface change.
  • ./push passed with complete prooft evidence: 19 Ci-Attestation records plus Client-Checks, including clippy and Dylint for all six targets, repository self-tests/validators, and the host test configurations. The main workspace pass ran 8,664 tests successfully (six skipped); the additional feature pass ran 918 successfully. Client-test lane: 484.6 seconds. Final published HEAD a263bd62dcb7cc48f65093a3a37097fbfc984a25 passes git verify-commit.
  • Optional Swift evidence was unavailable: client checks: no proof: [Errno 2] No such file or directory: 'swift-format'. This PR changes no Swift files; the complete required non-Swift gate inventory was produced.

#4896)

Ci-Attestation: {"at":1794876863,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":82,"stamp":"87d98e21a739b0dda33b41c77b593d7c","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876863,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":82,"stamp":"514d2f4f0484ee5ca37511d8433ded59","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876863,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":82,"stamp":"b7d288bae20aefea12654893366fa958","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876863,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":82,"stamp":"71822b31beac36fdf24652d4e0f6b3db","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876779,"gate":"general/all/client-lint","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"0ff16732ec32c20da08eab01e28af429","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876863,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":82,"stamp":"3b515ed95ad412340f66dfc2712c4406","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876780,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"8a7448c8970a0e0170e714f5a36b8a03","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876780,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"d696281bd8d6a9d17ddbacc2b89ee13b","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876780,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"b8ecd6ea699d598d720e00d654e1e771","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876780,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"fcdc4513ee5c4c134d47bb51de972653","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876779,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"ad468e5176941bb784bbf8a648cb3b4a","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876779,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"b9899c2e866b6eabcf99637cf01cc892","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876780,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"3c72ef4d9ea3431d8de9199802475c60","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876780,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"dec200c811e05d3b7d636a4c4522a710","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876780,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"83c1a8e91c0aa024c301dc348598181d","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876780,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"c166631e28cc4b19ef9ac0d88c6d2c06","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876779,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"195a9883b4d1eb539a43b4d9703d0255","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794876779,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"c59923ea3c8710de3ffc75e0cd83bfd5b5b98970a0a508d871504eb2e4aaa18b","lane":"client-lint","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":14,"stamp":"dcff6cd7254f92b86350e06b139539e9","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}
Ci-Attestation: {"at":1794877349,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"5dcebfd563aa3560a1bd27fb05d14c21070b2e0bf2b192ca0f84fd6f8a336263","lane":"client-test-x86_64-unknown-linux-gnu","parents":["c88a9c96b1fa2f58b3a8c2ab2815c3a5db8a58e6"],"secs":485,"stamp":"896a4f4ae995ee01e0594761d9f83619","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"aace99f022e7df01735d4fc3d8072e89b557631b","coverage":"all-tracked-applicable-files","diff":["ci/tests/test_push_rungs.py","docs/ci-tooling.md","push"],"head":"abc29c4d89ae9e1c2559feb2242d46aa4852e649","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"1d511789154862ba0bb3e1ad47ff3b4b2550a4ab01b24806a05c1c19d21cf93a","tree":"8c23b7724269a6e11951055b922b2d2fb37fe0a1"}}
@zackees
zackees marked this pull request as ready for review November 17, 2026 01:04
@zackees
zackees enabled auto-merge November 17, 2026 01:04
@zackees
zackees added this pull request to the merge queue Nov 17, 2026
Merged via the queue into master with commit 21d62fe Nov 17, 2026
41 checks passed
@zackees
zackees deleted the fix/4896-push-rewrite branch November 17, 2026 02:43
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review to Done in obs-rust Multiview Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant