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

next
yml 120 lines 4.72 KB
Raw
1 name: Docs - Toolkit Parity
2
3 # Checks that the deployed toolkit Markdown pages list the tools production
4 # serves, and that each production tools page stays under the page-size budget
5 # that keeps it cacheable. A stale Next.js data-cache entry served tableau.md
6 # with 10 of 436 tools for days without any check failing.
7
8 on:
9 schedule:
10 - cron: '23 */6 * * *'
11 workflow_dispatch:
12
13 permissions:
14 contents: read
15
16 concurrency:
17 group: ${{ github.workflow }}
18 cancel-in-progress: false
19
20 jobs:
21 parity:
22 runs-on: ubuntu-latest
23 permissions:
24 contents: read
25 issues: write
26 defaults:
27 run:
28 working-directory: ./docs
29 env:
30 # Production read access; the shared COMPOSIO_API_KEY secret is staging-scoped.
31 COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_DOCS_API_KEY }}
32
33 steps:
34 - name: Checkout repository
35 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
36 with:
37 persist-credentials: false
38
39 - name: Setup Node.js, pnpm, Bun
40 uses: ./.github/actions/setup-node-pnpm-bun
41
42 - name: Cache bun dependencies
43 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
44 with:
45 path: ~/.bun/install/cache
46 key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }}
47 restore-keys: |
48 ${{ runner.os }}-bun-
49
50 - name: Install dependencies
51 run: bun install --frozen-lockfile --ignore-scripts
52
53 - name: Check toolkit parity
54 run: |
55 bun run check:toolkit-parity --markdown "$RUNNER_TEMP/toolkit-parity.md"
56
57 - name: Publish report
58 if: always()
59 run: cat "$RUNNER_TEMP/toolkit-parity.md" >> "$GITHUB_STEP_SUMMARY" 2>/dev/null || true
60
61 # One tracking issue per outage, closed by the next clean run, so a
62 # failing schedule does not re-alert every six hours.
63 - name: Open tracking issue on failure
64 id: open-issue
65 if: failure()
66 working-directory: ${{ github.workspace }}
67 env:
68 GH_TOKEN: ${{ github.token }}
69 GH_REPO: ${{ github.repository }}
70 LABEL: docs-toolkit-parity
71 RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
72 run: |
73 gh label create "$LABEL" --color B60205 \
74 --description "Deployed toolkit pages disagree with production" 2>/dev/null || true
75
76 existing=$(gh issue list --label "$LABEL" --state open --limit 1 --json number --jq '.[0].number // empty')
77 if [ -n "$existing" ]; then
78 echo "Issue #$existing is already open; not filing a duplicate."
79 exit 0
80 fi
81
82 {
83 echo "The scheduled \`Docs - Toolkit Parity\` check failed: $RUN_URL"
84 echo
85 cat "$RUNNER_TEMP/toolkit-parity.md" 2>/dev/null || echo "The checker exited before writing its report."
86 echo
87 echo "A deployed page listing fewer tools than production usually means a Next.js data-cache entry is stale."
88 echo "Check \`vercel logs --query 'data cache'\` for 'items over 2MB' warnings, and lower the page size in"
89 echo "\`docs/lib/composio-api.ts\` if a page is over budget. This issue closes after the next clean run."
90 } > "$RUNNER_TEMP/toolkit-parity-issue.md"
91
92 url=$(gh issue create --title "Deployed toolkit pages disagree with production" \
93 --label "$LABEL" --body-file "$RUNNER_TEMP/toolkit-parity-issue.md")
94 echo "issue_url=$url" >> "$GITHUB_OUTPUT"
95
96 - name: Notify Slack
97 if: failure() && steps.open-issue.outputs.issue_url
98 uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
99 with:
100 webhook: ${{ secrets.SLACK_POD_DX_WEBHOOK_URL }}
101 webhook-type: incoming-webhook
102 payload: |
103 {"text": "🚨 *Docs Toolkit Parity*: deployed toolkit pages disagree with production. <${{ steps.open-issue.outputs.issue_url }}|Tracking issue>"}
104
105 # GitHub issue cleanup is best effort after a successful parity check.
106 # ast-grep-ignore: yaml-continue-on-error
107 - name: Close tracking issue on recovery
108 if: success()
109 continue-on-error: true
110 working-directory: ${{ github.workspace }}
111 env:
112 GH_TOKEN: ${{ github.token }}
113 GH_REPO: ${{ github.repository }}
114 LABEL: docs-toolkit-parity
115 run: |
116 existing=$(gh issue list --label "$LABEL" --state open --limit 1 --json number --jq '.[0].number // empty')
117 if [ -n "$existing" ]; then
118 gh issue close "$existing" \
119 --comment "Toolkit parity recovered in ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}."
120 fi