feat!: update to CMA.js v12 and drop support for Node < 22 [DX-780][DX-689]#3193
feat!: update to CMA.js v12 and drop support for Node < 22 [DX-780][DX-689]#3193Tyler Pina (tylerpina) wants to merge 18 commits intomainfrom
Conversation
7705cb7 to
29ade22
Compare
Changelist by BitoThis pull request implements the following key changes.
|
Impact Analysis by BitoInteraction DiagramsequenceDiagram
participant User as User
participant CLI as CLI
participant CreateMgmt as CreateManagementClient<br/>🔄 Updated | ●●○ Medium
participant TaxImp as TaxonomyImport<br/>🔄 Updated | ●●○ Medium
participant CMA as CMA Client<br/>🔄 Updated | ●●○ Medium
participant Conc as Concept
participant CS as ConceptScheme
User->>CLI: Run taxonomy import command
CLI->>CreateMgmt: Call createManagementClient
CreateMgmt->>CMA: Create client with legacy type
CMA-->>CreateMgmt: Return client
CreateMgmt-->>CLI: Return client
CLI->>TaxImp: Call taxonomyImport with client
TaxImp->>TaxImp: Process concepts list
TaxImp->>CMA: Call concept.update (changed from updatePut)
CMA->>Conc: Update concept in CMA API
Conc-->>CMA: Success response
CMA-->>TaxImp: Success
TaxImp->>TaxImp: Process conceptSchemes list
TaxImp->>CMA: Call conceptScheme.update (changed from updatePut)
CMA->>CS: Update conceptScheme in CMA API
CS-->>CMA: Success response
CMA-->>TaxImp: Success
TaxImp-->>CLI: Import complete
CLI-->>User: Command finished
This MR updates the Contentful CLI to use Node.js version 24 across GitHub workflows and .nvmrc, modifies taxonomy import API calls from updatePut to update for concepts and concept schemes, adds a legacy type parameter to management client creation, and simplifies the import path in cursor-paginate.ts. These changes enhance integration with the Contentful Management API and improve compatibility. No direct upstream/downstream impact detected in repository scan or cross-repo dependency analysis. Code Paths AnalyzedImpact: Flow: Direct Changes (Diff Files): Repository Impact: Cross-Repository Dependencies: Database/Caching Impact: API Contract Violations: Infrastructure Dependencies: Additional Insights: Testing RecommendationsFrontend Impact: Service Integration: Data Serialization: Privacy Compliance: Backward Compatibility: OAuth Functionality: Reliability Testing: Additional Insights: Analysis based on known dependency patterns and edges. Actual impact may vary. |
There was a problem hiding this comment.
Code Review Agent Run #f04b52
Actionable Suggestions - 2
-
.nvmrc - 1
- Node.js version mismatch in build config · Line 1-1
-
.github/workflows/build.yaml - 1
- Pkg targets mismatch CI Node version · Line 20-20
Review Details
-
Files reviewed - 10 · Commit Range:
6f17cc4..1faa775- .github/workflows/build.yaml
- .github/workflows/check.yaml
- .github/workflows/main.yaml
- .github/workflows/release.yaml
- .github/workflows/test-e2e.yaml
- .nvmrc
- lib/cmds/organization_cmds/taxonomy/taxonomy-import.ts
- lib/utils/contentful-clients.js
- lib/utils/cursor-pagninate.ts
- test/unit/cmds/organization_cmds/import.test.ts
-
Files skipped - 2
- package-lock.json - Reason: Filter setting
- package.json - Reason: Filter setting
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.
Documentation & Help
Code Review Agent Run #0cbcd5Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
0dc3aee
0dc3aee to
0d2966a
Compare
There was a problem hiding this comment.
Code Review Agent Run #6695ba
Actionable Suggestions - 1
-
.github/workflows/main.yaml - 1
- Secret availability issue on PRs · Line 8-9
Additional Suggestions - 1
-
.github/workflows/release.yaml - 1
-
Version Mismatch in Build Targets · Line 48-48The CI now uses Node.js 24, but the pkg build targets remain node22, which could lead to runtime incompatibilities in the standalone binaries if cross-compilation doesn't align properly.
-
Review Details
-
Files reviewed - 10 · Commit Range:
6f17cc4..0d2966a- .github/workflows/build.yaml
- .github/workflows/check.yaml
- .github/workflows/main.yaml
- .github/workflows/release.yaml
- .github/workflows/test-e2e.yaml
- .nvmrc
- lib/cmds/organization_cmds/taxonomy/taxonomy-import.ts
- lib/utils/contentful-clients.js
- lib/utils/cursor-pagninate.ts
- test/unit/cmds/organization_cmds/import.test.ts
-
Files skipped - 2
- package-lock.json - Reason: Filter setting
- package.json - Reason: Filter setting
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.
Documentation & Help
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…d CMA. - add concurrency rule to prevent double gha runs - migrate deep import of CursorPaginatedCollectionProp
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update engines.node to >=22 in package.json - Bump .nvmrc and all CI pipelines to Node 24 LTS - Pin contentful-management to ^12.2.0 (latest) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8b72ac4 to
54b01f8
Compare
Code Review Agent Run #2b7de7Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
node22-macos-x64 runs under Rosetta 2 on macos-15-arm64 CI runners, adding ~12s of cold-start overhead that exceeds the default 15s Jest timeout. 60s gives the binary enough runway without being unreasonable. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Code Review Agent Run #02431eActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
| Source | Requirement / Code Area | Status | Notes |
|---|---|---|---|
| DX-780, DX-689 | Bump contentful-management dependency to version 12 | ✅ Met | Dependency bumped to version 12 in package.json with adaptations for API changes in lib/cmds/organization_cmds/taxonomy/taxonomy-import.ts, lib/utils/contentful-clients.js, lib/utils/cursor-pagninate.ts, and tests in test/unit/cmds/organization_cmds/import.test.ts |
| DX-780, DX-689 | Update Node.js engine requirement to version 22 or higher in package.json | ✅ Met | Node.js engine requirement updated to ">=22" in package.json |
| DX-780, DX-689 | Update .nvmrc file to Node version 24 | ✅ Met | .nvmrc file updated from v18.18.0 to 24 |
| DX-780, DX-689 | Update CI pipelines to use Node version 24 | ✅ Met | CI pipelines updated to use Node version 24 in .github/workflows/build.yaml, .github/workflows/check.yaml, .github/workflows/release.yaml, and .github/workflows/test-e2e.yaml |
| taxonomy-import.ts, contentful-clients.js, cursor-pagninate.ts, import.test.ts | Code adaptations for CMA.js v12 compatibility including API method updates from updatePut to update in lib/cmds/organization_cmds/taxonomy/taxonomy-import.ts and test/unit/cmds/organization_cmds/import.test.ts, client creation modifications in lib/utils/contentful-clients.js, and import path changes in lib/utils/cursor-pagninate.ts | ⭕ Out of Scope | Code adaptations for CMA.js v12 compatibility including API method updates from updatePut to update in lib/cmds/organization_cmds/taxonomy/taxonomy-import.ts and test/unit/cmds/organization_cmds/import.test.ts, client creation modifications in lib/utils/contentful-clients.js, and import path changes in lib/utils/cursor-pagninate.ts |
| basics.test.js | Added jest timeout configuration to e2e tests in test/e2e/basics.test.js | ⭕ Out of Scope | Added jest timeout configuration to e2e tests in test/e2e/basics.test.js |
| main.yaml | Added pull request trigger to CI workflow in .github/workflows/main.yaml | ⭕ Out of Scope | Added pull request trigger to CI workflow in .github/workflows/main.yaml |
| "contentful-export": "^8.0.0", | ||
| "contentful-import": "10.0.0", | ||
| "contentful-management": "^12.2.0", | ||
| "contentful-migration": "^4.21.0", |
There was a problem hiding this comment.
Looks like we merged a PR to bump to v12 in migration, but it didn't release. Should we fix that release and then bump here?
There was a problem hiding this comment.
oh nice, yea that would complete these upgrades.
|
|
||
| const execa = require('execa') | ||
|
|
||
| jest.setTimeout(60000) |
There was a problem hiding this comment.
Was this needed due to flaky tests?
There was a problem hiding this comment.
yep, with the switch from pkg to yao-pkg, the latter for some reason takes longer to start up. It would teeter around the timeout limit, hence the increase.
|
/review |
There was a problem hiding this comment.
Code Review Agent Run #35b79c
Actionable Suggestions - 1
-
test/e2e/basics.test.js - 1
- jest global variable not defined in scope · Line 3-6
Review Details
-
Files reviewed - 11 · Commit Range:
044fd23..3510692- .github/workflows/build.yaml
- .github/workflows/check.yaml
- .github/workflows/main.yaml
- .github/workflows/release.yaml
- .github/workflows/test-e2e.yaml
- .nvmrc
- lib/cmds/organization_cmds/taxonomy/taxonomy-import.ts
- lib/utils/contentful-clients.js
- lib/utils/cursor-pagninate.ts
- test/e2e/basics.test.js
- test/unit/cmds/organization_cmds/import.test.ts
-
Files skipped - 2
- package-lock.json - Reason: Filter setting
- package.json - Reason: Filter setting
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.
Documentation & Help
Code Review Agent Run #628d32Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
https://contentful.atlassian.net/browse/DX-780
https://contentful.atlassian.net/browse/DX-689
Summary
Upgrades
contentful-managementto v12, drops support for Node < 22, and migrates binary packaging frompkgto@yao-pkg/pkg. Resolves DX-780 and DX-689.Description
contentful-managementfrom^11.39.0→^12.2.0contentful-batch-libsto^11.0.0,contentful-exportto^8.0.0, andcontentful-importto10.0.0(all CMA v12-aligned releases){ type: 'legacy' }as the second arg tocreateClient()to keep the legacy client interface intact across the codebaseCursorPaginatedCollectionPropfromcontentful-management/dist/typings/common-typesto the publiccontentful-managemententrypointconcept.updatePut()andconceptScheme.updatePut()withconcept.update()andconceptScheme.update()in the taxonomy-import commandpkgfor@yao-pkg/pkgfor building Linux/macOS/Windows executables (active fork with Node 22 target support)>=22and update allpkgbinary targets fromnode18-*tonode22-*axiosto^1.15.0to resolve a security vulnerabilityBREAKING CHANGE: Node < 22 is no longer supported. Consumers must
upgrade to Node >= 22 before upgrading to this version.
contentful-management has been upgraded to v12.
Summary by Bito
This pull request upgrades the Contentful CLI to contentful-management v12, updates the minimum Node.js version to 24, and makes necessary code changes for compatibility while enhancing CI workflows and updating tests to ensure reliability.
Detailed Changes