fix(ci): add PR build/test gate and repair all tsc -b + lint failures#115
Merged
Conversation
The repo had no pull_request CI workflow and main had no branch protection, so PR #114 merged green while `tsc -b` and lint were red. This adds a CI gate and fixes every pre-existing and new failure so the gate is green. Type errors (tsc -b, the real check — bare `tsc --noEmit` is a no-op here because tsconfig.json only has `references`): - database.index.test.ts: ordered-select routing tests referenced where/order columns not in `include`, and a `seed` helper typed `db` as the empty Database; both fixed. - TransactionResult.changedComponents: Set<keyof C | string> -> Set<string>. Component names are always strings; the `keyof C` only widened to string|number|symbol for generic C, breaking the type-erased TransactionResult<unknown> boundary the reconciler/strategy is written against. Cleared the producer-side `as keyof C` workaround casts. - reconciling applier: store entries as ReconcilingEntry<any,any,any> (the layer is type-erased over getTransaction's any-ctx transactions). - create-store.test.ts: guard optional `.health?.current`. Lint: - create-database.test.ts: describe each @ts-expect-error directive. - test-setup.ts: import { webcrypto } instead of require(). CI / tooling: - .github/workflows/ci.yml: typecheck + lint + test on every PR and push to main, scoped to @adobe/data (where the regression class occurred). - packages/data: add `typecheck` (build wasm + tsc -b, correct for the project-reference build) and `test:ci` (SKIP_PERF=1) scripts. - vite.config.js / vitest.workspace.ts: exclude *.performance.test.ts when SKIP_PERF=1 so the gate is deterministic (timing-ratio perf tests are flaky on shared runners); a normal `pnpm test` still runs them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Intentionally broken; reverted in the next commit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Removes the deliberate type error from the previous commit; the gate is verified to block on red. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
CI gate red/green verification ✅Branch protection on
So a broken build/type-check now blocks merge instead of merging green — the regression class behind #114 (where |
Clears the Node.js 20 action-runtime deprecation warning. checkout, setup-node, and pnpm/action-setup -> v6; project runtime node-version 20 -> 22 (LTS). Applied to both ci.yml and deploy-docs.yml. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The repo had no
pull_requestCI workflow andmainhad no branch protection, so PR #114 merged green even thoughtsc -bandlintwere red. (Dev-timetsc --noEmitis a no-op inpackages/databecausetsconfig.jsoncontains onlyreferences— the real check istsc -b.)This PR adds a CI gate and fixes every failing check — pre-existing and new — so the gate is green.
Type errors fixed (
tsc -b)database.index.test.ts(new, from feat(ecs): add reactive observe(arg) to index handles #114): the ordered-select routing tests referencedwhere/ordercolumns not ininclude(constrained toPick<C, Include>), and aseedhelper typeddbas the emptyDatabase. Both fixed.TransactionResult.changedComponents:Set<keyof C | string>→Set<string>. Component names are always strings; thekeyof Conly widened tostring|number|symbolfor a genericC, which broke the type-erasedTransactionResult<unknown>boundary the reconciler / concurrency strategy is written against. Removed the now-unnecessary producer-sideas keyof Cworkaround casts.ReconcilingEntry<any,any,any>— the layer is intentionally type-erased overgetTransaction'sany-ctx transactions.create-store.test.ts: guard optional.health?.current.Lint errors fixed
create-database.test.ts: added a description to each@ts-expect-error.test-setup.ts:import { webcrypto }instead ofrequire().CI / tooling
.github/workflows/ci.yml— runs typecheck + lint + tests on every PR and push tomain, scoped to@adobe/data(where the regression class occurred; can be extended to other packages later).packages/datascripts:typecheck(builds the wasm artifact the source imports, thentsc -b— correct for the project-reference build) andtest:ci(SKIP_PERF=1).vite.config.js/vitest.workspace.ts: exclude*.performance.test.tswhenSKIP_PERF=1, so the gate is deterministic (timing-ratio perf tests are flaky on shared runners). A normalpnpm teststill runs them locally.Follow-up (separate, requires admin)
Adding the workflow makes the check run on PRs; to make a red check block merge,
mainneeds branch protection requiring this check.maincurrently has none — I'll configure that after this check first reports.Related PRs
🤖 Generated with Claude Code