@devries-cameron20 / composio Mirror · read-only / commits / aede04995
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, 19:45 UTC

ci(docs): keep docs @composio/* deps current on each SDK sync (#3709)

## Summary The `Docs - Sync guides on SDK changes` workflow updates docs **content** when SDK source changes on `next`, but it never touched `docs/package.json`. Because the docs site is a standalone Bun app **outside** the pnpm workspace — it pins *published* `@composio/*` versions rather than linking workspace source — those pins silently drifted behind the SDK. That drift is what produced the recent breakage in #3705: docs still pinned `@composio/core@0.9.1` while `delete()` shipped in `0.13.1`, so the Twoslash type-check failed and the sync bot worked around it by casting a fake `delete()` onto the session type. ## What this changes In `docs.sdk-change-sync.yml` (gated on the same `has_changes` condition as the rest of the job): - **New step** sets up Node/Bun (via the shared `setup-node-pnpm-bun` action) and realigns every `@composio/*` dependency in `docs/package.json` to its **latest published** release (`npm view <pkg> version` → `^<latest>`), then refreshes `bun.lock` with `bun install`. It scans both `dependencies` and `devDependencies`, is idempotent (no diff → no `bun install`), and warns rather than fails if a version can't be resolved. - **`add-paths`** now includes `docs/package.json` and `docs/bun.lock` so the realignment lands in the PR. - **Content prompt** gains a rule: don't add casts/assertions to compile against an API missing from the published package — document released behavior and let the Twoslash build flag the gap. ## Why pin to *published* (not workspace source) Docs deliberately target what users can `npm install`. Twoslash snippets and the runnable example apps are a contract that the documented API exists in a real release. The PR's existing Twoslash build (`docs-typescript-check.yml`) remains the gate: if a documented feature isn't published yet, the build fails loudly instead of being silently worked around. ## Notes - Complementary to #3705, which fixes the *current* stale pins by hand; this prevents the drift from recurring. - Validated the bump shell logic locally under `bash` (matching the runner): correctly resolves all 10 `@composio/*` devDeps and is a no-op when already current.

Alberto Schiabel committed Jun 29, 2026 at 14:35 UTC aede04995dd928b7a51d4957a9a02e53d9d37dd3
1 file changed +62 -4
.github/workflows/docs.sdk-change-sync.yml
+62 -4
@@ -77,7 +77,57 @@ jobs:
77 4. Update any docs that would be stale or incorrect after this SDK change — guides, FAQs, examples, quickstart, etc.
78 5. Do NOT touch docs/content/reference/ (those are auto-generated separately)
79 6. Do NOT touch docs/content/changelog/ (changelogs are written separately)
80 - 7. If no docs changes are needed, make no file changes
80 + 7. Do NOT edit docs/package.json or docs/bun.lock — the `@composio/*` version pins are managed automatically by the dependency-realignment step below, which runs after you and overwrites any changes you make to them
81 + 8. If no docs changes are needed, make no file changes
82 + 9. Do NOT add type assertions or casts to force a snippet to compile against an API that is missing from the published `@composio/*` package. If a feature isn't released yet, document the released behavior and let the Twoslash build flag the gap.
83 +
84 + - name: Setup Node.js, pnpm, Bun
85 + if: steps.diff.outputs.has_changes == 'true'
86 + uses: ./.github/actions/setup-node-pnpm-bun
87 +
88 + - name: Align docs SDK deps with latest published releases
89 + if: steps.diff.outputs.has_changes == 'true'
90 + working-directory: ./docs
91 + run: |
92 + # Docs is a standalone Bun app outside the pnpm workspace: it pins
93 + # published @composio/* versions instead of linking workspace source,
94 + # so its Twoslash snippets and example apps only ever demonstrate APIs
95 + # that users can actually install. Realign those pins to the latest
96 + # released versions on every sync so they never drift behind the SDK
97 + # (the drift that previously forced workaround casts into snippets).
98 + # This runs AFTER the content pass so the committed pins are always
99 + # authoritative — even if that pass edited package.json/bun.lock, this
100 + # step resets the @composio/* pins and regenerates the lockfile.
101 + # The PR's Twoslash build (docs-typescript-check.yml) gates the result:
102 + # if a documented feature isn't published yet, the build fails loudly
103 + # instead of the gap being papered over.
104 + set -euo pipefail
105 + # Discard any edits the content pass made to these managed files so the
106 + # realignment is the sole source of truth for the dependency pins.
107 + git checkout -- package.json bun.lock
108 + changed=0
109 + for section in dependencies devDependencies; do
110 + pkgs=$(jq -r --arg s "$section" '.[$s] // {} | keys[] | select(startswith("@composio/"))' package.json)
111 + for pkg in $pkgs; do
112 + latest=$(npm view "$pkg" version 2>/dev/null || true)
113 + if [ -z "$latest" ]; then
114 + echo "::warning::could not resolve a published version for $pkg; leaving its pin unchanged"
115 + continue
116 + fi
117 + current=$(jq -r --arg s "$section" --arg p "$pkg" '.[$s][$p]' package.json)
118 + want="^$latest"
119 + if [ "$current" != "$want" ]; then
120 + echo "$section.$pkg: $current -> $want"
121 + npm pkg set "$section.$pkg=$want"
122 + changed=1
123 + fi
124 + done
125 + done
126 + if [ "$changed" -eq 1 ]; then
127 + bun install
128 + else
129 + echo "All @composio/* pins already match the latest published releases."
130 + fi
131
132 - name: Create PR if changed
133 id: create-pr
@@ -91,18 +141,26 @@ jobs:
141 ## Summary
142 Automated docs update triggered by SDK source changes on `next`.
143
94 - Claude reviewed the SDK diff and updated guides, FAQs, or examples
95 - that reference changed APIs or features.
144 + - Claude reviewed the SDK diff and updated guides, FAQs, or examples
145 + that reference changed APIs or features.
146 + - The docs `@composio/*` dependencies were realigned to their latest
147 + published releases so Twoslash snippets and example apps validate
148 + against versions users can actually install.
149
150 ## Review checklist
151 - [ ] Changes accurately reflect the new SDK behavior
152 - [ ] No unrelated docs were modified
153 - [ ] Code examples are correct and complete
154 + - [ ] If a documented feature is not published yet, the Twoslash build
155 + will fail — wait for the release instead of working around it
156
157 Generated by Claude Code via GitHub Actions.
158 branch: docs/auto-sdk-sync
159 base: next
105 - add-paths: docs/content/docs/
160 + add-paths: |
161 + docs/content/docs/
162 + docs/package.json
163 + docs/bun.lock
164
165 - name: Request review from pusher
166 if: steps.create-pr.outputs.pull-request-number