merge feat/pushmirror-branchfilter (cbf12900eb) #103

Merged
pipeline-bot merged 1 commit from feat/pushmirror-branchfilter into trunk 2026-07-29 13:40:38 +00:00
Contributor
No description provided.
feat(pushmirror): require a branch filter, and verify Forgejo honored it
All checks were successful
pipeline/ci CI green vcbf12900eb53
cbf12900eb
Forgejo's addPushMirrorRemote branches on BranchFilter: empty takes
`git remote add --mirror`, which writes fetch = +refs/*:refs/* and aliases
the remote's heads onto LOCAL refs/heads/*. Git's own post-push tracking-ref
write-back then rewrites local main to the remote's lagging value - the
reverter that force-reverted releases within the same second and got
ForgejoPushMirror retired wholesale in July. A non-empty filter takes the
plain-remote path, where tracking refs land under refs/remotes/ and cannot
touch main.

So branchFilter is now required with MinLength=1, and refused at reconcile
even if an older CR carries an empty one.

Sending it needs raw JSON: neither gitea SDK v0.24.1/v0.25.1 nor the
Forgejo-native SDK v2.2.0 models branch_filter (the field is a Forgejo
divergence; the Forgejo SDK forked the gitea struct and inherited the gap).
The SDK would have marshalled a body without it, Forgejo would have seen an
empty filter, and the CR would still have read as configured - a silently
dropped safety field. So the push-mirror path speaks raw JSON and RE-READS
the stored filter; if it did not take, the just-created mirror is deleted
and the reconcile fails, because an unsafe mirror left syncing is worse than
no mirror at all.

Settings matching now compares branchFilter too, so a filterless mirror from
before this change is replaced rather than adopted - Forgejo only writes the
remote at create time, so adopting one would keep the reverter forever.
pipeline-bot deleted branch feat/pushmirror-branchfilter 2026-07-29 13:40:38 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
sean/forgejo-operator!103
No description provided.