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
| 1 | import { describe, expect, test } from 'bun:test'; |
| 2 | import { missingReleaseNotes } from '../ts/scripts/validate-changesets.mjs'; |
| 3 | |
| 4 | describe('SDK fragment policy', () => { |
| 5 | const packages = [{ name: '@composio/core', directory: 'ts/packages/core', private: false }]; |
| 6 | test('requires both language entries for changed public source', () => { |
| 7 | expect( |
| 8 | missingReleaseNotes( |
| 9 | ['ts/packages/core/src/index.ts', 'python/composio/core/tools.py'], |
| 10 | [], |
| 11 | packages |
| 12 | ) |
| 13 | ).toEqual(['@composio/core', '@composio/python-sdk']); |
| 14 | expect( |
| 15 | missingReleaseNotes( |
| 16 | ['python/composio/core/tools.py', '.changeset/python-fix.md'], |
| 17 | [{ id: 'python-fix', releases: [{ name: '@composio/python-sdk', type: 'patch' }] }], |
| 18 | packages |
| 19 | ) |
| 20 | ).toEqual([]); |
| 21 | }); |
| 22 | test('preexisting pending notes cannot cover new public behavior in another PR', () => { |
| 23 | expect( |
| 24 | missingReleaseNotes( |
| 25 | ['python/composio/core/tools.py'], |
| 26 | [{ id: 'older-note', releases: [{ name: '@composio/python-sdk', type: 'patch' }] }], |
| 27 | packages |
| 28 | ) |
| 29 | ).toEqual(['@composio/python-sdk']); |
| 30 | expect( |
| 31 | missingReleaseNotes( |
| 32 | ['ts/packages/core/package.json'], |
| 33 | [], |
| 34 | packages, |
| 35 | '<!-- sdk-release-note-exempt: This release PR applies previously reviewed SDK changes and only updates release metadata and generated documentation. -->' |
| 36 | ) |
| 37 | ).toEqual([]); |
| 38 | }); |
| 39 | test('tests, CLI and a meaningful explicit exemption do not require SDK fragments', () => { |
| 40 | expect( |
| 41 | missingReleaseNotes( |
| 42 | [ |
| 43 | 'ts/packages/core/test/index.test.ts', |
| 44 | 'python/tests/test_tools.py', |
| 45 | 'ts/packages/cli/src/index.ts', |
| 46 | ], |
| 47 | [], |
| 48 | packages |
| 49 | ) |
| 50 | ).toEqual([]); |
| 51 | expect( |
| 52 | missingReleaseNotes( |
| 53 | ['python/composio/core/tools.py'], |
| 54 | [], |
| 55 | packages, |
| 56 | '<!-- sdk-release-note-exempt: Internal typing adjustment with no runtime or public signature changes. -->' |
| 57 | ) |
| 58 | ).toEqual([]); |
| 59 | expect( |
| 60 | missingReleaseNotes( |
| 61 | ['python/composio/core/tools.py'], |
| 62 | [], |
| 63 | packages, |
| 64 | '<!-- sdk-release-note-exempt: none -->' |
| 65 | ) |
| 66 | ).toEqual(['@composio/python-sdk']); |
| 67 | }); |
| 68 | }); |
| 69 | |
| 70 | test('Python packaging needs a note, while Python test files do not', () => { |
| 71 | const packages = [{ name: '@composio/core', directory: 'ts/packages/core', private: false }]; |
| 72 | expect(missingReleaseNotes(['python/setup.py'], [], packages)).toEqual(['@composio/python-sdk']); |
| 73 | expect( |
| 74 | missingReleaseNotes( |
| 75 | [ |
| 76 | 'python/composio/integration_test/test_tools.py', |
| 77 | 'python/composio/core/test_models.py', |
| 78 | 'python/composio/core/models_test.py', |
| 79 | ], |
| 80 | [], |
| 81 | packages |
| 82 | ) |
| 83 | ).toEqual([]); |
| 84 | }); |