Skip to content

fix(core): regenerate slack trigger catalog from mapping#129

Merged
khaliqgant merged 1 commit into
mainfrom
codex/issue-127-trigger-catalog
May 28, 2026
Merged

fix(core): regenerate slack trigger catalog from mapping#129
khaliqgant merged 1 commit into
mainfrom
codex/issue-127-trigger-catalog

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • Teach trigger catalog generation to read provider mappings shipped under packages/core/mappings when an adapter package has no package-local mapping source, so Slack uses the mapping webhook event names.
  • Regenerate KNOWN_TRIGGER_CATALOG so slack exposes message and reaction_added instead of normalized adapter events like message.created.
  • Update trigger catalog tests to pin the Slack mapping keys while preserving existing GitHub/Gmail spot checks.

Notes

  • Generated with node --import tsx packages/core/src/cli.ts triggers generate after building @relayfile/adapter-core; running generate before core build reproduces the known truncated-provider failure mode and was discarded.
  • I kept relayfile-adapters#128 separate because the picker failure path appears to be the cloud Nango list-* action route, not this catalog generation path.
  • No package version bumps in this feature PR; publish should use the manual publish workflow after merge.

Verification

  • npm install
  • npm run build --workspace @relayfile/adapter-core
  • node --import tsx packages/core/src/cli.ts triggers generate
  • node --import tsx packages/core/src/cli.ts triggers check
  • node --import tsx --test packages/core/tests/triggers/catalog-generator.test.ts
  • npm test --workspace @relayfile/adapter-core -- --test-name-pattern='trigger catalog|provider-specific'
  • git diff --check

Fixes #127

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Warning

Review limit reached

@khaliqgant, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 14 minutes and 15 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fbad777-726a-4a4d-9af8-ea9220bdb03d

📥 Commits

Reviewing files that changed from the base of the PR and between aff6b14 and 9a8f8ca.

📒 Files selected for processing (4)
  • packages/core/src/triggers/catalog-generator.ts
  • packages/core/src/triggers/catalog.generated.json
  • packages/core/src/triggers/catalog.generated.ts
  • packages/core/tests/triggers/catalog-generator.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-127-trigger-catalog

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the trigger catalog generator to support reading mapping webhook events from a core directory in addition to package-specific directories. This allows prioritizing core mappings (such as Slack's raw webhook event names) over standard supported events. The generated catalog and tests are updated to reflect the new Slack event mappings. The reviewer suggested adding an explanatory comment to clarify the asymmetric priority logic between core mappings, package mappings, and supported events to improve maintainability.


for (const adapterPackage of packages) {
const mappingEvents = await readMappingWebhookEvents(repoRoot, adapterPackage);
if (mappingEvents.events.length > 0 && mappingEvents.source === "core.mapping.webhooks") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The priority logic here is asymmetric: core.mapping.webhooks takes precedence over supportedEvents, whereas package.mapping.webhooks is subordinated to supportedEvents. While this is done to support Slack's specific configuration, adding a brief explanatory comment here would greatly improve maintainability and prevent future confusion for other developers.

    // Prioritize core mappings (e.g. Slack) over supportedEvents to ensure raw webhook event names are used.
    if (mappingEvents.events.length > 0 && mappingEvents.source === "core.mapping.webhooks") {

@khaliqgant khaliqgant force-pushed the codex/issue-127-trigger-catalog branch from a2d590d to 9a8f8ca Compare May 28, 2026 10:57
@khaliqgant
Copy link
Copy Markdown
Member Author

Addressed Gemini's maintainability note by adding a short comment at the core-mapping priority branch explaining why packages/core/mappings webhook keys intentionally override supportedEvents() fallbacks for storage-bridge adapters. Re-ran:\n\n- node --import tsx packages/core/src/cli.ts triggers check\n- node --import tsx --test packages/core/tests/triggers/catalog-generator.test.ts\n- git diff --check

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Re-trigger cubic

@khaliqgant khaliqgant merged commit 5b9a1cc into main May 28, 2026
2 checks passed
@khaliqgant khaliqgant deleted the codex/issue-127-trigger-catalog branch May 28, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: @relayfile/adapter-core trigger catalog missing slack message (and likely other mapping.yaml webhook events)

1 participant