Troubleshooting: Portfolio Publish & Link Validation
Purpose
Provide fast fixes for the most common failures during project publishing under Stage 3.5: registry validation errors, slug violations, broken dossier/evidence links, and CI link-check failures.
How to Use This Guide
- Identify the failing step (local command or CI job and which job/step).
- Jump to the matching issue below.
- Apply the fix, re-run the specific command, then rerun
pnpm links:checkandpnpm buildbefore pushing.
CI Artifact Locations
- Job:
link-validation(portfolio-app CI) - Artifact on failure:
playwright-report(HTML) — inspect for failed routes/links - Related jobs:
quality,test,build
Issues & Fixes
Invalid slug format
- Symptom:
registry:validatefails with regex error or CIlink-validationfails on slug. - Cause: Slug not matching
^[a-z0-9]+(?:-[a-z0-9]+)*$or duplicate slug. - Fix:
- Edit
src/data/projects.ymlin portfolio-app; correct slug to lowercase, hyphenated, unique. - Re-run
pnpm registry:validatelocally. - Commit and push; confirm CI
link-validationpasses.
- Edit
Broken dossier or evidence links
- Symptom:
links:checkPlaywright report shows 404/500 for dossier/threat model/ADR/runbook links. - Cause: URL path wrong (missing numeric prefix or
.md), or docs page not yet merged/deployed. - Fix:
- Ensure doc links use
/docs/<prefix>-<domain>/<path>.mdwhen authoring in docs repo. - For app links, use env-first helpers (see copilot instructions) to build full URLs.
- If docs PR not merged, land docs first or point to staging URL for validation.
- Re-run
pnpm links:checklocally; inspectplaywright-reportif CI fails.
- Ensure doc links use
Evidence URL missing or empty
- Symptom:
registry:validatereports missing required evidence URLs. - Cause: Required fields omitted in registry entry.
- Fix:
- Add evidence URLs (dossier, threat model, ADR index, runbooks, GitHub repo) to the project entry.
- Re-run
pnpm registry:validateandpnpm build.
Registry validation failure (schema)
- Symptom: Zod schema errors during
registry:validateorpnpm build. - Cause: Field type mismatch, missing required fields, invalid enums.
- Fix:
- Compare entry against /docs/70-reference/registry-schema-guide.md.
- Correct fields; ensure dates are ISO, arrays non-empty where required.
- Re-run
pnpm registry:validatelocally.
CI link-validation failing, but local passes
- Symptom: CI job fails on link checks while local runs succeed.
- Cause: Missing env vars in CI, transient network, or uncommitted changes.
- Fix:
- Confirm env vars in workflow match production (
NEXT_PUBLIC_DOCS_BASE_URL,NEXT_PUBLIC_GITHUB_URL,NEXT_PUBLIC_DOCS_GITHUB_URL,NEXT_PUBLIC_SITE_URL). - Download
playwright-reportartifact to see failing routes. - Retry locally using
pnpm links:checkafterpnpm install --frozen-lockfile. - If still flaky, rerun CI once; otherwise fix underlying link.
- Confirm env vars in workflow match production (
Validation Checklist (after fixes)
-
pnpm registry:validatepasses locally -
pnpm links:checkpasses locally -
pnpm buildpasses locally - CI jobs
link-validation,quality,test,buildare green - Evidence links resolve in deployed app and docs
References
- Publish runbook: /docs/50-operations/runbooks/rbk-portfolio-project-publish.md
- Stage 3.5 issues: /docs/00-portfolio/roadmap/issues/stage-3-5-app-issue.md, /docs/00-portfolio/roadmap/issues/stage-3-5-docs-issue.md
- Registry schema guide: /docs/70-reference/registry-schema-guide.md
- Copilot instructions (docs): /.github/copilot-instructions.md
- Copilot instructions (app): https://github.com/bryce-seefieldt/portfolio-app/blob/main/.github/copilot-instructions.md