Upgrade Forgejo to v17 #716
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#716
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Upgrade Forgejo from 16.0.x to v17 once v17.0.0 is tagged (due 2026-10-15). Take the newest v17.0.x patch.
The upgrade is one-way. v17 drops
watch.modeand adds six schema migrations, so a v16 binary will not start on the migrated database. Rollback is a restore of the pre-upgrade backup.Before:
package_versionrows. Thetotal_sizebackfill runs one query per version at first start, insideTimeoutStartSec=300. Run registry retention first.http://orgit://remotes.[migrations] ALLOW_UNENCRYPTEDnow defaults to false. Keep it false and tell those owners.workflow_run_*andworkflow_job_*events do not trigger extra reconciles.Staging:
-e forgejo_image_tag=<v17>-rootlessand the matching verified tag./user/settingshas no Full Name,/user/settings/accounthas no "Set as primary".Prod:
forgejo_image_tagandhealth_check_forgejo_concealment_verified_tagtogether, apply--tags registry-mirror,forgejo.gitea_*metrics are present, sign-in works, no translation alert.forgejo.org/docslinks in the portal's Actions docs and the runbook.Do not set
[service] USERNAME_PREFIX: it also applies to OIDC accounts. Code search stays off: the per-repo indexer toggle is not in v17.No longer a prerequisite of the rename (#584). The rename ran on 2026-10-15, so this upgrade runs on the renamed hosts once v17.0.0 is tagged.
Upgrade plan for v17.0.0 (
17.0.0-rootless, released 2026-10-15). v16 support ends 2026-10-29.Must fix first
SignOutanswers303to/(was200JSON forfetch()). The Caddy intercept ongit.*matches onlystatus 200, so on v17 thebitborg_sso_logoutcookie and the Keycloak end-session redirect are skipped, and the next "Sign in" is silent. Fix: add a303branch next to the200one (both until prod runs v17) that sets the cookie and redirects to/user/sso-logout. Extendtest_frontchannel_logout.shwith a stub that answers303.303to/, which carriesX-Frame-Options: SAMEORIGIN. The logout still happens; check on staging that Keycloak's logout page completes.Checked, not affected or already gated
bitborg.cssstill match v17 markup; the health-check pin gates the bump. Hand-check on staging.--color-primary-dark-5/6/7are gone (PR13224): dead lines inbitborg.css, harmless.[migrations] ALLOW_UNENCRYPTEDdefaults to false (PR13490):http:///git://mirrors stop. Count them first.actoris reserved (PR13077): check no account has it.watch.modewas dropped by a v16 migration, not v17. Forgejo's unit has noNotify=, soTimeoutStartSecdoes not bound migrations; the role's CLI retries do.Migrations
Six additive
v17a_*migrations. Only thepackage_version.total_sizebackfill grows with data (one update per version). Not reversible: v16 refuses a v17 database, so rollback is a restore.Order
main, applied to staging and prod (prod v16 keeps using the200branch).actor,action_runwebhooks, system webhook events.--tags registry-mirror,forgejo, same post-checks.16.0.6-rootless, restore the Forgejo database andforgejo-datafrom the pre-upgrade archive, apply. Cinder revert only as fallback.Opportunities after the upgrade: package quota no longer counts shared blobs per tag (PR14221),
workflow_jobwebhooks for the runner controller (PR14334, #718), safer OIDC group mappings for #77 (PR13056), probable fix for the Zoekt 500 (PR13811; PR 8106 still open, search stays off).Decision 2026-10-17: add a
303branch next to the200branch in the sign-out intercept, with a303stub test. Remove the200branch once prod runs v17. The front-channel204tweak only if staging shows Keycloak's logout page hanging.Prod pre-checks 2026-10-17 (read-only SQL): 234 package versions, so the
total_sizebackfill is trivial. 0 pull mirrors, nohttp:///git://push mirrors, noactoraccount. No webhook enables anaction_runevent. The system webhook (id 6) enablesrepositoryonly. Nothing to notify.ALLOW_UNENCRYPTEDstays at its default (false).Decision 2026-10-17: rollback is targeted by default. Restore the Forgejo database and
forgejo-datafrom the pre-upgrade archive, and leave the other databases alone. A Cinder snapshot revert is the fallback only.Decision 2026-10-17: pause
bitborg-backup-hot.timerandbitborg-registry-retention.timerfor the prod window. Hot backup resumes after the post-checks. Retention resumes after 24 h without a rollback.Decision 2026-10-17: delete the unused per-repo
pullspatch directories (PR13800) one week after the prod upgrade, once a rollback is off the table. The operator runs the command.Decision 2026-10-17: staging upgrade now. Prod as soon as staging passes all post-checks. The Caddy
303fix lands and is applied on both envs first.Staging on v17.0.0 since 2026-10-17 13:41 UTC. The six
v17a_*migrations ran in under 1 s and Forgejo listened 4 s after the restart. The health gate passed. healthz, login redirect, API version, anonymous clone and the reconciler run are fine.Blocker for prod:
forgejo doctor check(default suite) reports[E] Log Root Path /var/lib/gitea/log ... not accessible. We log to the console, and v16 created the directory as a side effect of CLI runs, while v17 does not. The restore drill fails on any[E]. Decision: the forgejo role creates the log root inforgejo-data, so hosts and restored backups have it. That lands before the prod bump.Staging v17 browser checks, 2026-10-17 (Chrome):
POST /user/logout303,GET /user/sso-logout302to the Keycloak logout, confirm, then the front-channel ping. The next "Sign in" shows the Keycloak login form. Pass.GET /user/frontchannel-logoutnow gets303to/(was200on v16). Keycloak's logout page completed and returned to the portal, and Forgejo was signed out. The sign-out intercept did not fire inside the iframe. The optional204tweak is not needed. Pass.display: none). On an account with three emails, both "Set as primary" forms are present withdisplay: none, 0 visible. Pass.Still open: the doctor
[E](#763), and Actions job, package push/pull, LFS, SSH push on 22, HTTPS token clone, metrics.#763 applied on staging:
Ensure the Forgejo log root existsreportedchangedonce, andforgejo doctor checknow has 0[E](5 checks). Doctor blocker resolved.Staging v17, operator machine 2026-10-17: SSH clone and push on 22, LFS push, a fresh SSH clone with LFS pull. Both objects match. Pass. The HTTPS token clone failed with 401. That points at the token:
services/auth/method/basic.gois unchanged from v16. Token auth is checked on prod by the registry-mirror and CI pushes with thebitborg-citoken. Actions can only be checked on prod (staging has no runners).Prod upgraded to 17.0.0 on 2026-10-17 (#764, window 15:25-15:32 UTC).
bitborg-20261017T152530Z.tar.age(success), hot backup and retention timers paused, Cinder snapshotspre-v17-gitborg-prod-{data,lfs}-20261017available.--tags registry-mirror,forgejo: reconciled clean (4 predicted, 1 known-blind extra). Sixv17a_*migrations at 15:31:04-05, listening 15:31:05. A second--checkgavechanged=0.[E], healthz 200, all health gates incl. concealment, 8/8 probes up, no new alerts (RenovateUpdateHeldTooLongisrenovate/victoriametrics, older). Registry mirror run succeeded (token auth). Runner controller queued-jobs metric 0. A CI re-run (run 1095 attempt 2) succeeded on v17. The reconciler had one failed run at 15:31:02 with 502s during the restart. The next run at 15:32:34 completed, status 0.303, Forgejo signed out. Forgejo sign-out:303path to Keycloak logout, the next sign-in shows the form.Left:
pullspatch directories.200branch of the sign-out intercept (#762).Hot backup timer back on 2026-10-17. Next run 16:17:15 UTC. Registry retention stays paused until 2026-10-18 15:32 UTC.
#765 applied 2026-10-17. Staging
changed=4, prodchanged=4, matching the dry run exactly. A second prod--checkgavechanged=0. RawPOST /user/logouton both envs:303withLocation: /user/sso-logoutand thebitborg_sso_logoutcookie (the intercept now has only the303branch). The prod browser sign-out check follows.Prod browser check after #765: Forgejo sign-out reaches the Keycloak logout (
client_id=forgejo), and the next sign-in shows the login form. Left on this issue: retention on after 2026-10-18 15:32 UTC, and thepullsdir cleanup from 2026-10-24.The first restore drill after the bump failed (2026-10-17 17:41 UTC):
forgejo migraterefused the v17 database. Cause: the window applied only--tags registry-mirror,forgejo, so the drill orchestrator still pinned16.0.6-rootless(backup_drill_forgejo_imagederives fromforgejo_image_tag). The podman image-prune keep list was stale too. A fullsite.yml --checkon prod shows exactly these two changes. Fix: apply--tags backup-drill,podman, then rerun the drill. The restore itself was fine: the DBs, Keycloak, the Forgejo volume and both restic legs restored from the new bucket.Status 2026-10-24.
bitborg_backup_drill_last_run_status0, hot and Keycloak legs 0, success at 06:13 UTC.Left: delete the unused per-repo
pullsdirs (operator), then close.Pulls dir cleanup, 2026-10-25: nothing to delete. A read-only search of the prod Forgejo data volume found 0
pullsdirectories and 0*.patchfiles across all 15 repositories. The per-repo<repo>.git/pulls/<N>.patchfiles were only written by the migration uploader, which stopped doing so in Forgejo PR 13800. Every item on this issue is done. Closing.