fix(ci): Lint / Test / Vet failing since bootstrap — corrects stale "CD-deploy-gap-only" assumption #3

Closed
opened 2026-07-21 21:19:21 +00:00 by mathias · 2 comments
Owner

Symptom

cd.yml job Lint / Test / Vet fails on every run (#1, #2, #3 — since 2026-05-28). Build & Import / Deploy via GitOps consequently skipped.

This corrects a stale prior assumption (brain memory project_template_go_agent_cd_deploy_gap) that freshly-bootstrapped repos from this template only fail at the deploy step due to a missing k3s/apps/<name>/deployment.yaml manifest (that pattern is real for e.g. parallax#2, but current data shows template-go-agent itself is red at Lint / Test / Vet — a step before deploy). Since this is the source template other repos are generated from, a broken check here likely propagates to every repo scaffolded from it.

Surfaced via homelab-alerts RepoCIRedStuck (ntfy, 2026-07-21 01:03 UTC).

Investigation needed

  • Pull actual job logs (not available via REST/MCP this session).
  • Given prior note "template also ships no go.sum + 2 errcheck bugs" — check if that's the current failure cause.

Acceptance criteria

  • Root cause identified and fixed.
  • Lint / Test / Vet green on main.
  • Brain memory project_template_go_agent_cd_deploy_gap updated/corrected once root cause confirmed.
## Symptom `cd.yml` job `Lint / Test / Vet` fails on every run (#1, #2, #3 — since 2026-05-28). `Build & Import` / `Deploy via GitOps` consequently `skipped`. **This corrects a stale prior assumption** (brain memory `project_template_go_agent_cd_deploy_gap`) that freshly-bootstrapped repos from this template only fail at the *deploy* step due to a missing `k3s/apps/<name>/deployment.yaml` manifest (that pattern is real for e.g. parallax#2, but current data shows `template-go-agent` itself is red at `Lint / Test / Vet` — a step *before* deploy). Since this is the source template other repos are generated from, a broken check here likely propagates to every repo scaffolded from it. Surfaced via homelab-alerts `RepoCIRedStuck` (ntfy, 2026-07-21 01:03 UTC). ## Investigation needed - Pull actual job logs (not available via REST/MCP this session). - Given prior note "template also ships no go.sum + 2 errcheck bugs" — check if that's the current failure cause. ## Acceptance criteria - Root cause identified and fixed. - `Lint / Test / Vet` green on `main`. - Brain memory `project_template_go_agent_cd_deploy_gap` updated/corrected once root cause confirmed.
Author
Owner

Correction to my own issue body: this isn't actually contradicting prior notes — a prior brain memory (project_template_go_agent_cd_deploy_gap) already predicted this exact failure: "template shipped no go.sum (run go mod tidy) and two errcheck lint bugs (deferred shutdown(ctx) / resp.Body.Close()) that fail task check out of the box," observed while bootstrapping parallax from this same template. That prior note was about downstream repos; this issue is about fixing it at the source (template-go-agent itself) so every repo generated from it stops inheriting a red Lint / Test / Vet.

Concrete first steps

  • go mod tidy to generate go.sum.
  • Fix the two errcheck findings: unchecked shutdown(ctx) and resp.Body.Close().
Correction to my own issue body: this isn't actually contradicting prior notes — a prior brain memory (`project_template_go_agent_cd_deploy_gap`) already predicted this exact failure: "template shipped no go.sum (run `go mod tidy`) and two errcheck lint bugs (deferred `shutdown(ctx)` / `resp.Body.Close()`) that fail `task check` out of the box," observed while bootstrapping `parallax` from this same template. That prior note was about downstream repos; this issue is about fixing it **at the source** (`template-go-agent` itself) so every repo generated from it stops inheriting a red `Lint / Test / Vet`. ## Concrete first steps - `go mod tidy` to generate `go.sum`. - Fix the two errcheck findings: unchecked `shutdown(ctx)` and `resp.Body.Close()`.
Author
Owner

Fixed, two layers

Lint/Test/Vet (the actual predicted cause, project_template_go_agent_cd_deploy_gap): missing go.sum + one errcheck violation (resp.Body.Close() unchecked in pkg/litellm/model.go). Ran go mod tidy, wrapped the Close in an explicit discard. 06d4ac6.

Build & Import (new layer, only surfaced once check went green): env.IMAGE: __PROJECT_NAME__ is a placeholder only substituted when a repo is generated from this template — on the template repo itself it's still literal, and it contains uppercase letters, which buildah/Docker reject outright (repository name must be lowercase). Reproduced locally with buildah build -t localhost:5000/__PROJECT_NAME__:test . to confirm before touching CI. Build (and therefore deploy) can never succeed on the raw template — added github.repository != 'mathias/template-go-agent' to the build job's if: so it skips cleanly instead of failing. 2ba2698.

Verified: run #5Lint / Test / Vet: success, Build & Import: skipped, Deploy via GitOps: skipped. Fully green.

Closing.

## Fixed, two layers **Lint/Test/Vet** (the actual predicted cause, [[project_template_go_agent_cd_deploy_gap]]): missing `go.sum` + one errcheck violation (`resp.Body.Close()` unchecked in `pkg/litellm/model.go`). Ran `go mod tidy`, wrapped the Close in an explicit discard. `06d4ac6`. **Build & Import** (new layer, only surfaced once check went green): `env.IMAGE: __PROJECT_NAME__` is a placeholder only substituted when a repo is *generated* from this template — on the template repo itself it's still literal, and it contains uppercase letters, which buildah/Docker reject outright (`repository name must be lowercase`). Reproduced locally with `buildah build -t localhost:5000/__PROJECT_NAME__:test .` to confirm before touching CI. Build (and therefore deploy) can never succeed on the raw template — added `github.repository != 'mathias/template-go-agent'` to the build job's `if:` so it skips cleanly instead of failing. `2ba2698`. **Verified:** run #5 — `Lint / Test / Vet: success`, `Build & Import: skipped`, `Deploy via GitOps: skipped`. Fully green. Closing.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/template-go-agent#3