running fallow dead-code --baseline=fallow-baseline.json --boundary-violations locally vs github action CI
#87
-
|
If I create a baseline with save-baseline flag, and run this command locally, all works well, no errors. but on my CI it gives a different output, failing, like its ignoring the baseline 🤔 Local runpnpm fallow dead-code --baseline=fallow-baseline.json --boundary-violations
> tos-dashboard-2@1.0.61 fallow /Users/luca/translated/tos-dashboard
> fallow dead-code --baseline=fallow-baseline.json --boundary-violations
Comparing against baseline: fallow-baseline.json
294 entry points detected (232 plugin, 60 manual entry, 2 package.json)
✓ No issues found (0.08s)Github actions runpnpm fallow dead-code --baseline=fallow-baseline.json --boundary-violations
pnpm fallow dead-code --baseline=fallow-baseline.json --boundary-violations
shell: /usr/bin/bash -e {0}
env:
PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
> tos-dashboard-2@1.0.61 fallow /home/runner/work/tos-dashboard/tos-dashboard
> fallow dead-code --baseline=fallow-baseline.json --boundary-violations
0.020692144s INFO fallow_analyze:run_plugins: active plugins plugins="vite, vitest, storybook, eslint, biome, prettier, typescript, tailwind, postcss, sentry, husky, lint-staged, msw, nodemon"
0.162607220s INFO fallow_analyze: incremental cache stats cache_hits=0 cache_misses=1239
Comparing against baseline: fallow-baseline.json
294 entry points detected (232 plugin, 60 manual entry, 2 package.json)
✗ 38 violations (0.37s)
── Structure ───────────────────────────────────────
● Boundary violations (38)
web/features/BackLink/BackLink.tsx:4 → web/routes/href.ts (frontend-features → frontend-routes)
web/services/charts/charts.ts:21 → web/features/tosDashApi/index.ts (frontend-services → frontend-features)
web/services/connectors/contentRepo.ts:4 → web/features/preferences/index.ts (frontend-services → frontend-features)
web/services/content/content-details.ts:5 → web/features/tosDashApi/index.ts (frontend-services → frontend-features)
web/services/content/content-list.ts:7 → web/features/tosDashApi/index.ts (frontend-services → frontend-features)
web/services/customer/customer.ts:12 → web/features/tosDashApi/index.ts (frontend-services → frontend-features)
web/services/customer-locales/customer-locales.ts:4 → web/features/tosDashApi/index.ts (frontend-services → frontend-features)
web/services/intake/intake.ts:3 → web/features/tosDashApi/index.ts (frontend-services → frontend-features)
web/services/invoice/invoice.ts:3 → web/features/tosDashApi/index.ts (frontend-services → frontend-features)
web/services/issuesBy/issuesBy.ts:4 → web/features/tosDashApi/index.ts (frontend-services → frontend-features)
... and 28 more (--format json for full list)
Imports that cross defined architecture zone boundaries — https://docs.fallow.tools/explanations/dead-code#boundary-violations
To suppress: // fallow-ignore-file boundary-violationsThis is the github job: boundary-violations:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
with:
run_install: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm fallow dead-code --baseline=fallow-baseline.json --boundary-violations |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I may have an idea on why is not working, when you run --save-baseline from your machine, the saved paths are not relative to the root of the project, but from the root of the machine, so when the command runs on the CI, the paths does not match |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the detailed report, @luca-nicola! This was a real bug affecting all baseline users in CI. Root cause: baseline keys stored absolute file paths (e.g., Fix: all baseline keys now use relative paths (e.g., Additional improvements shipped alongside:
Action needed after upgrading: your existing pnpm fallow dead-code --save-baseline=fallow-baseline.json --boundary-violationsThen commit the new baseline. From that point on, CI will match correctly. |
Beta Was this translation helpful? Give feedback.
Thanks for the detailed report, @luca-nicola! This was a real bug affecting all baseline users in CI.
Root cause: baseline keys stored absolute file paths (e.g.,
/Users/luca/translated/tos-dashboard/src/ui/btn.ts). When loaded on a different machine (CI runner at/home/runner/work/...), no keys matched, so the baseline had zero effect.Fix: all baseline keys now use relative paths (e.g.,
src/ui/btn.ts), making baselines portable across machines. This affects all issue types (unused files, exports, boundary violations, etc.), not just boundary violations.Additional improvements shipped alongside: