feat(polyfill-connectors): bless github, github/schemas, and fixture-samples exports - #70
Merged
Merged
Conversation
…samples exports data-connect#55's own re-vendor onto #68's fix (262c7bd) narrowed the published tarball to a files allowlist, correctly excluding raw source and test fixtures a consumer should not reach into directly. That exposed three real, narrow needs data-connect has past its blessed exports: - connectors/github/schemas.ts: a manifest/schema parity test needs stream-schema coverage, tied to data-connect's own read-grant logic. - fixtures/{gmail,codex}/scrubbed/pilot-real-shape: an MCP-closure test needs one real-shaped sample record per connector for realistic ingest. Both are legitimate consumer needs, not data-connectors internals being tested from the wrong repo, so add small additive exports rather than widen files back to raw source: - ./connectors/github -> connectors/github/index.js (same pattern as the 8 other blessed per-connector exports), plus tsconfig.build.json now compiles it. - ./connectors/github/schemas -> connectors/github/schemas.js. - ./fixture-samples -> a new src/fixture-samples.ts exposing readSampleRecord(connectorKey, stream), reading this package's own shipped fixtures internally -- no raw file paths exposed to consumers. files now ships fixtures/**/*.jsonl (844KB, already-scrubbed sample data, not source or test files). Verified via the package's own regression harness: pack-install-run.mjs (a real npm pack + plain npm install cycle) now probes all three new exports from a freshly-installed consumer, plus a unit test exercising readSampleRecord against the real shipped fixtures. Two other paths data-connect reaches past blessed exports (a whole-tree forbidden-import scan and the production connector-path-discovery mechanism, both needing all 45 manifest-listed connectors' source, not a named few) are NOT addressed here -- flagged as a separate, bigger decision in data-connect#55's own PR comment. Assisted-by: AI Signed-off-by: Tim Nunamaker <tnunamak@gmail.com>
Schema Health Check — All ClearAll 73 scopes have consistent local schema files. |
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.
Summary
data-connect#55(re-vendoring onto#68's fix,262c7bd8) surfaced 5 placesdata-connectreaches past this package's blessedexportsinto raw source/fixtures. The full enumeration and classification is posted on that PR: PDP-Connect/data-connect#55 (comment)This PR addresses the 2 that are genuine, narrow consumer needs (not internals being tested from the wrong repo), additively:
connectors/github/schemas.ts(regex-scraped bydata-connect'stest/github-manifest-connector-parity.test.tsto verify manifest-declared streams have schema coverage — ties intodata-connect's ownrs-read.ts:buildOwnerReadGrantForManifest). Fixed by blessing./connectors/github(same pattern as the 8 other per-connector exports) and./connectors/github/schemas.fixtures/{gmail,codex}/scrubbed/pilot-real-shape/records/*.jsonl(hardcoded raw path indata-connect'stest/owner-source-to-mcp-closure.test.ts, needing one real-shaped sample record per connector to exercise MCP-closure ingest). Fixed by adding a new./fixture-samplesexport:readSampleRecord(connectorKey, stream), reading this package's own shipped fixtures internally — no raw paths exposed to the consumer.Not addressed here (flagged as a separate, bigger decision in the
data-connect#55PR comment): a whole-connector-tree forbidden-import scan anddata-connect's production connector-path-discovery mechanism both need ALL 45 manifest-listed connectors' source present, not a named few — only 12 are currently compiled bytsconfig.build.json. That's a real scope/cost decision (compile all 45, or redesign the discovery mechanism), not a small additive export.Verification
npm run typecheck: clean.npm run pack-install-run(this package's own realnpm pack+ plainnpm installregression harness): extended with 3 new consumer-entrypoint probes (fixture-samples— actually callsreadSampleRecord, not just imports;connectors/github;connectors/github/schemas) — all pass from a freshly-installed consumer.src/fixture-samples.test.ts: exercisesreadSampleRecordagainst the real shippedgmail/codexfixtures, plus an unknown-connector error case.fileswidened by exactly one glob:fixtures/**/*.jsonl(844KB, already-scrubbed sample data — not source, not test files).Test plan
npm run typecheckcleannpm run pack-install-run— all consumer entrypoints including the 3 new ones pass from a real installed tarballcheck-published-entrypoints.mjs(runs as part ofbuild) validates all 43 exports resolve to real.jsfiles, not raw.tsAssisted-by: AI