@devries-cameron20 / composio Mirror · read-only / commits / d9c646bef
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, 03:37 UTC

fix(release): allow admin requesters to approve SDK releases (#5439)

This PR: - allows a release requester to approve the bot-authored SDK release PR when GitHub reports their current repository permission as `admin` - keeps non-admin requesters and the PR author excluded, and preserves exact-head approval, outstanding change-request, bot-commit, and candidate-check gates - applies the same exception to normal tagging and `regate`, with regression coverage for stale approvals and failed candidates - updates generated release instructions, status messages, and the release runbooks to describe the exception Unblocks the requester approval on https://github.com/ComposioHQ/composio/pull/5438 once this change lands on `next`. Validation: reproduced the admin-requester refusal before the fix; all 198 SDK release tests passed afterward. SDK release typechecking, Oxlint, actionlint, agent-skill validation, and skill-routing validation passed. <!-- sdk-release-note-exempt: Changes release approval policy and contributor instructions without changing public SDK behavior. --> Please review the full diff before merging.

Alberto Schiabel committed Nov 17, 2026 at 19:43 UTC d9c646bef2000163fcf4fb4b6339ceae211a4c49
12 files changed +76 -24
.agents/skills/repo-guidance/references/repository-workflow.md
+1 -1
@@ -50,7 +50,7 @@ make build
50 - Public SDK behavior changes need a Changesets note for each affected TypeScript package and/or the private `@composio/python-sdk` marker. Python core and supported providers share one stable release train.
51 - `@composio/cli` is ignored by Changesets. Never target it in a changeset while it remains ignored; use the `cli-release` skill for beta builds and stable promotion.
52 - Repo guidance, docs-only, tests-only, internal validation and CLI-only changes do not require an SDK note. Explicit behavior exemptions need a meaningful `<!-- sdk-release-note-exempt: meaningful reason of at least 20 characters -->` comment in the PR body.
53 -- Stable and beta SDKs use **SDK release** on protected `next`: a member issue request, one release PR that a non-requester approves and a person merges, and a tag run that publishes the PR-built candidates. Recover with **Re-run failed jobs**. Read `ts/docs/internal/release.md` before operating it.
53 +- Stable and beta SDKs use **SDK release** on protected `next`: a member issue request, one release PR that a repository writer approves and a person merges, and a tag run that publishes the PR-built candidates. Requesters may approve only with repository admin permission at release time; the PR author remains excluded. Recover with **Re-run failed jobs**. Read `ts/docs/internal/release.md` before operating it.
54
55 ## Generated And Vendor Files
56
.github/workflows/sdk.release.yml
+1 -1
@@ -6,7 +6,7 @@ run-name: SDK release (${{ github.event_name }}, ${{ github.actor }})
6 # 1. request a ComposioHQ member opens an `[SDK release]` issue or dispatches this workflow;
7 # the bot plans versions on protected next and opens one release PR.
8 # sdk.release.candidates.yml builds and smoke-tests the files on the release PR;
9 -# a writer who did not request the release approves, and a person merges.
9 +# an eligible repository writer approves, and a person merges.
10 # 2. review when the release PR closes, the bot re-checks approval and checks, then tags the
11 # reviewed head. A PR closed without merging is abandoned. A `regate` dispatch
12 # from next re-runs that gate, as next has it now, for a merged release that a
CONTRIBUTING.md
+1 -1
@@ -338,7 +338,7 @@ bun run lint:links
338
339 ## Release Process
340
341 -Any active ComposioHQ member can request a stable or beta SDK release through the SDK release issue form. Repository writers can also run **SDK release** on `next`. A repository writer who did not request the release approves the final release PR, a person merges it, and automation publishes the candidates the PR built and checked. See the shared runbook below. CLI binaries and the 1.0 prerelease train on `main` keep their separate workflows.
341 +Any active ComposioHQ member can request a stable or beta SDK release through the SDK release issue form. Repository writers can also run **SDK release** on `next`. A repository writer other than the PR author approves the final release PR, a person merges it, and automation publishes the candidates the PR built and checked. The requester may approve only with repository `admin` permission, checked at release time. See the shared runbook below. CLI binaries and the 1.0 prerelease train on `main` keep their separate workflows.
342
343 - TypeScript packages and the CLI: [`ts/docs/internal/release.md`](ts/docs/internal/release.md)
344 - Python packages: [`python/docs/release.md`](python/docs/release.md)
python/docs/release.md
+1 -1
@@ -2,7 +2,7 @@
2
3 Request a stable Python release through the shared [SDK release procedure](../../ts/docs/internal/release.md). Every active ComposioHQ member can use the release issue form. Leave Python at `auto` to follow the changesets, or select a patch, minor, or major override. Set TypeScript to `skip` for a Python-only release.
4
5 -Public Python SDK/provider changes include a changeset targeting the private `@composio/python-sdk` marker. Core and supported providers form one stable train. The bot updates the version mirrors and `uv.lock` and opens one release PR. Its `SDK candidate (python)` check builds the wheels and sdists; `SDK candidate smoke (python)` installs them in a clean venv and tests the new core with the latest published providers. A repository writer who did not request the release approves the head, and a person merges it. The tag run publishes those exact files through the tag-only `pypi-release` identity.
5 +Public Python SDK/provider changes include a changeset targeting the private `@composio/python-sdk` marker. Core and supported providers form one stable train. The bot updates the version mirrors and `uv.lock` and opens one release PR. Its `SDK candidate (python)` check builds the wheels and sdists; `SDK candidate smoke (python)` installs them in a clean venv and tests the new core with the latest published providers. A repository writer other than the PR author approves the head, and a person merges it. If you requested the release, your approval counts only while you have repository `admin` permission. The tag run publishes those exact files through the tag-only `pypi-release` identity.
6
7 If publishing fails, choose **Re-run failed jobs** on the tag run within 30 days of the candidate build. After that, add a changeset for `@composio/python-sdk` and request a new release; the train moves to the next version. If the merged release was never tagged, follow the recovery table in the [SDK release procedure](../../ts/docs/internal/release.md#recover-a-failed-release).
8
scripts/sdk-release/approval.ts
+11 -11
@@ -24,12 +24,13 @@ export interface Review {
24 }
25
26 /**
27 - * A writer who is not excluded (the PR author and the requester) approved this exact head, and
28 - * no writer's latest review requests changes.
27 + * A writer other than the PR author approved this exact head. A requester must be an admin,
28 + * and no writer's latest review may request changes.
29 */
30 export function eligibleApproval(
31 reviews: ReadonlyArray<Review>,
32 - excluded: ReadonlyArray<string>,
32 + author: string,
33 + requester: string,
34 head: string
35 ) {
36 const latest = [...new Map(reviews.map(review => [review.user, review])).values()];
@@ -38,7 +39,10 @@ export function eligibleApproval(
39 !writers.some(review => review.state === 'CHANGES_REQUESTED') &&
40 writers.some(
41 review =>
41 - !excluded.includes(review.user) && review.state === 'APPROVED' && review.commitId === head
42 + review.user !== author &&
43 + (review.user !== requester || review.permission === 'admin') &&
44 + review.state === 'APPROVED' &&
45 + review.commitId === head
46 )
47 );
48 }
@@ -177,7 +181,7 @@ export const trustedIssue = (pull: PullDetail, batch: ReleaseBatch, appSlug: str
181 * The checks a release PR must pass before its head is tagged:
182 * - the head is the release App's own commit on the frozen source, so nobody added changes the
183 * release-only diff check did not see;
180 - * - a writer other than the author and the requester approved that head;
184 + * - a writer other than the author approved that head; requesters must be repository admins;
185 * - the candidate build and smoke checks passed on it, and the docs check for a stable release.
186 */
187 export const verifyReleaseGate = (pull: PullDetail, batch: ReleaseBatch, appSlug: string) =>
@@ -188,12 +192,8 @@ export const verifyReleaseGate = (pull: PullDetail, batch: ReleaseBatch, appSlug
192 );
193 const reviews = yield* reviewsWithPermissions(pull.number);
194 yield* ensure(
191 - eligibleApproval(
192 - reviews,
193 - [pull.user?.login ?? '', batch.requestedBy].filter(Boolean),
194 - pull.head.sha
195 - ),
196 - 'Final release head lacks an approval from a writer other than the author and requester'
195 + eligibleApproval(reviews, pull.user?.login ?? '', batch.requestedBy, pull.head.sha),
196 + 'Final release head lacks an approval from a writer other than the author; requesters must have repository admin permission'
197 );
198 // A release head that touches every SDK runs more than one page of checks.
199 const checks = yield* Stream.runCollect(
scripts/sdk-release/release-pr.ts
+1 -1
@@ -160,7 +160,7 @@ export const releasePullBody = (
160 '## How this ships',
161 [
162 `1. Release source is frozen at ${batch.inputBase}. Later \`next\` commits and their changesets wait for the next release.`,
163 - `2. Review the diff and approve this head. Approval must come from a writer other than the requester (@${batch.requestedBy}). Do not push to this branch: the tag step only accepts the release bot's commit. To change the notes, fix the changesets on \`next\`, close this PR and request a new release.`,
163 + `2. Review the diff and approve this head. Approval must come from a repository writer; the requester (@${batch.requestedBy}) may approve only with repository admin permission at release time. Do not push to this branch: the tag step only accepts the release bot's commit. To change the notes, fix the changesets on \`next\`, close this PR and request a new release.`,
164 `3. After approval and green checks, merge this PR. The release workflow rechecks the approval and tags this exact head \`sdk-release/${batch.id}\`; if the check fails, it creates no tag and asks you to revert this PR and request the release again.`,
165 '4. The tag run publishes the exact files the `SDK candidate` checks built and the `SDK candidate smoke` checks installed on this PR. If a publish job fails, use "Re-run failed jobs" on that run.',
166 copy.afterPublish,
scripts/sdk-release/source.ts
+1 -1
@@ -13,7 +13,7 @@ export const ReleaseBatch = Schema.Struct({
13 id: RunId,
14 /** The protected `next` commit the release is planned from. */
15 inputBase: Sha,
16 - /** The member who requested this release; they may not approve it. */
16 + /** The member who requested this release; they may approve it only as a repository admin. */
17 requestedBy: Schema.String,
18 /** The issue that tracks this release. */
19 issue: PositiveInt,
scripts/sdk-release/state.ts
+1 -1
@@ -103,7 +103,7 @@ export const describe = (state: ReleaseState) =>
103 `The release planned in run ${release} merged into \`next\` but was never tagged. If a gate bug refused it and the fix is on \`next\`, dispatch **SDK release** with action \`regate\`; otherwise revert its release PR on \`next\`. Then request this release again. See ${RECOVERY_RUNBOOK}`,
104 Empty: () => 'Nothing to release: no pending changesets for the selected languages.',
105 InReview: ({ pull }) =>
106 - `Release PR: ${pull}\n\nA writer other than the requester approves it. Merging it tags and publishes the release.`,
106 + `Release PR: ${pull}\n\nA repository writer approves it. The requester may approve only with repository admin permission. Merging it tags and publishes the release.`,
107 Abandoned: ({ pull }) =>
108 `${pull} closed without merging, so nothing was tagged or published. Request a new release when ready.`,
109 Refused: ({ pull, reason }) =>
test/sdk-release-approval.test.ts
+45 -2
@@ -30,7 +30,6 @@ const commentBodies = (writes: ReadonlyArray<{ body: unknown }>) =>
30 writes.map(write => (write.body as { body: string }).body);
31
32 describe('release approval rule', () => {
33 - const excluded = ['author', 'requester'];
33 const review = { user: 'reviewer', state: 'APPROVED', commitId: head, permission: 'write' };
34
35 test.each([
@@ -41,7 +40,32 @@ describe('release approval rule', () => {
40 true,
41 ],
42 ['the requester', [{ ...review, user: 'requester' }], false],
43 + ['an admin requester', [{ ...review, user: 'requester', permission: 'admin' }], true],
44 + [
45 + 'a requester with maintain permission',
46 + [{ ...review, user: 'requester', permission: 'maintain' }],
47 + false,
48 + ],
49 + [
50 + 'an admin requester approving an older commit',
51 + [{ ...review, user: 'requester', permission: 'admin', commitId: base }],
52 + false,
53 + ],
54 + [
55 + 'an admin requester whose approval was dismissed',
56 + [{ ...review, user: 'requester', permission: 'admin', state: 'DISMISSED' }],
57 + false,
58 + ],
59 + [
60 + 'an admin requester while another writer requests changes',
61 + [
62 + { ...review, user: 'requester', permission: 'admin' },
63 + { ...review, user: 'maintainer', state: 'CHANGES_REQUESTED' },
64 + ],
65 + false,
66 + ],
67 ['the author', [{ ...review, user: 'author' }], false],
68 + ['an admin author', [{ ...review, user: 'author', permission: 'admin' }], false],
69 ['an approval of an older commit', [{ ...review, commitId: base }], false],
70 ['a reader', [{ ...review, permission: 'read' }], false],
71 ['an approval later overridden', [review, { ...review, state: 'CHANGES_REQUESTED' }], false],
@@ -51,11 +75,20 @@ describe('release approval rule', () => {
75 false,
76 ],
77 ])('%s → %p', (_name, reviews, expected) => {
54 - expect(eligibleApproval(reviews, excluded, head)).toBe(expected);
78 + expect(eligibleApproval(reviews, 'author', 'requester', head)).toBe(expected);
79 });
80 });
81
82 describe('source tag', () => {
83 + test('an admin requester can approve the exact bot-authored head', async () => {
84 + const { fetcher, writes } = fakeController({
85 + reviewer: 'requester',
86 + reviewerPermission: 'admin',
87 + });
88 + expect(await tag(fetcher)).toEqual(tagged);
89 + expect(writes).toEqual([tagWrite]);
90 + });
91 +
92 test.each(['merge', 'squash'] as const)(
93 'a merged, approved release tags the reviewed head (%s merge)',
94 async mergeKind => {
@@ -130,6 +163,16 @@ describe('source tag', () => {
163
164 test.each<[string, ControllerOptions, string]>([
165 ['the requester approves', { reviewer: 'requester' }, 'lacks an approval'],
166 + [
167 + 'the admin requester approves an older head',
168 + { reviewer: 'requester', reviewerPermission: 'admin', oldReview: true },
169 + 'lacks an approval',
170 + ],
171 + [
172 + 'the admin requester approves but the candidate build failed',
173 + { reviewer: 'requester', reviewerPermission: 'admin', failedCandidate: true },
174 + 'SDK candidate (typescript)',
175 + ],
176 ['the approval is for an older head', { oldReview: true }, 'lacks an approval'],
177 ['a human pushed the head', { headAuthor: 'writer' }, 'release App commit'],
178 [
test/sdk-release-controller-fixture.ts
+2 -1
@@ -73,6 +73,7 @@ export interface ControllerOptions {
73 readonly deletedReviewer?: boolean;
74 readonly oldReview?: boolean;
75 readonly reviewer?: string;
76 + readonly reviewerPermission?: string;
77 readonly mergeKind?: 'squash' | 'merge';
78 readonly existingTag?: string;
79 readonly failedCandidate?: boolean;
@@ -158,7 +159,7 @@ export function fakeController(options: ControllerOptions = {}) {
159 },
160 ]);
161 if (path === `/collaborators/${options.reviewer ?? 'reviewer'}/permission`)
161 - return response({ permission: 'write' });
162 + return response({ permission: options.reviewerPermission ?? 'write' });
163 if (path.startsWith(`/commits/${head}/check-runs`))
164 return response({
165 check_runs: [
test/sdk-release-regate.test.ts
+8
@@ -26,6 +26,14 @@ const tagged = Exit.succeed({ _tag: 'Tagged', tag: 'sdk-release/8' } as const);
26 const controller = (options: ControllerOptions = {}) => fakeController(options);
27
28 describe('regate', () => {
29 + test('accepts an admin requester approval when re-gating a merged release', async () => {
30 + const github = controller({ reviewer: 'requester', reviewerPermission: 'admin' });
31 + expect(await regate(github.fetcher)).toEqual(tagged);
32 + expect(github.writes).toEqual([
33 + { method: 'POST', path: '/git/refs', body: { ref: 'refs/tags/sdk-release/8', sha: head } },
34 + ]);
35 + });
36 +
37 test('tags the merged, untagged release on next at its reviewed head', async () => {
38 const github = controller();
39 expect(await regate(github.fetcher)).toEqual(tagged);
ts/docs/internal/release.md
+3 -3
@@ -43,10 +43,10 @@ A beta goes through the same release PR, approval, gate and tag as a stable rele
43
44 ## Review and approve
45
46 -The release PR description lists each package's old and new version, the changesets it consumes or leaves for later, and links to the changelogs and regenerated references. It names the requester, who may not approve.
46 +The release PR description lists each package's old and new version, the changesets it consumes or leaves for later, and links to the changelogs and regenerated references. It names the requester, who may approve only with repository admin permission.
47
48 1. Wait for the `SDK candidate (<language>)` and `SDK candidate smoke (<language>)` checks. The first builds the exact files that will be published. The second installs them in a clean project like a user would; for Python it also tests the new core with the latest published providers. A stable release also runs `SDK candidate docs`: it installs the docs against the candidate packages through a job-local registry, then runs the docs lint, type, snippet and build checks, so a guide that breaks against the new SDK blocks the release. The ordinary docs checks skip release PRs.
49 -2. A repository writer who did not request the release approves the head.
49 +2. A repository writer other than the PR author approves the head. If you requested the release, you may approve it only while you have repository `admin` permission. The gate checks your current permission through GitHub when tagging or re-gating; `write` and `maintain` permission do not qualify for this exception. Any writer's outstanding change request still blocks the release.
50
51 Do not push to the release branch. The tag step accepts only the bot's commit, so a pushed commit (including **Update branch**) makes the merge fail the gate. To change the notes, fix the changesets on `next`, close the release PR, and request a new release.
52
@@ -76,7 +76,7 @@ Pick the row that matches what happened.
76 | The candidate artifacts expired (30 days after the candidate build) | Revert the release PR on `next`, then request the release again. |
77 | The tag exists but publishing failed | Open the tag run and choose **Re-run failed jobs**. |
78
79 -A re-run of the tag job runs the gate as `next` had it before the merge, so it repeats a gate bug. `regate` runs the gate as `next` has it now. It finds the release from the plan `next` carries and its release PR from the branch name, so it cannot be pointed at another PR or commit, and it applies exactly the same checks: the bot's head, an independent approval of that head, and green candidate checks. It tags the reviewed head if the release passes, does nothing if that tag already exists, and shares a concurrency group with the tag job. The new tag starts publishing as usual, and the request issue reopens.
79 +A re-run of the tag job runs the gate as `next` had it before the merge, so it repeats a gate bug. `regate` runs the gate as `next` has it now. It finds the release from the plan `next` carries and its release PR from the branch name, so it cannot be pointed at another PR or commit, and it applies exactly the same checks: the bot's head, an eligible approval of that head, and green candidate checks. It tags the reviewed head if the release passes, does nothing if that tag already exists, and shares a concurrency group with the tag job. The new tag starts publishing as usual, and the request issue reopens.
80
81 A re-run of the tag run publishes the same pinned files, skips files already published, and uploads the rest. This works while the candidate artifacts exist, 30 days from the candidate build. If a registry already serves different bytes, add changesets for the affected packages on `next` and request a new release. It plans from the versions in `next`, so the unpublished versions are skipped and the packages move to the next version.
82