CI: the translation guard crashes on a force-pushed branch #1011

Closed
opened 2026-10-19 07:27:00 +00:00 by tiagoagueda · 0 comments
Owner

On a push, CI runs scripts/messages.py guard --base "$BASE" with BASE set to github.event.before, the commit the branch pointed at before the push. After a force-push (a rebase onto a newer main, say) that commit is no longer in the checkout, so git merge-base <before> HEAD exits 128 and the step dies with a CalledProcessError traceback instead of an answer. Seen on PR #1009 after its branch was rebased: git merge-base a7cc52b93… HEAD returned 128.

The guard already treats a missing or all-zero base (a new branch) by reading every commit since it left origin/main. A base git does not know should take the same path, saying so, rather than crashing. Nothing is skipped by doing that: the commits since the merge base with origin/main include every commit the push brought.

Done when the guard on an unknown base reads the branch's commits since origin/main, and a test covers it.

On a push, CI runs `scripts/messages.py guard --base "$BASE"` with `BASE` set to `github.event.before`, the commit the branch pointed at before the push. After a force-push (a rebase onto a newer `main`, say) that commit is no longer in the checkout, so `git merge-base <before> HEAD` exits 128 and the step dies with a `CalledProcessError` traceback instead of an answer. Seen on PR #1009 after its branch was rebased: `git merge-base a7cc52b93… HEAD` returned 128. The guard already treats a missing or all-zero base (a new branch) by reading every commit since it left `origin/main`. A base git does not know should take the same path, saying so, rather than crashing. Nothing is skipped by doing that: the commits since the merge base with `origin/main` include every commit the push brought. Done when the guard on an unknown base reads the branch's commits since `origin/main`, and a test covers it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#1011
No description provided.