Skip to content

fix(core): union slack trigger catalog sources#130

Merged
khaliqgant merged 1 commit into
mainfrom
codex/fix-slack-trigger-catalog-union
May 28, 2026
Merged

fix(core): union slack trigger catalog sources#130
khaliqgant merged 1 commit into
mainfrom
codex/fix-slack-trigger-catalog-union

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • fix the fix(core): regenerate slack trigger catalog from mapping #129 regression by merging core mapping webhook keys with adapter supportedEvents() instead of replacing the adapter catalog
  • preserve Slack's existing 18 normalized events while adding the runtime mapping names message and reaction_added
  • keep package-local mapping files as fallback-only so GitHub/GitLab raw mapping group keys are not added
  • add test coverage that Slack has 20 events including legacy normalized events and mapping-backed runtime names

Verification

  • 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 51 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: 67021048-7484-4bbd-b803-c36804ca55ce

📥 Commits

Reviewing files that changed from the base of the PR and between 1f86596 and 824b173.

📒 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/fix-slack-trigger-catalog-union

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 merge webhook mapping events with supported events instead of letting the mapping events override them. Consequently, the generated catalog files have been updated with additional Slack events, and the test suite has been adjusted to reflect these changes. A review comment suggests using supportedEvents.provider instead of adapterPackage.provider when processing mapping events to prevent potential provider name mismatches and ensure consistency.

Comment on lines 81 to 90
entries.push({
provider: supportedEvents.provider,
events: supportedEvents.events,
provider: adapterPackage.provider,
events: mappingEvents.events,
});
sources.push({
packageName: adapterPackage.packageName,
packagePath: adapterPackage.relativePath,
provider: supportedEvents.provider,
source: "supportedEvents",
provider: adapterPackage.provider,
source: "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

Using adapterPackage.provider here can lead to a mismatch if the adapter's canonical provider name (defined by supportedEvents.provider, which resolves to instance.name) differs from the package/directory-derived slug (adapterPackage.provider). To ensure consistency and prevent duplicate or split entries in the generated catalog, we should use supportedEvents.provider instead.

Suggested change
entries.push({
provider: supportedEvents.provider,
events: supportedEvents.events,
provider: adapterPackage.provider,
events: mappingEvents.events,
});
sources.push({
packageName: adapterPackage.packageName,
packagePath: adapterPackage.relativePath,
provider: supportedEvents.provider,
source: "supportedEvents",
provider: adapterPackage.provider,
source: "mapping.webhooks",
});
entries.push({
provider: supportedEvents.provider,
events: mappingEvents.events,
});
sources.push({
packageName: adapterPackage.packageName,
packagePath: adapterPackage.relativePath,
provider: supportedEvents.provider,
source: "mapping.webhooks",
});

@khaliqgant khaliqgant force-pushed the codex/fix-slack-trigger-catalog-union branch from 3930303 to 824b173 Compare May 28, 2026 11:10
@khaliqgant
Copy link
Copy Markdown
Member Author

Addressed Gemini's consistency note: when core mapping webhook events are merged after supportedEvents(), the generator now uses the supportedEvents provider name if one was resolved, falling back to the package provider only when supportedEvents is absent. Re-ran:\n\n- node --import tsx packages/core/src/cli.ts triggers generate\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.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/core/src/triggers/catalog-generator.ts">

<violation number="1" location="packages/core/src/triggers/catalog-generator.ts:82">
P2: Use the same canonical provider key when merging mapping events with supported events; using `adapterPackage.provider` here can split a single adapter’s triggers into separate catalog entries if it differs from the adapter’s runtime provider name.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

entries.push({
provider: supportedEvents.provider,
events: supportedEvents.events,
provider: adapterPackage.provider,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Use the same canonical provider key when merging mapping events with supported events; using adapterPackage.provider here can split a single adapter’s triggers into separate catalog entries if it differs from the adapter’s runtime provider name.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/core/src/triggers/catalog-generator.ts, line 82:

<comment>Use the same canonical provider key when merging mapping events with supported events; using `adapterPackage.provider` here can split a single adapter’s triggers into separate catalog entries if it differs from the adapter’s runtime provider name.</comment>

<file context>
@@ -57,35 +57,41 @@ export async function generateTriggerCatalog(repoRoot?: string): Promise<Trigger
       entries.push({
-        provider: supportedEvents.provider,
-        events: supportedEvents.events,
+        provider: adapterPackage.provider,
+        events: mappingEvents.events,
       });
</file context>
Suggested change
provider: adapterPackage.provider,
provider: supportedEvents.provider,

@khaliqgant
Copy link
Copy Markdown
Member Author

Cubic's provider-key finding was on the pre-amend commit (). It is addressed in current head : core mapping events now use when supportedEvents resolved a runtime provider name, and fall back to only when supportedEvents is absent. CI is green on the amended head.

@khaliqgant khaliqgant merged commit c407bba into main May 28, 2026
2 checks passed
@khaliqgant khaliqgant deleted the codex/fix-slack-trigger-catalog-union branch May 28, 2026 11:15
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