feat(core): ship every adapter's webhook mapping in @relayfile/adapter-core - #280
Conversation
…r-core Consumers that depend only on @relayfile/adapter-core saw two mapping files: the github and slack fallbacks under mappings/. AgentWorkforce/flows generates its typed trigger namespaces from those `webhooks:` blocks, so 23 adapters that declare webhooks (notion, gitlab, cloudflare, ramp, neon, shortcut, gmail, …) could never trigger a flow from the published package. The package now also ships mappings/adapters/<provider>.mapping.yaml, a verbatim copy of each packages/<adapter>/<provider>.mapping.yaml, generated by scripts/bundle-adapter-mappings.mjs and committed like the other catalogs. `catalog:check` (turbo test) and prepublishOnly run its --check, which fails on a missing, stale or orphaned copy, so a tarball cannot carry a stale bundle. The fallbacks are untouched; consumers apply adapter-local over fallback, the precedence flows' generator already uses against a repo checkout. Additive: a patch release suffices. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (30)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe pull request adds adapter mapping catalogs, bundles them into ChangesAdapter mapping bundle
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant AdapterPackages as Adapter packages
participant Bundler as bundle-adapter-mappings.mjs
participant CoreMappings as Core mapping bundle
participant BundleTests as bundle-adapter-mappings.test.mjs
AdapterPackages->>Bundler: provide mapping YAML files
Bundler->>CoreMappings: generate or check bundled files
BundleTests->>Bundler: run --check
BundleTests->>CoreMappings: compare bundled files with sources
Merge Risk: ⚪ Minimal · up to The mapping bundle retains its passing drift check, and the package-resolution test is correctly configured for the repository workspace installation. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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. A rabbit bundles maps in rows Comment |
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Why
Consumers that depend only on
@relayfile/adapter-coresee two mapping files — thegithubandslackfallbacks undermappings/.AgentWorkforce/flowsgenerates its typed trigger namespaces (flow().on(github.pull_request('opened'), …)) from thosewebhooks:blocks, so the 23 other adapters that declare webhooks (notion 13, gitlab, cloudflare, ramp 47, neon, shortcut, gmail, …) can never trigger a flow from the published package. The repo has the data; the tarball didn't.What
scripts/bundle-adapter-mappings.mjscopies everypackages/<adapter>/<provider>.mapping.yamlverbatim topackages/core/mappings/adapters/<provider>.mapping.yaml(25 today).--checkfails on a missing, stale or orphaned copy.mappings:checkis part ofcatalog:check(soturbo test) and ofprepublishOnly, so a tarball cannot carry a stale bundle.filesalready includesmappings/.--adapters-dir).npm testgainstest:adapter-mapping-bundle, which also proves the bundle resolves atdirname(require.resolve('@relayfile/adapter-core/package.json')) + '/mappings', exactly how flows reads it.Release
Additive; a patch publish of
coreis enough. flows will pin that version and regenerate (AgentWorkforce/flows PR to follow).Verified
npx turbo build typecheck --filter=@relayfile/adapter-core...andnpx turbo run catalog:check(53/53 tasks, bundle verified: 25 providers);npm run test:adapter-mapping-bundle2/2;test:catalog-task-graphgreen.🤖 Generated with Claude Code
Note
Low Risk
Additive packaging and CI guardrails; no runtime adapter logic changes, only duplicated YAML and publish-time checks.
Overview
Ships every adapter’s mapping YAML inside
@relayfile/adapter-core, so consumers that only install core (e.g. flows trigger codegen) see fullwebhooks:catalogs—not just thegithubandslackfallbacks undermappings/.Adds
scripts/bundle-adapter-mappings.mjs, which copies eachpackages/<adapter>/*.mapping.yamlverbatim into committedpackages/core/mappings/adapters/(25 providers in this PR).--checkfails on missing, stale, or orphaned copies.mappings:checkis wired intocatalog:checkandprepublishOnly, and rootnpm testgainstest:adapter-mapping-bundlewith tests that mirror how consumers resolvemappings/viarequire.resolve('@relayfile/adapter-core/package.json'). Core README documents layout and refresh vianpm run mappings:bundle -w @relayfile/adapter-core.Reviewed by Cursor Bugbot for commit 9d6c281. Bugbot is set up for automated code reviews on this repo. Configure here.