@devries-cameron20 / composio Mirror · read-only / commits / 5803b4544
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 13:30 UTC

fix(docs): accept Mercury data refresh events (#4345)

## Summary - accept `mercury-production-deploy` alongside the Apollo deployment event - log the correct source commit for Apollo and Mercury dispatches - preserve compatibility with Apollo’s legacy `hermes_commit` payload - show the dispatch action and source commit in generated data PRs ## Companion PR - ComposioHQ/mercury#26701 sends the event after a successful production registry sync. ## Verification - `bun test tests/static/docs-data-workflow.test.ts` (6 passed) - `bunx oxlint tests/static/docs-data-workflow.test.ts` - `bunx prettier --check ../.github/workflows/docs-update-data.yml tests/static/docs-data-workflow.test.ts` - `actionlint .github/workflows/docs-update-data.yml` - `bun test tests/static` reached 541 passes. One unrelated analytics test failed because Bun could not bind its ephemeral local server with `EADDRINUSE`; rerunning that test reproduced the same local environment failure.

Brendan O'Leary committed Sep 7, 2026 at 09:14 UTC 5803b4544bfbd7a84ad77ee099b2b1b067814ddd
2 files changed +43 -11
.github/workflows/docs-update-data.yml
+17 -5
@@ -4,7 +4,7 @@ on:
4 schedule:
5 - cron: '0 */5 * * *'
6 repository_dispatch:
7 - types: [apollo-production-deploy]
7 + types: [apollo-production-deploy, mercury-production-deploy]
8 workflow_dispatch:
9
10 permissions:
@@ -71,13 +71,21 @@ jobs:
71 - name: Log trigger source
72 env:
73 EVENT_NAME: ${{ github.event_name }}
74 - HERMES_COMMIT: ${{ github.event.client_payload.hermes_commit }}
74 + DISPATCH_ACTION: ${{ github.event.action }}
75 + APOLLO_COMMIT: ${{ github.event.client_payload.apollo_commit || github.event.client_payload.hermes_commit }}
76 + MERCURY_COMMIT: ${{ github.event.client_payload.mercury_commit }}
77 DEPLOY_TIMESTAMP: ${{ github.event.client_payload.timestamp }}
78 run: |
79 echo "Workflow triggered by: $EVENT_NAME"
80 if [ "$EVENT_NAME" = "repository_dispatch" ]; then
79 - echo "Triggered by Apollo production deployment"
80 - echo "Hermes commit: $HERMES_COMMIT"
81 + echo "Repository dispatch action: $DISPATCH_ACTION"
82 + if [ "$DISPATCH_ACTION" = "mercury-production-deploy" ]; then
83 + echo "Triggered by Mercury production registry sync"
84 + echo "Mercury commit: $MERCURY_COMMIT"
85 + else
86 + echo "Triggered by Apollo production deployment"
87 + echo "Apollo commit: $APOLLO_COMMIT"
88 + fi
89 echo "Timestamp: $DEPLOY_TIMESTAMP"
90 fi
91
@@ -159,7 +167,11 @@ jobs:
167 title: 'docs: update toolkits, API spec, and meta tools data'
168 body: |
169 ## Summary
162 - Automated sync of backend data into the docs site. Triggered by: `${{ github.event_name }}`${{ github.event_name == 'repository_dispatch' && format(' (Hermes commit: {0})', github.event.client_payload.hermes_commit) || '' }}.
170 + Automated sync of backend data into the docs site.
171 +
172 + - Trigger: `${{ github.event_name }}`
173 + - Dispatch action: `${{ github.event.action || 'n/a' }}`
174 + - Source commit: `${{ github.event.client_payload.mercury_commit || github.event.client_payload.apollo_commit || github.event.client_payload.hermes_commit || 'n/a' }}`
175
176 ## What changed
177 - **Toolkit catalog** (`docs/public/data/toolkits.json`, `toolkits-list.json`) — refreshed list of available toolkits, auth schemes, and tools from the backend API
docs/tests/static/docs-data-workflow.test.ts
+26 -6
@@ -21,6 +21,16 @@ const workflowStepSchema = z
21
22 const workflowSchema = z
23 .object({
24 + on: z
25 + .object({
26 + repository_dispatch: z
27 + .object({
28 + types: z.array(z.string()),
29 + })
30 + .optional(),
31 + })
32 + .passthrough()
33 + .optional(),
34 jobs: z
35 .record(
36 z.string(),
@@ -36,11 +46,6 @@ const workflowSchema = z
46
47 type WorkflowStep = z.infer<typeof workflowStepSchema>;
48
39 -function workflowSteps(path: string, job: string): WorkflowStep[] {
40 - const workflow = workflowSchema.parse(Bun.YAML.parse(readFileSync(path, 'utf8')));
41 - return workflow.jobs?.[job]?.steps ?? [];
42 -}
43 -
49 function stepNamed(steps: WorkflowStep[], name: string): WorkflowStep {
50 const step = steps.find(candidate => candidate.name === name);
51 expect(step, `Expected workflow step "${name}"`).toBeDefined();
@@ -48,7 +53,22 @@ function stepNamed(steps: WorkflowStep[], name: string): WorkflowStep {
53 }
54
55 describe('docs data update workflow', () => {
51 - const steps = workflowSteps(workflowPath, 'update-data');
56 + const workflow = workflowSchema.parse(Bun.YAML.parse(readFileSync(workflowPath, 'utf8')));
57 + const steps = workflow.jobs?.['update-data']?.steps ?? [];
58 +
59 + test('refreshes data after Apollo and Mercury production changes', () => {
60 + expect(workflow.on?.repository_dispatch?.types).toEqual([
61 + 'apollo-production-deploy',
62 + 'mercury-production-deploy',
63 + ]);
64 +
65 + const logTrigger = stepNamed(steps, 'Log trigger source');
66 + expect(logTrigger.env?.APOLLO_COMMIT).toContain('client_payload.hermes_commit');
67 + expect(logTrigger.env?.MERCURY_COMMIT).toBe(
68 + '${{ github.event.client_payload.mercury_commit }}'
69 + );
70 + expect(logTrigger.run).toContain('Triggered by Mercury production registry sync');
71 + });
72
73 test('keeps the release-bot token scoped to data sync and PR creation', () => {
74 const appToken = stepNamed(steps, 'Generate GitHub App token');