Uh oh!
There was an error while loading. Please reload this page.
fix(build): scope tsconfig.build.json to src/ for reproducibility - #352
Conversation
Tighten tsconfig.build.json `include` to `src/**/*.ts` so `npm run build` no longer emits `dist/scripts/ci_validate_modification.js`. The published release artifact only ships `dist/src/`, so the prior include caused a reproducibility mismatch for downstream verifiers (e.g. ASF's `verify-action-build`) that rebuild from source. Add `rootDir: "."` to preserve the existing `dist/src/` output layout that downstream tooling and the release script depend on. Fixes#351
Add `tsx` as a dev dependency so CI can execute `scripts/ci_validate_modification.ts` directly without a compile step. This pairs with the build-scope tightening: the script no longer needs to be emitted to `dist/scripts/` to be runnable from workflows.
Replace `node ./dist/scripts/ci_validate_modification.js` with `npx tsx scripts/ci_validate_modification.ts` across both CI workflows. The script no longer requires a build step, which is consistent with narrowing `tsconfig.build.json` to emit only `dist/src/`.
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR fixes a reproducibility issue where ChangesBuild Reproducibility & CI Script Invocation
Sequence DiagramThis change does not meet the criteria for a sequence diagram because it consists primarily of configuration and workflow updates without introducing new multi-component interactions or significant control flow modifications. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## master #352 +/- ##
=======================================
Coverage 89.24% 89.24% =======================================
Files 16 16 Lines 958 958 Branches 205 205 =======================================
Hits 855 855 + Misses 103 99 -4 - Partials 0 4 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Uh oh!
There was an error while loading. Please reload this page.
…nchmark-action#352) ### Ticket [benchmark-action#351](benchmark-action#351) — `tsconfig.build.json` compiles `scripts/` into `dist/` but release workflow excludes them — rebuild reproducibility breaks ### Description - `tsconfig.build.json` previously used `"include": ["**/*.ts"]`, which compiled `scripts/ci_validate_modification.ts` into `dist/scripts/`. The release workflow (`scripts/prepare-release.sh`) only copies `dist/src/` to the release tag, so anyone rebuilding from source got an extra `dist/scripts/ci_validate_modification.js` not present in the published artifact — failing the Apache Software Foundation's `verify-action-build` reproducibility checker. - Tightened `include` to `["src/**/*.ts"]` so `npm run build` no longer emits `dist/scripts/`. Set `"rootDir": "."` explicitly so `src/index.ts` continues to emit to `dist/src/index.js` (without `rootDir`, narrowing the include set lets TypeScript infer `src/` as the common root and emit flat under `dist/`, breaking the release script's `dist/src/` layout). - CI still needs to run `scripts/ci_validate_modification.ts`. Switched both `.github/workflows/ci.yml` and `.github/workflows/ci-results-repo.yml` from `node ./dist/scripts/ci_validate_modification.js …` to `npx tsx scripts/ci_validate_modification.ts …` (22 occurrences total). Added `tsx` to `devDependencies`. Fixesbenchmark-action#351. ### Test scenario - [ ] `rm -rf dist && npm run build` — verify `dist/` contains only `src/` (no `dist/scripts/`). - [ ] `ls dist/src/index.js` — verify the release-shaped layout is preserved. - [ ] `npx tsx scripts/ci_validate_modification.ts` (no args) — verify the script runs and exits non-zero with its usage error (proves CI invocation works). - [ ] `npm test` and `npm run lint` — verify no regressions. - [ ] CI green on this PR — confirms the `tsx`-driven validation step still works across all benchmark jobs. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated CI/CD workflows to improve build reliability and consistency. * Added development tooling dependency for enhanced script execution. * Refined build configuration to streamline the compilation process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Ticket
#351 —
tsconfig.build.jsoncompilesscripts/intodist/but release workflow excludes them — rebuild reproducibility breaksDescription
tsconfig.build.jsonpreviously used"include": ["**/*.ts"], which compiledscripts/ci_validate_modification.tsintodist/scripts/. The release workflow (scripts/prepare-release.sh) only copiesdist/src/to the release tag, so anyone rebuilding from source got an extradist/scripts/ci_validate_modification.jsnot present in the published artifact — failing the Apache Software Foundation'sverify-action-buildreproducibility checker.includeto["src/**/*.ts"]sonpm run buildno longer emitsdist/scripts/. Set"rootDir": "."explicitly sosrc/index.tscontinues to emit todist/src/index.js(withoutrootDir, narrowing the include set lets TypeScript infersrc/as the common root and emit flat underdist/, breaking the release script'sdist/src/layout).scripts/ci_validate_modification.ts. Switched both.github/workflows/ci.ymland.github/workflows/ci-results-repo.ymlfromnode ./dist/scripts/ci_validate_modification.js …tonpx tsx scripts/ci_validate_modification.ts …(22 occurrences total). AddedtsxtodevDependencies.Fixes#351.
Test scenario
rm -rf dist && npm run build— verifydist/contains onlysrc/(nodist/scripts/).ls dist/src/index.js— verify the release-shaped layout is preserved.npx tsx scripts/ci_validate_modification.ts(no args) — verify the script runs and exits non-zero with its usage error (proves CI invocation works).npm testandnpm run lint— verify no regressions.tsx-driven validation step still works across all benchmark jobs.Summary by CodeRabbit