Skip to content

ci: actualizar setup-go a v6 (arregla covdata) y restaurar la compilación de pkg/lockdown#9

Merged
israel2606 merged 3 commits into
mainfrom
claude/fix-coverage-covdata
Jun 17, 2026
Merged

ci: actualizar setup-go a v6 (arregla covdata) y restaurar la compilación de pkg/lockdown#9
israel2606 merged 3 commits into
mainfrom
claude/fix-coverage-covdata

Conversation

@israel2606

@israel2606 israel2606 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Dos arreglos para dejar el job build en verde.

1. setup-go@v4@v6 (arregla el fallo de covdata)

El paso "Run tests with coverage" (go test -coverprofile=coverage.out ./...) fallaba con:

go: no such tool "covdata"

Causa raíz: setup-go@v4 no instala Go 1.25 de forma nativa, así que go cae al module toolchain (golang.org/toolchain@...go1.25.0), que no incluye la herramienta covdata. Al instrumentar la cobertura de los paquetes sin tests, falla.

Arreglo: subir a setup-go@v6 (igual que go.yml, que ya pasa). Instala Go 1.25 nativo, que sí trae covdata, de modo que se mantiene el universo ./... completo (los paquetes sin tests siguen reportándose como 0%, sin ocultarlos). Verificado: el Go nativo incluye covdata; el toolchain de módulo no.

2. pkg/lockdown no compilaba

safety_coverage_test.go (commit eed328b) usa la API anterior al refactor de lockdown (newSafetyTestCache, SetLogger, queryRepoAccessInfo con firma de 4 args), ya inexistente, por lo que pkg/lockdown no compilaba en main (rompiendo build, lint y go.yml). Como lockdown_test.go ya cubre IsSafeContent y los caminos de caché, se elimina el archivo incompatible.

Verificación local

  • go test ./... en verde.
  • golangci-lint run ./... (v2.9) sin issues.

claude added 2 commits June 17, 2026 13:31
The 'Run tests with coverage' step ran 'go test -coverprofile=coverage.out
./...'. Passing packages that have no test files (cmd/..., internal/profiler,
pkg/context, pkg/http/mark, script/print-mcp-diff-configs) to a combined
-coverprofile triggers 'go tool covdata', which fails with 'go: no such tool
covdata' for those packages and fails the whole job.

Restrict the coverage run to packages that actually have tests via 'go list',
which avoids the covdata invocation while still producing coverage.out.
…ctor

safety_coverage_test.go (added in eed328b) targets the pre-refactor lockdown
API: it references the newSafetyTestCache helper (removed with safety_test.go),
the deleted SetLogger method, and queryRepoAccessInfo's old 4-arg signature.
None of these exist after the lockdown rewrite, so pkg/lockdown fails to build
on main. lockdown_test.go already covers IsSafeContent and the cache paths, so
remove the incompatible file to restore the build.
@israel2606 israel2606 changed the title ci: corregir el paso de cobertura de go-build (covdata en paquetes sin tests) ci: corregir el paso de cobertura de go-build y restaurar la compilación de pkg/lockdown Jun 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f35563b1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/go-build.yml Outdated
Reverts the go list filter from the previous commit per review feedback: that
filter dropped no-test packages (e.g. script/print-mcp-diff-configs, pkg/context)
from coverage.out, hiding them instead of reporting 0%.

Root cause of the 'go: no such tool covdata' failure is setup-go@v4 not
installing Go 1.25 natively, so go falls back to the module toolchain
(golang.org/toolchain@...go1.25.0), which omits the covdata tool. Bumping to
setup-go@v6 (matching go.yml) installs Go natively — which includes covdata —
so 'go test -coverprofile=coverage.out ./...' works across all packages.
@israel2606 israel2606 changed the title ci: corregir el paso de cobertura de go-build y restaurar la compilación de pkg/lockdown ci: actualizar setup-go a v6 (arregla covdata) y restaurar la compilación de pkg/lockdown Jun 17, 2026
@israel2606 israel2606 merged commit c6ab16c into main Jun 17, 2026
15 of 16 checks passed
israel2606 pushed a commit that referenced this pull request Jun 17, 2026
main's only red check is python-package.yml: a deprecation stub with no
jobs, which is an invalid workflow that always reports failure. Remove it.

Also remove go-build.yml: it duplicates go.yml (Build and Test Go Project)
and runs on Node20-deprecated actions (setup-go@v4, cache@v3). It currently
passes but is redundant.

The earlier lockdown compile break was already resolved on main (PR #9
removed the obsolete safety_coverage_test.go), so no code change is needed.

https://claude.ai/code/session_01W9xh1kJCqtHqBgBAMQikon
@israel2606 israel2606 self-assigned this Jun 19, 2026
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.

2 participants