@devries-cameron20 / composio-1 / commits / eba6c6d7e
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.

fix(release): keep provider peer bumps range-aware (#3582)

This PR: - prevents the open Changesets release PR from promoting provider packages to `1.0.0` when `@composio/core` gets a minor bump that still satisfies their peer range - points Changesets at `next`, matching the active TypeScript release branch and workflow trigger - enables `onlyUpdatePeerDependentsWhenOutOfRange` so peer dependents only major-bump when the new dependency version leaves their declared range - adds a release workflow guard that runs Changesets against a fixture and verifies `@composio/core@0.10.0` -> `0.11.0` keeps `@composio/openai` on `0.9.3` - leaves https://github.com/ComposioHQ/composio/pull/3429 to regenerate after this lands on `next`

Alberto Schiabel committed Jun 16, 2026 at 16:04 UTC eba6c6d7ef09ae5a3773864f268e4ab49775adc3
2 files changed +202 -21
.changeset/config.json
+4 -1
@@ -9,7 +9,10 @@
9 "version": true,
10 "tag": true
11 },
12 - "baseBranch": "main",
12 + "baseBranch": "next",
13 "updateInternalDependencies": "patch",
14 + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
15 + "onlyUpdatePeerDependentsWhenOutOfRange": true
16 + },
17 "ignore": []
18 }
test/release-workflow.test.ts
+198 -20
@@ -1,14 +1,18 @@
1 #!/usr/bin/env node
2 -import { chmodSync, mkdtempSync, rmSync, writeFileSync, readFileSync } from 'node:fs';
2 +import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync, readFileSync } from 'node:fs';
3 import { tmpdir } from 'node:os';
4 import { join } from 'node:path';
5 import { spawnSync } from 'node:child_process';
6
7 const packageJson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
8 +const changesetConfig = JSON.parse(
9 + readFileSync(new URL('../.changeset/config.json', import.meta.url), 'utf8')
10 +);
11 const tsReleaseWorkflow = readFileSync(
12 new URL('../.github/workflows/ts.release.yml', import.meta.url),
13 'utf8'
14 );
15 +const changesetBinPath = new URL('../node_modules/.bin/changeset', import.meta.url).pathname;
16 const releaseScriptUrl = new URL('../ts/scripts/changeset-release.sh', import.meta.url);
17 const releaseScriptPath = releaseScriptUrl.pathname;
18 const releaseScript = readFileSync(releaseScriptUrl, 'utf8');
@@ -43,12 +47,27 @@ if (packageJson.scripts?.['changeset:release'] !== 'bash ts/scripts/changeset-re
47 throw new Error('changeset:release must use the CLI-release filtering script');
48 }
49
50 +if (changesetConfig.baseBranch !== 'next') {
51 + throw new Error('changesets must compare against next, the active release branch');
52 +}
53 +
54 +if (
55 + changesetConfig.___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH
56 + ?.onlyUpdatePeerDependentsWhenOutOfRange !== true
57 +) {
58 + throw new Error(
59 + 'changesets must only major-bump peer dependents when the new dependency version leaves their declared peer range'
60 + );
61 +}
62 +
63 if (!releaseScript.includes('pnpm changeset publish')) {
64 throw new Error('release script must still publish non-CLI changeset packages');
65 }
66
67 if (!releaseScript.includes('New tag:[[:space:]]*@composio\\/cli@')) {
51 - throw new Error('release script must filter @composio/cli tag output before changesets/action creates GitHub releases');
68 + throw new Error(
69 + 'release script must filter @composio/cli tag output before changesets/action creates GitHub releases'
70 + );
71 }
72
73 // --- build-cli-binaries.yml: the CLI binary workflow is the sole, hardened release writer ---
@@ -74,10 +93,14 @@ if (!buildCliWorkflow.includes("- '.github/scripts/cli-release/**'")) {
93 throw new Error('build-cli-binaries.yml must trigger when CLI release helper scripts change');
94 }
95 if (helperCheckoutIdx === -1) {
77 - throw new Error('build-cli-binaries.yml must checkout workflow release helpers before publishing');
96 + throw new Error(
97 + 'build-cli-binaries.yml must checkout workflow release helpers before publishing'
98 + );
99 }
100 if (!buildCliWorkflow.includes('ref: ${{ github.workflow_sha }}')) {
80 - throw new Error('build-cli-binaries.yml must checkout release helpers from the workflow revision');
101 + throw new Error(
102 + 'build-cli-binaries.yml must checkout release helpers from the workflow revision'
103 + );
104 }
105 if (draftStepIdx === -1) {
106 throw new Error('build-cli-binaries.yml must create the draft via create-or-resume-draft.sh');
@@ -86,10 +109,16 @@ if (verifyStepIdx === -1) {
109 throw new Error('build-cli-binaries.yml must verify assets via verify-assets.sh');
110 }
111 if (publishIdx === -1) {
89 - throw new Error('build-cli-binaries.yml must publish by flipping the draft (gh release edit --draft=false)');
112 + throw new Error(
113 + 'build-cli-binaries.yml must publish by flipping the draft (gh release edit --draft=false)'
114 + );
115 }
91 -if (!(helperCheckoutIdx < draftStepIdx && draftStepIdx < verifyStepIdx && verifyStepIdx < publishIdx)) {
92 - throw new Error('build-cli-binaries.yml must order steps helper checkout → draft → verify → publish');
116 +if (
117 + !(helperCheckoutIdx < draftStepIdx && draftStepIdx < verifyStepIdx && verifyStepIdx < publishIdx)
118 +) {
119 + throw new Error(
120 + 'build-cli-binaries.yml must order steps helper checkout → draft → verify → publish'
121 + );
122 }
123
124 // The draft script must actually create a draft, and the verify gate must require fully-uploaded
@@ -104,7 +133,9 @@ if (!verifyAssetsScript.includes('select(.state == "uploaded")')) {
133 // Beta status must survive the draft→publish flip (regression: the old single create set
134 // --prerelease at creation; the new flow must set it on the draft).
135 if (!createDraftScript.includes('flags+=(--prerelease)')) {
107 - throw new Error('create-or-resume-draft.sh must preserve --prerelease on the draft for beta releases');
136 + throw new Error(
137 + 'create-or-resume-draft.sh must preserve --prerelease on the draft for beta releases'
138 + );
139 }
140
141 // Skills must be packaged BEFORE checksums are generated, so composio-skill.zip is hashed into
@@ -115,12 +146,16 @@ if (packageSkillsIdx === -1 || generateChecksumsIdx === -1) {
146 throw new Error('build-cli-binaries.yml must package skills and generate checksums');
147 }
148 if (!(packageSkillsIdx < generateChecksumsIdx)) {
118 - throw new Error('build-cli-binaries.yml must package skills before generating checksums so the skill zip is checksummed');
149 + throw new Error(
150 + 'build-cli-binaries.yml must package skills before generating checksums so the skill zip is checksummed'
151 + );
152 }
153
154 // Per-tag concurrency prevents two runs clobbering the same release without serializing betas.
155 if (!buildCliWorkflow.includes('group: cli-release-${{ needs.prepare.outputs.release_tag }}')) {
123 - throw new Error('build-cli-binaries.yml release job must use per-tag concurrency keyed on the release tag');
156 + throw new Error(
157 + 'build-cli-binaries.yml release job must use per-tag concurrency keyed on the release tag'
158 + );
159 }
160
161 // Release-target resolution lives in a standalone, unit-tested script (see executable tests
@@ -132,10 +167,14 @@ if (!buildCliWorkflow.includes('bash .github/scripts/cli-release/resolve-release
167 // The "latest stable" lookup must sort by numeric semver, not lexically: a lexical sort ranks
168 // @composio/cli@0.2.9 above 0.2.10 and would regress beta versioning once a patch hits 2 digits.
169 if (!resolveTargetScript.includes('map(tonumber)')) {
135 - throw new Error('resolve-release-target.sh must sort releases by numeric semver (map(tonumber)), not lexically');
170 + throw new Error(
171 + 'resolve-release-target.sh must sort releases by numeric semver (map(tonumber)), not lexically'
172 + );
173 }
174 if (!resolveTargetScript.includes('--exclude-drafts')) {
138 - throw new Error('resolve-release-target.sh must exclude draft stable releases from beta base selection');
175 + throw new Error(
176 + 'resolve-release-target.sh must exclude draft stable releases from beta base selection'
177 + );
178 }
179
180 // --- cli.install-health-check.yml: canary must exercise the failure-prone pinned path ---
@@ -148,28 +187,38 @@ if (!resolveTargetScript.includes('--exclude-drafts')) {
187 // latest is bumped minutes before the binary workflow publishes the GitHub release, so pinning to
188 // it would 404 during the healthy publish gap and false-page.
189 if (installHealthCheck.includes('$(npm view')) {
151 - throw new Error('cli.install-health-check.yml must not pin to npm (races ahead of the GitHub release)');
190 + throw new Error(
191 + 'cli.install-health-check.yml must not pin to npm (races ahead of the GitHub release)'
192 + );
193 }
194 if (!installHealthCheck.includes('gh release list')) {
154 - throw new Error('cli.install-health-check.yml must resolve the newest published release (drafts excluded)');
195 + throw new Error(
196 + 'cli.install-health-check.yml must resolve the newest published release (drafts excluded)'
197 + );
198 }
199 if (!installHealthCheck.includes('--repo "${{ github.repository }}"')) {
200 throw new Error('cli.install-health-check.yml must pass repository context to gh release list');
201 }
202 if (!installHealthCheck.includes('--limit 1000')) {
160 - throw new Error('cli.install-health-check.yml must look beyond the gh release list default limit');
203 + throw new Error(
204 + 'cli.install-health-check.yml must look beyond the gh release list default limit'
205 + );
206 }
207 if (
208 !installHealthCheck.includes('--exclude-drafts') ||
209 !installHealthCheck.includes('--exclude-pre-releases')
210 ) {
166 - throw new Error('cli.install-health-check.yml must resolve the newest published release (drafts excluded)');
211 + throw new Error(
212 + 'cli.install-health-check.yml must resolve the newest published release (drafts excluded)'
213 + );
214 }
215 if (installHealthCheck.includes('.[0].tagName')) {
216 throw new Error('cli.install-health-check.yml must not let jq null bypass the empty tag guard');
217 }
218 if (!installHealthCheck.includes("| sed -n '1p'")) {
172 - throw new Error('cli.install-health-check.yml must convert no matching release into empty output');
219 + throw new Error(
220 + 'cli.install-health-check.yml must convert no matching release into empty output'
221 + );
222 }
223 if (!installHealthCheck.includes('bash -s -- "${{ steps.resolve.outputs.tag }}"')) {
224 throw new Error('cli.install-health-check.yml must install the resolved tag via the pinned path');
@@ -207,7 +256,9 @@ esac
256 });
257
258 if (result.status !== 0) {
210 - throw new Error(`release script failed unexpectedly\nstdout:\n${result.stdout}\nstderr:\n${result.stderr}`);
259 + throw new Error(
260 + `release script failed unexpectedly\nstdout:\n${result.stdout}\nstderr:\n${result.stderr}`
261 + );
262 }
263
264 if (!result.stdout.includes('New tag: @composio/core@1.2.3')) {
@@ -225,6 +276,128 @@ esac
276 rmSync(fakeBin, { recursive: true, force: true });
277 }
278
279 +// A core minor release must not force every provider package to 1.0.0 while the
280 +// provider peer range still accepts the new core version. This protects the
281 +// @composio/core 0.10.0 → 0.11.0 release train from accidentally promoting
282 +// provider packages from 0.9.x to 1.0.0.
283 +{
284 + const fixtureDir = mkdtempSync(join(tmpdir(), 'composio-changeset-peer-'));
285 + try {
286 + mkdirSync(join(fixtureDir, '.changeset'), { recursive: true });
287 + mkdirSync(join(fixtureDir, 'packages/core'), { recursive: true });
288 + mkdirSync(join(fixtureDir, 'packages/openai'), { recursive: true });
289 +
290 + writeFileSync(
291 + join(fixtureDir, 'package.json'),
292 + JSON.stringify(
293 + {
294 + name: 'changeset-peer-fixture',
295 + private: true,
296 + packageManager: packageJson.packageManager,
297 + workspaces: ['packages/*'],
298 + },
299 + null,
300 + 2
301 + )
302 + );
303 + writeFileSync(
304 + join(fixtureDir, '.changeset/config.json'),
305 + JSON.stringify(
306 + {
307 + changelog: false,
308 + commit: false,
309 + fixed: [],
310 + linked: [],
311 + access: 'restricted',
312 + baseBranch: 'next',
313 + updateInternalDependencies: 'patch',
314 + ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
315 + onlyUpdatePeerDependentsWhenOutOfRange: true,
316 + },
317 + ignore: [],
318 + },
319 + null,
320 + 2
321 + )
322 + );
323 + writeFileSync(
324 + join(fixtureDir, '.changeset/core-minor-provider-patch.md'),
325 + [
326 + '---',
327 + '"@composio/core": minor',
328 + '"@composio/openai": patch',
329 + '---',
330 + '',
331 + 'Release a core minor and a provider patch without forcing a provider major.',
332 + '',
333 + ].join('\n')
334 + );
335 + writeFileSync(
336 + join(fixtureDir, 'packages/core/package.json'),
337 + JSON.stringify(
338 + {
339 + name: '@composio/core',
340 + version: '0.10.0',
341 + },
342 + null,
343 + 2
344 + )
345 + );
346 + writeFileSync(
347 + join(fixtureDir, 'packages/openai/package.json'),
348 + JSON.stringify(
349 + {
350 + name: '@composio/openai',
351 + version: '0.9.2',
352 + peerDependencies: {
353 + '@composio/core': '>=0.10.0 <1.0.0',
354 + },
355 + devDependencies: {
356 + '@composio/core': 'workspace:*',
357 + },
358 + },
359 + null,
360 + 2
361 + )
362 + );
363 +
364 + const result = spawnSync(changesetBinPath, ['version'], {
365 + cwd: fixtureDir,
366 + encoding: 'utf8',
367 + env: process.env,
368 + });
369 +
370 + if (result.status !== 0) {
371 + throw new Error(
372 + `changeset peer-dependent fixture failed\nstdout:\n${result.stdout}\nstderr:\n${result.stderr}`
373 + );
374 + }
375 +
376 + const coreFixturePackage = JSON.parse(
377 + readFileSync(join(fixtureDir, 'packages/core/package.json'), 'utf8')
378 + );
379 + const providerFixturePackage = JSON.parse(
380 + readFileSync(join(fixtureDir, 'packages/openai/package.json'), 'utf8')
381 + );
382 +
383 + if (coreFixturePackage.version !== '0.11.0') {
384 + throw new Error(`fixture core version should be 0.11.0, got ${coreFixturePackage.version}`);
385 + }
386 + if (providerFixturePackage.version !== '0.9.3') {
387 + throw new Error(
388 + `fixture provider version should remain on the 0.9.x train as 0.9.3, got ${providerFixturePackage.version}`
389 + );
390 + }
391 + if (providerFixturePackage.peerDependencies['@composio/core'] !== '>=0.10.0 <1.0.0') {
392 + throw new Error(
393 + `fixture provider peer range should still accept core 0.11.0 without widening, got ${providerFixturePackage.peerDependencies['@composio/core']}`
394 + );
395 + }
396 + } finally {
397 + rmSync(fixtureDir, { recursive: true, force: true });
398 + }
399 +}
400 +
401 // --- resolve-release-target.sh: executable tests for the release-target branching ---
402 //
403 // The script shells out to `gh` and `curl`; we stub both on PATH and feed fixtures, so these
@@ -286,7 +459,10 @@ function runResolver({ env, releasesFixture, curlFixture, ghViewIsDraft }) {
459 const fakeBin = mkdtempSync(join(tmpdir(), 'composio-fakebin-'));
460 const workdir = mkdtempSync(join(tmpdir(), 'composio-resolver-'));
461 try {
289 - for (const [name, body] of [['gh', FAKE_GH], ['curl', FAKE_CURL]]) {
462 + for (const [name, body] of [
463 + ['gh', FAKE_GH],
464 + ['curl', FAKE_CURL],
465 + ]) {
466 const p = join(fakeBin, name);
467 writeFileSync(p, body);
468 chmodSync(p, 0o755);
@@ -414,7 +590,9 @@ function runResolver({ env, releasesFixture, curlFixture, ghViewIsDraft }) {
590 throw new Error('promote-stable must emit prerelease=false and make_latest=true');
591 }
592 if (r.outputs.checkout_ref !== 'abc123') {
417 - throw new Error(`promote-stable must check out the beta's target_commitish, got ${r.outputs.checkout_ref}`);
593 + throw new Error(
594 + `promote-stable must check out the beta's target_commitish, got ${r.outputs.checkout_ref}`
595 + );
596 }
597 }
598