FJ<->GH sync: replace force-mirror with a safe reconcile, relocate to Forgejo Actions #365
Labels
No labels
burndown-2026-06
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/infrastructure#365
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spun out of the o11y rollout: the git-state observer empirically confirmed the GitHub mirror is dead fleet-wide (infra#329 - the kai-server
coilysiren-github-mirrortimer was never installed; checkouts 54-58 commits ahead of GitHub on active repos). Decided home for the relocated sync: a Forgejo Actions scheduled workflow (server-side, declarative, off kai-server).Critical finding - the current scripts are NOT a merge
Both
scripts/coilysiren-github-mirror.sh(FJ->GH, 04:15) andscripts/coilysiren-forgejo-mirror.sh(GH->FJ, 03:45) dogit push --mirror, which force-updates and deletes non-shared refs. They force-reset one side to the other in sequence.GitHub is a real PR/contribution surface (
the GitHub mirror stays PR-gated), so both sides diverge: a PR merged on GitHub advances GH main while Kai's work advances FJ main. Under that concurrent divergence, the force-push clobbers the other side's commits (and--mirrordeletes the PR branch). This is latent data-loss; it only "works" today because changes rarely diverge in the same window. So there is no safe logic to port - the relocation must also fix the safety model.Required: a safe reconcile (pick the model)
--force. If a branch cannot FF (GH ahead = un-ingested PR), do NOT force - emit an ntfy alert 'GH PR needs merging into Forgejo'. Never force-pushes either side. External PRs get a human merge into canonical FJ, which is the correct review gate anyway.Build outline (after model chosen)
.forgejo/workflows/mirror-sync.yml:schedule:cron +workflow_dispatch,runs-on: docker. Iterate Forgejo repos via the search API (existing pattern), reconcile each per the chosen model./forgejo/api-token) + a repo-scoped GitHub PAT - PREREQUISITE: the current/github/patisread:packagesonly, so a new push-scoped PAT must be provisioned in SSM (own secret).o11y-ntfybase-url cache pattern; topic e.g.fleet-mirror).Cutover (after the workflow is proven)
systemd/coilysiren-github-mirror.{service,timer},systemd/coilysiren-forgejo-mirror.{service,timer}, and the two scripts. Removes 2 kai-server timers and closes infra#329 properly.Related: infra#319, infra#329, infra#334.