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, 06:00 UTC
fix(release): check npm provenance before moving the channel tag
jkomyno committed
Nov 5, 2026 at 20:05 UTC
d809d4d51653b2a56cc9eb397b32e25ca3f553eb
2 files changed
+8
-4
scripts/sdk-release/registry.ts
+5
-3
@@ -438,8 +438,9 @@ export class NpmCli extends Context.Service<
438
}
439
440
/**
441
- * Publishes under a release-only dist-tag, moves the channel's tag once the upload is visible,
442
- * drops the release-only tag, and checks that each tarball's provenance names this release.
441
+ * Publishes under a release-only dist-tag, checks that each tarball's provenance names this
442
+ * release, then moves the channel's tag and drops the release-only tag. A failed check leaves
443
+ * the channel tag where it was.
444
*/
445
export const publishNpm = (cwd: string, batch: ReleaseBatch, files: ReadonlyArray<Distribution>) =>
446
Effect.gen(function* () {
@@ -457,6 +458,8 @@ export const publishNpm = (cwd: string, batch: ReleaseBatch, files: ReadonlyArra
458
`--tag=sdk-release-${batch.id}`,
459
]);
460
const visible = yield* waitForRegistry(files, { channelTags: false, channel });
461
+ // Users only install a version once its channel tag moves, so it moves after the checks.
462
+ for (const file of files) yield* verifyNpmProvenance(file, batch.id);
463
for (const tag of visible.tagsToRepair)
464
yield* npm(['dist-tag', 'add', `${tag.name}@${tag.version}`, tag.tag]);
465
yield* waitForRegistry(files, { channel });
@@ -470,7 +473,6 @@ export const publishNpm = (cwd: string, batch: ReleaseBatch, files: ReadonlyArra
473
if (Option.exists(tags, value => releaseOnly in value))
474
yield* npm(['dist-tag', 'rm', file.name, releaseOnly]);
475
}
473
- for (const file of files) yield* verifyNpmProvenance(file, batch.id);
476
});
477
478
/** The `name@version` specs of the published tarballs, for a fresh install. */
test/sdk-release-rehearsal.test.ts
+3
-1
@@ -231,7 +231,7 @@ describe('release rehearsal', () => {
231
expect(registry.commands.some(command => command.includes('latest'))).toBe(false);
232
});
233
234
- test('provenance from another ref fails the publication after upload', async () => {
234
+ test('provenance from another ref fails the publication before latest moves', async () => {
235
const registry = npmRegistry({ latest: '1.0.0' }, { ref: 'refs/heads/next' });
236
const tarball = await tarballOf(batch);
237
registry.stage(tarball);
@@ -241,6 +241,8 @@ describe('release rehearsal', () => {
241
registry.fetcher
242
)
243
).rejects.toThrow('was built by https://github.com/ComposioHQ/composio');
244
+ expect(registry.tags.latest).toBe('1.0.0');
245
+ expect(registry.commands.some(command => command.startsWith('dist-tag'))).toBe(false);
246
});
247
248
test('provenance that describes other bytes fails the publication', async () => {