Skip to content

fix(build): stop regenerating help data during Vercel build#333

Merged
cola500 merged 6 commits into
stagingfrom
feature/fix-help-build-generation
May 13, 2026
Merged

fix(build): stop regenerating help data during Vercel build#333
cola500 merged 6 commits into
stagingfrom
feature/fix-help-build-generation

Conversation

@cola500
Copy link
Copy Markdown
Owner

@cola500 cola500 commented May 13, 2026

Summary

  • Tar bort tsx scripts/generate-help-data.ts && från build-scriptet i package.json.
  • articles-data.ts är redan committad (56 artiklar) och importeras synkront i klient-bundlen.
  • npm run generate:help (separat script) finns kvar för lokal regenerering när markdown-källor ändras.

Root cause

Build-scriptet anropade tsx scripts/generate-help-data.ts före next build. På Vercel kör generatorn i vercel build-miljön där .vercelignore (*.md) filtrerar bort markdown-källfilerna i src/lib/help/articles/<role>/. Generatorn hittade noll filer och skrev en tom articles-data.ts, vilket överskrev den committade versionen. Resultat: tomma hjälp-sidor på staging (och troligen även prod).

Bekräftat i build-log för dpl_6orNJPAh4YBfhZ8rwtPEU2oRTHtn (rad 1078):

Generated /vercel/path0/src/lib/help/articles-data.ts with 0 articles

Test plan

  • Vercel preview-build passerar (inga build-fel)
  • Preview-URL: /customer/help visar artikel-listan (inte "Inga artiklar matchade din sökning")
  • Preview-URL: /customer/help/boka-en-tjanst → 200 (inte 404)
  • Efter merge till staging: curl -sL https://equinet-staging.johanlindengard.com/customer/help returnerar HTML som innehåller aterkommande-bokning
  • Browser-test mot staging customer/help: Accordion med sections renderas

Follow-ups (separata stories)

  • Pre-commit hook eller CI-check som varnar om src/lib/help/articles-data.ts är out-of-sync med src/lib/help/articles/*.md.
  • Same fix går till main så även prod får funkande hjälpsektion.

🤖 Generated with Claude Code

cola500 and others added 6 commits May 8, 2026 13:38
Cache-bust after prod DB password rotation 2026-05-08.
Server-side getSession() failed with login-blink despite
correct env vars and Supabase auth returning 200. Suspected
stale prisma generate binary in Vercel build cache.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Brings in:
- equinet-staging-app Vercel project + 17 env-vars (S67-1, S67-2)
- ssoProtection verified as Standard Protection (S67-3)
- Stripe webhook deferred (S67-4)
- DNS cutover: equinet-staging.johanlindengard.com → new project (S67-5)
- iOS staging end-to-end verified (S67-7)
- Cron disable guard via DISABLE_CRONS=true + STAGING_PROJECT flag
- iOS APIClient cache-policy fix (.reloadIgnoringLocalCacheData)
- Documentation: walkthrough, environments.md, staging-cleanup-followups
- Story: ios-api-cache-policy-hardening
- Xcode: DEVELOPMENT_TEAM + -STAGING default in scheme

Sprint 67 done 2026-05-09. 8 done + 1 deferred + 1 follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both equinet-app and equinet-staging-app now have Ignored Build Step
configured. Each project builds only its designated branch. Includes
bash syntax learning: ';' mandatory between 'fi' and 'exit'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tekniska och process-lärdomar från staging-cutover, iOS-verifiering,
prod-incident-postmortem och branch isolation. Inkluderar URLSession
cache-policy, Vercel CDN 4xx-caching, env+branch-isolation, samt
"production" som olika betydelser i olika Vercel-projekt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Build-scriptet anropade `tsx scripts/generate-help-data.ts` före
`next build`. På Vercel kör generatorn i `vercel build`-miljön där
`.vercelignore` (`*.md`) filtrerar bort markdown-källorna i
`src/lib/help/articles/<role>/`. Generatorn hittade noll filer och
skrev en tom `articles-data.ts` som överskrev den committade
versionen, vilket resulterade i tomma hjälp-sidor på staging
(och även prod, sannolikt sedan tidigare).

Verifierat i build-log för dpl_6orNJPAh4YBfhZ8rwtPEU2oRTHtn:
"Generated /vercel/path0/src/lib/help/articles-data.ts with 0 articles".

Fixen tar bort regenereringen ur build-pipelinen. `articles-data.ts`
är redan committed (56 artiklar) och importeras synkront i klient-
bundlen. `generate:help` (npm run generate:help) finns kvar för
lokal regenerering när markdown-källor ändras.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cola500 cola500 merged commit 0d725f1 into staging May 13, 2026
4 checks passed
@cola500 cola500 deleted the feature/fix-help-build-generation branch May 13, 2026 13:37
cola500 added a commit that referenced this pull request May 13, 2026
Lägger till story som dokumenterar skydd mot återfall efter PR #333
(stop regenerating help data during Vercel build). Föreslår CI-validation
som diffar regenererad articles-data.ts mot committed version som MVP.

Bakgrund: 2026-05-13 hade staging tom hjälpsektion eftersom Vercel-build
körde generatorn medan .vercelignore filtrerade bort markdown-källor.
Build var "grön" men data var tom. Vi vill ha automatisk detektering om
articles-data.ts blir out-of-sync med markdown-filerna i framtiden.

- docs/stories/help-data-drift-protection.md: full story med A/B/C/D-
  alternativ, rekommendation, acceptanskriterier, prioritet
- docs/sprints/backlog.md: backlog-rad under Kvalitet och säkerhet,
  effort 15-30 min, pekare till story

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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