Skip to content

fix(ci): repin buildx SHA + Dockerfile pnpm-first - #6

Merged
SabaTech-dev merged 2 commits into
mainfrom
fix/ci-buildx-pnpm
Aug 25, 2026
Merged

fix(ci): repin buildx SHA + Dockerfile pnpm-first#6
SabaTech-dev merged 2 commits into
mainfrom
fix/ci-buildx-pnpm

Conversation

@SabaTech-dev

Copy link
Copy Markdown
Owner

Summary

  • slsa-provenance.yml: el SHA pineado de setup-buildx-action estaba truncado a 39 chars (faltaba la f final) → GitHub unable to find version y el job moría en 2s. Repineado al SHA real del tag v3 (8d2750c6)
  • Dockerfile: el repo es pnpm-first (pnpm-lock.yaml + pnpm-workspace.yaml + CI usa pnpm 9) pero la imagen instalaba con npm y next build (con turbopack) intentaba spawn pnpm → ENOENT y build roto. Ahora: pnpm@9 + frozen-lockfile + pnpm build
  • Limpieza de contexto: añade .dockerignore (bloquea .next, node_modules, docs, memory del workspace)

Evidencia

  • Run 32675660597 (SLSA): unable to find version b5ca514318bd9f16464e31d5e78d1f2f7e7f4cbd
  • Run 32675660625 (CI/CD docker): #17 ERROR: spawn pnpm ENOENT en npm run build

Test plan

  • SLSA Provenance verde en este PR (workflow corre en PRs a main vía push del branch? — se verifica al mergear a main si no)
  • Docker Build & Provenance verde post-merge
  • SHA verificado: git ls-remote refs/tags/v3 → 8d2750c68a42422c14e847fe6c8ac0403b4cbd6f

Joker added 2 commits August 25, 2026 23:04
… + Dockerfile pnpm-first

- slsa-provenance.yml: b5ca5143…cbd truncated 39 chars -> GitHub 'unable to find version'. Repinned to v3 tag SHA 8d2750c6…
- Dockerfile: repo is pnpm-first (pnpm-lock + workspace + CI pnpm9); npm-based image died at 'npm run build' with spawn pnpm ENOENT. Switch install/build to pnpm@9 frozen-lockfile
@SabaTech-dev
SabaTech-dev merged commit e312575 into main Aug 25, 2026
1 check passed
@SabaTech-dev

Copy link
Copy Markdown
Owner Author

⚠️ Hallazgo pre-merge (verificación local 01:20): docker build local con este Dockerfile falla en pnpm build — Next intenta auto-instalar TypeScript (ERR_PNPM_ADDING_TO_ROOT) aunque typescript ya es devDep. Root cause latente ANTERIOR a este PR: el job Build de CI tolera exit-1 (workaround b3a99e2), así que el Docker job de main llevaría esta bomba. NO mergear hasta arreglar detección TS (card creada). El repin del SHA buildx (slsa) sí es seguro.

SabaTech-dev added a commit that referenced this pull request Aug 26, 2026
…sh merge (#7)

* fix(build): add typescript detection shim for next@16 with typescript@7

next@16 verifies the TS toolchain by probing typescript/lib/typescript.js
(verify-typescript-setup -> has-necessary-dependencies). typescript@7 is
the Go-native port and no longer ships that file, so next build treated
typescript as missing and attempted an auto-install, dying with
ERR_PNPM_ADDING_TO_ROOT under pnpm workspaces (Docker) or throwing
missingDepsError in CI.

The postinstall now creates a tiny ESM shim at the probed path that
re-exports the package version metadata. Build-time type checking stays
disabled via typescript.ignoreBuildErrors, so the classic compiler API
is never loaded. Guarded by tests/typescript-detection.test.ts.

* fix(auth): lazy-init JWT key cache for build-time page data collection

loadKeys() ran at module scope, so importing jwt-utils without runtime
secrets threw during next build page-data collection (Docker/CI builds
have no .env.local): 'Failed to collect page data for /api/wiki/sync'.
This was hidden behind the CI build masking workaround.

The cache now initializes lazily on first sign/verify call. Fail-fast is
preserved: the first token operation still validates JWT_SECRET/JWT_SECRETS.

* fix(docker): run next start via real JS entrypoint, not pnpm .bin shim

node_modules/.bin/next is a POSIX shell shim in the pnpm layout; running
it with 'node' died with SyntaxError on container start. Invoke
next/dist/bin/next (the actual JS entrypoint) instead. This CMD path was
never exercisable before because the image build never succeeded.

* fix(ci): remove build failure masking workaround

The '|| exit 0' in the Build job (b3a99e2) converted every build exit 1
into a warning, hiding both the TypeScript detection failure and the
JWT module-scope failure. With both root causes fixed, pnpm build exits
0 on its own; the job now fails loudly again on real regressions.

---------

Co-authored-by: Joker <joker@sabatech.dev>
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.

1 participant