Spike: Gitea/Forgejo SDK vs thin hand-written client #3
Loading…
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
The gitea adapter (Gitea + Forgejo) needs an HTTP client. Options are an existing SDK (Gitea's
code.gitea.io/sdk/gitea, or a Forgejo SDK) or a thin hand-written client over the endpoints we actually use. This is a dependency decision that shapes the adapter, so it needs evidence before the adapter ticket starts.Plan
Time-boxed (half a day). Opus decides via
engineering-decision, with the result recorded as an ADR.Evaluate each candidate against our instance:
context.Context, timeouts, pagination and error types (ourgo-developmentrules require all four)Build a throwaway prototype for the top candidate: list repos sorted by activity and list open PRs, run against git.bobparsons.dev.
Deliverable
docs/adr/0004-…with the decision, and the prototype findings in a comment. The prototype is not merged.Context
go-development→ Dependencies (new modules require an engineering decision) and I/O rules.🤖 Decided (Opus): thin hand-written client, recorded as ADR 0005 on
spike/3-forgejo-client(60ce59c). MR to follow once SSH on :2222 is back.Prototype findings against git.bobparsons.dev (Forgejo 16.0.5+gitea-1.22.0), all unauthenticated GETs:
head_commit_idcontext.ContextSetContext)cannot unmarshal array into ... ActionWorkflowJobsResponse; runs decode with emptyhead_sha/conclusion; gates pass wrongly (parses 16.0.5 as semver)errors.IsworksBoth prototypes returned the same data (36 repos, PR #18 head
5f5b724, combined status success). Thin client: 93 lines including transport, four sentinels, pagination and two calls. Deciding reason: per-call cancellation is a hard rule in go-development, and neither SDK supports it. Prototype not merged, as planned.