Move the forge from GitLab to a self-hosted Forgejo #489
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amaurycoudr/chess-project#489
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?
Problem Statement
The self-hosted GitLab CE idles at about 4.4 GiB of the 8 GB CI VPS, which leaves a CI job about 2.5 GiB and forces the job memory cap, the low Turbo concurrency and two Vitest workers. ADR 0048 makes a self-hosted Forgejo the forge instead, and ADR 0049 has production and previews pull from its registry. The repository, its CI, its deploys, its issues and the agents' tooling all still speak GitLab.
Solution
Everything Forgejo needs is written and merged on GitLab ahead of time, where it stays inert. Previews and deploys are then turned off on GitLab and every open merge request is closed out. On one switch day, Forgejo is installed beside GitLab on the CI VPS, the project is imported,
originmoves, and the first green run onmaindeploys production. Whatever breaks that day is fixed forward; there is no fallback. GitLab is backed up and stopped the same day and deleted a week later.User Stories
git.core-project.spacebehind Traefik with HTTPS, so that the forge costs a fraction of GitLab's memory.gitlab.core-project.spaceto redirect to the new host for a while, so that old links keep working.checks,front-test,e2e) to run on Forgejo Actions, so that a red change cannot reachmain.mainto accept only fast-forward merges of pull requests whose required checks passed, and no direct push, so that every commit onmainwas gated.mainto skip the gate when its pull request already passed on that commit, so that production deploys without rerunning the browser suite.mainpasses and each same-repository pull request to get anoindexpreview, removed on close and by the nightly reap, so that previews and production behave as under ADR 0049.chess-botaccount with one token per purpose (comments, registry, Renovate), each referenced only by the job that needs it, so that a compromised dependency in another job never sees it.platform: forgejo) as scheduled workflows, so that nothing GitLab scheduled is lost.forgejo dumpreplacing the GitLab backup, with the same destination and retention, so that the forge can be restored.tea, withtea apifor the gaps, documented indocs/agents/issue-tracker.mdand every skill that callsglabtoday, so that I can create, read, comment, label and close issues and open and merge pull requests on Forgejo.## Parentkept in the body, so that ordering needs no body-section parsing or link workaround.gitlab-mrplugin ported to aforgejo-prplugin andscripts/mr-status.shtoscripts/pr-status.sh, so that I am still woken when a run fails, a thread opens or a conflict appears.GLOSSARY.mdto say "pull request", with no note mapping it to a merge request, so that the vocabulary matches the forge.## Blocked bysection converted to native dependencies on switch day, so that open specs keep their order.infra/forgejo/to replaceinfra/gitlab/, deleted at the switch, withdocs/research/*gitlab*kept as history, so that the repo describes only the forge it runs on.Screens
None.
Seams
main, on switch day: the gate, the build and push, the preview, production and the bot comment run live, fixed forward. Covers 4–13.deploy/verify*.sh), run by the preview, production and reap jobs as today. Covers 11 and 21.forgejo-prplugin's tests, ported from thegitlab-mrband tests, withteafaked asglabis today. Covers 19.node --testsuite for the## Blocked byconverter, on fixture issue bodies. Covers 24.infra/forgejo/, each step ending in a check command (HTTPS answers, runner registered, mirror pushed, branch protection read back, dump written, GitLab stopped). Covers 1–3, 14–18, 20, 22–23, 25–26.Implementation Decisions
infra/forgejo/, provisioned on the CI VPS by a wizard modelled oninfra/gitlab/vps.capacity: 1, host Docker socket, a mounted volume for the shared Turbo cache, the same job memory cap and/dev/shmas today. Workflow-levelconcurrencywithcancel-in-progressreplacesworkflow:auto_cancel;capacity: 1replaces everyresource_group.87f541fdand gain the GitLab-era changes: the shared Turbo volume,reuse-gate, docs-only skipping, the audit, Renovate and backups. GitLab's dotenv job outputs become joboutputs.reuse-gateasks Forgejo's API for the pull request holding the commit and its commit status.cancel-mergedis dropped: v15 has no API to cancel a run..forgejo/workflows/andinfra/forgejo/, which GitLab ignores.!Nreferences are rewritten. Confidential issues and internal notes are not imported.Testing Decisions
.claude/skills/gitlab-mr/tests/band.test.tsfor the plugin;.claude/hooks/hooks.test.mjsfor anode --testsuite;deploy/verify*.shfor deploy checks.## Blocked bysection, "None (can start immediately)", several blockers, a blocker that is not in the project.teafailure drawn dimmed, as theglabfailure is today.Out of Scope
Further Notes
FORGEJO_TOKENmay comment on a pull request is unverified, hence the bot token for the comment.mentioned in issue #490
mentioned in issue #491
mentioned in issue #492
mentioned in issue #493
mentioned in issue #494
mentioned in issue #495
mentioned in issue #496
mentioned in issue #497
mentioned in issue #498
mentioned in issue #499
mentioned in issue #500
marked this issue as related to #490
marked this issue as related to #491
marked this issue as related to #492
marked this issue as related to #493
marked this issue as related to #494
marked this issue as related to #495
marked this issue as related to #496
marked this issue as related to #497
marked this issue as related to #498
marked this issue as related to #499
marked this issue as related to #500
mentioned in merge request !568
mentioned in commit
0bd1f48ed3