Skip to content

Commit 48c3784

Browse files
krisnyeclaude
andauthored
fix(ci): extend gate to cover all published downstream packages (#130)
* fix(ci): extend gate to cover all published downstream packages The CI gate only checked @adobe/data; data-lit's type error introduced in #127 was invisible to CI and reached main undetected. Two jobs now: - data: existing @adobe/data typecheck + lint + test (unchanged) - packages: depends on data; rebuilds @adobe/data for dist/, then builds (tsc -b) and tests all @adobe/data-* packages. data-persistence uses test:node to avoid the Playwright browser requirement in CI. Also fixes the latent data-lit error: useDragTransaction<T> now constrains T extends {} | null to satisfy withFilter's U bound (tightened in #127). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(data-persistence): open node-fs files with O_RDWR|O_CREAT, not a+ "a+" (append+read) ignores the position argument on writes — every handle.write() lands at EOF regardless of the offset passed. This made writeAt semantically equivalent to appendAt, so all conformance tests that write at a non-zero offset failed. O_RDWR|O_CREAT (read+write, create-if-missing, never truncate) is the correct flag set: positions are honoured on write, the file is created on first open, and existing content is never clobbered. These tests were never run in CI before the packages job was added in this branch, so the bug went undetected since #102. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b848a61 commit 48c3784

2 files changed

Lines changed: 44 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ name: CI
55
# whose `tsc -b` / unit tests were red could still be merged green — exactly
66
# what happened with #114. This gate makes those failures block the merge.
77
#
8-
# Scope: the published core library `@adobe/data`, where the regression class
9-
# occurred. Type-checking uses the project-reference build (`tsc -b`, via the
10-
# package's `typecheck` script, which builds the wasm artifact the source
11-
# imports first). Tests run with SKIP_PERF=1 (`test:ci`) so the gate excludes
12-
# the non-deterministic timing-ratio perf tests and stays reliable.
8+
# Two jobs:
9+
# data — @adobe/data core: typecheck (tsc -b + WASM), lint, unit tests.
10+
# packages — downstream published packages: build (tsc -b) + tests for each.
11+
# Runs after `data` so a core failure surfaces once, not twice.
12+
# @adobe/data is rebuilt here to provide dist/ for downstream tsc.
1313

1414
on:
1515
pull_request:
@@ -49,3 +49,37 @@ jobs:
4949

5050
- name: Unit tests
5151
run: pnpm --filter @adobe/data run test:ci
52+
53+
packages:
54+
name: "downstream packages — build, test"
55+
runs-on: ubuntu-latest
56+
needs: [data]
57+
steps:
58+
- uses: actions/checkout@v6
59+
60+
- uses: pnpm/action-setup@v6
61+
with:
62+
version: 9
63+
64+
- uses: actions/setup-node@v6
65+
with:
66+
node-version: 22
67+
cache: pnpm
68+
69+
- run: pnpm install --frozen-lockfile
70+
71+
- name: Build @adobe/data (provides dist/ for downstream tsc)
72+
run: pnpm --filter @adobe/data run typecheck
73+
74+
- name: Build downstream packages (type-check via tsc -b)
75+
run: pnpm --filter '@adobe/data-*' run build
76+
77+
- name: Test downstream packages
78+
run: |
79+
pnpm --filter @adobe/data-lit \
80+
--filter @adobe/data-gpu \
81+
--filter @adobe/data-react \
82+
--filter @adobe/data-solid \
83+
--filter @adobe/data-sync \
84+
run test
85+
pnpm --filter @adobe/data-persistence run test:node

packages/data-persistence/src/node/node-fs-file.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// © 2026 Adobe. MIT License. See /LICENSE for details.
22

3-
import { promises as fs } from "node:fs";
3+
import { promises as fs, constants as fsConstants } from "node:fs";
44
import type { FileHandle } from "node:fs/promises";
55
import { RandomAccessFile } from "../backend/random-access-file.js";
66

@@ -9,8 +9,10 @@ import { RandomAccessFile } from "../backend/random-access-file.js";
99
* already be validated by the surrounding {@link NodeFsBackend}.
1010
*/
1111
export const createNodeFsFile = async (absPath: string): Promise<RandomAccessFile> => {
12-
// Open with read+write, create-if-missing, never truncate.
13-
const handle: FileHandle = await fs.open(absPath, "a+");
12+
// O_RDWR | O_CREAT: read+write, create-if-missing, never truncate.
13+
// "a+" is wrong here — append mode ignores the position argument on writes,
14+
// which breaks writeAt semantics (every write would land at EOF instead).
15+
const handle: FileHandle = await fs.open(absPath, fsConstants.O_RDWR | fsConstants.O_CREAT, 0o666);
1416
let closed = false;
1517

1618
const ensureOpen = (): void => {

0 commit comments

Comments
 (0)