Skip to content

fix(bootstrap): refuse a platform still on Gitea, which Forgejo can't open, before changing anything - #135

Open
Teg79 wants to merge 1 commit into
mainfrom
fix/bootstrap-refuses-gitea
Open

Teg79 wants to merge 1 commit into
mainfrom
fix/bootstrap-refuses-gitea

Conversation

@Teg79

@Teg79 Teg79 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

urbex bootstrap refuses a platform created by urbex 0.1.0, whose forge is still Gitea, before it changes anything (#134).

  • internal/bootstrap/forgeguard.go (new): refuseGiteaPlatform reads the forge's compose file as the GitOps repo keeps it. Every bootstrap copies it there, 0.1.0's included (platform/gitea/compose.yaml). An image: of gitea/gitea (with or without docker.io/, by tag or digest) returns ErrPlatformRunsGitea.
    • The message says the platform comes from 0.1.0 and that Forgejo can't read Gitea 1.24's database. It gives the way on: back up the named volumes, urbex destroy each environment (teardown requires it), urbex teardown, urbex bootstrap, push the repos and urbex apply again. Or stay on 0.1.0.
    • It points to the CHANGELOG's Upgrading.
    • No network: the GitOps repo is there whenever the platform's LXCs are (bootstrap already requires its Terraform state).
  • internal/bootstrap/orchestrator.go: the check runs right after the existing machines are listed, when urbex-gitea is among them. It comes before the assets are written, the template, Terraform or Ansible, so nothing is changed and the exit is non-zero.
  • internal/bootstrap/orchestrator_test.go: TestRun_RefusesAPlatformStillOnGitea:
    • refused with the message's key parts, no command run, nothing materialized;
    • a Forgejo platform, a new platform (no copy) and a missing repo go on;
    • docker.io/gitea/gitea:1.24 and gitea/gitea@sha256:... are refused too.
  • CHANGELOG.md: under Fixed.

Companion: urbforge/urbex#103 (upgrading from 0.1.0 to 0.2.0, and the cli skill). The CHANGELOG's Breaking/Upgrading are in #133.

Why

#134. I reproduced it locally: codeberg.org/forgejo/forgejo:15.0.11 on a gitea/gitea:1.24 (1.24.7) volume exits with "Your database (migration version: 321) is for a newer Forgejo ... (305)", so a 0.1.0 platform bootstrapped with today's main lost its forge. Teg's decision: v0.2.0 from main, with this guard.

Tests I ran

  • mise run test, mise run lint: pass.
  • mise run e2e: passed, 24 steps. Its second bootstrap, on a Forgejo platform, isn't refused.
  • The lab's GitOps repo (a Forgejo platform) isn't refused; the message printed as above.
  • Not run: against a real 0.1.0 platform. None is left on the lab; the test uses 0.1.0's compose line (image: gitea/gitea:1.24, from the v0.1.0 tag).

Checklist before review

  • Linked issue, Conventional Commit title
  • Tests added
  • CHANGELOG entry, docs in the companion PR
  • No secrets, tokens or private addresses

Fixes #134

🤖 Generated with Claude Code

https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA

… open, before changing anything

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(bootstrap): refuse a 0.1.0 platform still on Gitea instead of starting Forgejo on its data

1 participant