Vault IaC: Branch Planner for Forgejo deferred (upstream gitea detection bug) #1516

Closed
opened 2026-08-07 15:49:21 +00:00 by ginjiruu · 2 comments
Owner

Branch Planner for Forgejo — deferred, upstream issue + implementation doc

The "review plans in merge requests" requirement from the vault todo cannot use tofu-controller's Branch Planner as shipped.

Finding (verified against v0.16.5 source + pinned deps)

  • The Gitea/Forgejo provider is implemented in tofu-controller (newGiteaProvider, go-scm gitea driver, PAT + OAuth2 refresh, full comment editing).
  • It is unreachable: provider selection uses github.com/kubescape/go-git-url v0.0.32, which has no gitea classification. A host starting with git. (our git.animeteamspeak.moe) is mis-detected as GitLab → the planner hits /api/v4, which Forgejo does not serve (it serves /api/v1) → 404s. Any other hostname → "repository host not supported".
  • Verified empirically: go-git-url v0.0.32 returns provider="gitlab" for ssh://git@git.animeteamspeak.moe/lab/clusters. Same gap on main.

Decisions

  • Do not fork. Forking tofu-controller to fix this is a massive undertaking (CI, registries, maintenance). This is an upstream issue.
  • Branch Planner is deferred to a future milestone. Until then Vault IaC uses plan-and-manually-apply (approvePlan: "", read plan from Terraform.status, set approvePlan to apply).
  • An implementation doc capturing this finding + the fix path lives in the repo.

Actions

  • File upstream issue on flux-iac/tofu-controller: gitea/forgejo host mis-detected as gitlab (or unsupported) in branch planner provider detection.
  • Write implementation doc with the finding + recommended fix (add gitea detection to FromURL / go-git-url).
  • Track enabling Branch Planner here once upstream lands.
# Branch Planner for Forgejo — deferred, upstream issue + implementation doc The "review plans in merge requests" requirement from the vault todo cannot use tofu-controller's Branch Planner as shipped. ## Finding (verified against v0.16.5 source + pinned deps) - The Gitea/Forgejo provider **is implemented** in tofu-controller (`newGiteaProvider`, go-scm gitea driver, PAT + OAuth2 refresh, full comment editing). - It is **unreachable**: provider selection uses `github.com/kubescape/go-git-url v0.0.32`, which has **no gitea classification**. A host starting with `git.` (our `git.animeteamspeak.moe`) is mis-detected as **GitLab** → the planner hits `/api/v4`, which Forgejo does not serve (it serves `/api/v1`) → 404s. Any other hostname → "repository host not supported". - Verified empirically: `go-git-url v0.0.32` returns `provider="gitlab"` for `ssh://git@git.animeteamspeak.moe/lab/clusters`. Same gap on `main`. ## Decisions - **Do not fork.** Forking tofu-controller to fix this is a massive undertaking (CI, registries, maintenance). This is an **upstream issue**. - Branch Planner is deferred to a future milestone. Until then Vault IaC uses **plan-and-manually-apply** (`approvePlan: ""`, read plan from `Terraform.status`, set `approvePlan` to apply). - An implementation doc capturing this finding + the fix path lives in the repo. ## Actions - [ ] File upstream issue on flux-iac/tofu-controller: gitea/forgejo host mis-detected as gitlab (or unsupported) in branch planner provider detection. - [ ] Write implementation doc with the finding + recommended fix (add gitea detection to `FromURL` / go-git-url). - [ ] Track enabling Branch Planner here once upstream lands.
ginjiruu added this to the Vault IaC milestone 2026-08-07 15:49:31 +00:00
Author
Owner

Internal issue record lives in this repo at docs/vault-branch-planner-internal-issue.md (full finding + repro + suggested fix direction). Research notes: plans/tofu-controller-branch-planner-research.md.

Per maintainer decision: do not file upstream via automation — the maintainer will take the next steps on the upstream question. This ticket tracks the local state.

Internal issue record lives in this repo at `docs/vault-branch-planner-internal-issue.md` (full finding + repro + suggested fix direction). Research notes: `plans/tofu-controller-branch-planner-research.md`. Per maintainer decision: **do not file upstream via automation** — the maintainer will take the next steps on the upstream question. This ticket tracks the local state.
Author
Owner

Closing: the branch planner runs from the lab/tofu-controller Forgejo fork and posts plans on iac PRs. Remaining routeros coverage and upstreaming are tracked in lab/iac#97.

Closing: the branch planner runs from the lab/tofu-controller Forgejo fork and posts plans on iac PRs. Remaining routeros coverage and upstreaming are tracked in lab/iac#97.
Sign in to join this conversation.
No milestone
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
lab/clusters#1516
No description provided.