Skip to content

ci: Fail PRs that move a submodule pointer backwards (#693) - #717

Merged
zackees merged 2 commits into
masterfrom
ci/693-submodule-direction
Oct 14, 2026
Merged

zackees merged 2 commits into
masterfrom
ci/693-submodule-direction

Conversation

@zackees

@zackees zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes #693
Refs #699

  • ci/submodule_direction.py <base> checks every gitlink that differs between <base> and HEAD. The new pointer must descend from the base pointer (git merge-base --is-ancestor). Missing commits are fetched; a submodule that isn't checked out is cloned bare. The error names the path and both SHAs, explains the fix (git submodule update), and mentions the submodule: title override.
  • PR CI runs it as an early check-event step (pull_request and merge_group), so a backwards move fails before any build runs.
  • coordination.md documents the rule and how to run it locally.

RED → GREEN

  • RED: ci/test_submodule_direction.py fails at import (no script).
  • GREEN: 7 tests pass (temp superproject plus a submodule with history a→b→c and x off a): unchanged, forward bump, backwards, sideways, title override, fetch-missing-commits, and the workflow wiring. ./lint is ok.
  • On this repo: uv run ci/submodule_direction.py origin/master passes (rc 0). Replaying the last websocket bump in reverse (cb262980e → its parent) fails with plugins/obs-websocket: moves backwards from 547f5ea8e to 3e4655369 ... (rc 1).

ci/submodule_direction.py checks every changed gitlink against the base
pointer with git merge-base --is-ancestor, fetching or cloning the
submodule as needed. PR CI runs it in check-event for pull_request and
merge_group; 'submodule:' in the PR title allows a deliberate move back.

Fixes #693
@zackees
zackees force-pushed the ci/693-submodule-direction branch from f5a3b15 to 65fc34f Compare October 14, 2026 08:58
@zackees
zackees added this pull request to the merge queue Oct 14, 2026
Merged via the queue into master with commit 0b620fa Oct 14, 2026
22 checks passed
@zackees
zackees deleted the ci/693-submodule-direction branch October 26, 2026 15:42
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.

ci: Fail PRs that move a submodule pointer backwards

1 participant