DX | 27-07-2026 | Release | CLI-Plugins Beta#313
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
back merge
feat: enhance AM with asset publishing
fix: add global fields FVRs in export
…lish call sites
- operation-executor.ts: addHeader('api_version', '3.2') on entry and asset instances before SINGLE-mode publish/unpublish
- base-class.ts: replace conditional stackHeaders mutation in publish-assets with unconditional addHeader; add addHeader to publish-entries chain
- create-stack.ts: add api_version: '3.2' to scheduleEntryAction axios headers (raw-axios path, no SDK)
- assets.ts: remove now-dead additionalInfo: { api_version: '3.2' } — base-class owns the header unconditionally
- .talismanrc: whitelist create-stack.ts false-positive (api_key: apiKey is a variable ref, not a secret)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
api_version 3.2 is now hardcoded via addHeader() at the call site (DX-9754) so the flag is no longer needed on bulk-entries. - bulk-entries.ts: remove --api-version flag registration - messages/index.ts: remove API_VERSION constant (TAXONOMY_API_VERSION kept for bulk-taxonomies which still exposes the flag) - config-builder.ts: make apiVersion conditional on flag presence so the validateConfig() check only fires when bulk-taxonomies provides the flag - bulk-entries.test.ts: remove test asserting api-version flag presence - config-builder.test.ts: update default-values expectation to apiVersion: undefined Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…der on publish/unpublish
addHeader() was missing from the sinon mock causing 15 test failures after
DX-9754 introduced .addHeader('api_version', '3.2') calls in the executor.
- Add addHeader: sandbox.stub().returnsThis() to mockStack so the SDK
chaining resolves correctly
- Assert addHeader('api_version', '3.2') is called in all four cases:
entry publish, entry unpublish, asset publish, asset unpublish
Result: 839 passing, 0 failing (was 824 passing, 15 failing)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…triggers false positive)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…X-9770] Fix toolchain/config/stale-fixture drift (Node 24, ESLint 10, ts-node/mocha) that broke unit suites across several packages -- these were tooling issues, not product bugs: - import: add missing test/tsconfig.json (pretest TS5057) -- 1726 passing - branches: fix test/tsconfig (TS6059), auth-stub command tests, regenerate stale diff/merge fixtures, stub process.exit in collectMergeSettings -- 123 passing - seed: rewrite suite against current SDK/HttpClient impl + resolveJsonModule -- 33 passing - external-migrate: fix 16 lint errors (ignore lib/, idiomatic rule options, optional catch bindings) -- lint clean, 42 passing - variants: fix ESM/JSON toolchain, fancy/spy test harness, auth stubs, mock config -- 32/38 passing (6 known-remaining, see ticket) - root: add lint script consistent with cli No product/runtime source changed except 3 behavior-preserving catch bindings in external-migrate. The ESLint flat-config migration (~10 packages) and the 6 remaining variants integration failures are tracked as out-of-scope follow-ups. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…validation Taxonomy: - Drop --api-version flag from bulk-taxonomies; api_version 3.2 is now hardcoded via addHeader() on the taxonomy SDK instance, matching the same per-call pattern used for entries and assets - Remove DEFAULT_TAXONOMY_API_VERSION constant and apiVersion param chain from TaxonomyService — branch is now the direct second param - Remove TAXONOMY_API_VERSION message constant include-variants: - Remove broken validation that blocked --include-variants whenever --api-version was absent; the guard is redundant now that 3.2 is hardcoded on both BULK and SINGLE paths config-builder: - Remove dead api-version flag validation from validateCommandFlags - Remove dead config.apiVersion validation from validateConfig - Remove the conditional apiVersion spread from buildConfig Tests updated to assert addHeader behaviour and drop variant/api-version coupling tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sets and publish-entries
addHeader was missing from the asset and entry stubs in the import
base-class test, causing both publish cases to throw at runtime after
DX-9754 added .addHeader('api_version', '3.2') to the SDK call chain.
- Add addHeader: sinon.stub().returnsThis() to asset() and entry() mocks
- Assert addHeader('api_version', '3.2') is called before publish in
both the publish-assets and publish-entries test cases
Result: 1719 passing, 0 failing (was 1717 passing, 2 failing)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve the high-severity Snyk SCA findings blocking CI (security-sca): - fast-uri 3.1.3 -> 3.1.4 (SNYK-JS-FASTURI-18021349, Interpretation Conflict) - ws 8.21.0 -> 8.21.1 (SNYK-JS-WS-17988732, resource allocation / CVE-2026-62389) Added scoped pnpm.overrides (range-limited so the unrelated ws@1.0.2 resolution is untouched) and refreshed the lockfile. Both are patch bumps of transitive deps. Note: inflight@1.0.6 (medium, SNYK-JS-INFLIGHT-6095116) has no published fix (package is abandoned); left as-is. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…tionConfig interfaces Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The eslint.config.js files in these packages crashed under ESLint 10 (flat config): they imported the deprecated eslint-config-oclif-typescript (v3, eslintrc-style) or referenced removed @typescript-eslint rules (quotes/type-annotation-spacing/ban-ts-ignore) and unloaded plugins (node/*, unicorn/*), so `lint` never actually ran. Standardised all 10 on a valid flat config (typescript-eslint recommended + package rules; unicorn/node registered so pre-existing inline eslint-disable directives resolve). Packages: apps-cli, audit, branches, cli-tsgen, content-type, export, export-to-csv, import, import-setup, query-export. Because lint had been crashing, fixing the configs surfaced ~1000 pre-existing source lint issues (mostly prefer-const + no-unused-vars). These were never enforced before, so the debt-revealing rules are set to 'warn' (kept visible, non-blocking); a follow-up ticket tracks cleaning them. There is no lint gate in CI, so this changes no CI outcome. No product source changed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…ypes Both types only existed to give a typed surface for publish/unpublish after casting through `as any`. Since the instance is already any, calling directly removes the unnecessary intermediate cast and the apiVersion?: string param that modelled the SDK signature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…orkflow [DX-9770] Make cli-plugins consistent with cli-core (separate test and lint): - Decouple: remove the `posttest` lint hooks from all packages so `npm test` runs tests only (npm's posttest was auto-running lint after every test). - Uniform lint command `eslint "src/**/*.ts"` across all 18 TS packages (was three variants: `eslint .`, `eslint . --ext .ts`, `eslint src/**/*.ts`). - Add a `lint` script to the 5 TS packages that lacked one (bootstrap, cli-cm-regex-validate, migration, seed, variants) + a flat config for variants. - Drop `--fix` from cli-tsgen's lint script so lint checks rather than mutates. - Add .github/workflows/lint.yml (mirrors cli-core's) as a dedicated PR gate running `pnpm run lint`. All 18 TS packages now lint with 0 errors (warnings only; cleanup tracked in DX-9771). No product source changed. The two JS-only packages (bulk-publish, migrate-rte) still need a JS lint setup and are left for the test-runner normalization follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…ulk payload prepareAssetBulkPayload was deriving locales from items[0].publish_details, which only contains the locale of the first item (always en-us when multiple locales are passed). Since fetchAssets creates one item per asset per locale, the ar (or any non-first) locale was silently dropped from the Bulk API payload. Also fixes duplicate asset UIDs: items had N-assets × M-locales entries, so the assets array contained each UID repeated M times. Now deduplicated by UID. Fix mirrors prepareEntryBulkPayload which already used Array.from(new Set(...)) for locales correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l [DX-9770] Address review feedback: keep all overrides in pnpm-workspace.yaml for consistency, instead of package.json `pnpm.overrides`. - Move the fast-uri and ws overrides into pnpm-workspace.yaml. - Bump the existing `fast-uri` override 3.1.3 -> 3.1.4: 3.1.3 is the vulnerable version (SNYK-JS-FASTURI-18021349) this PR is fixing, so the workspace pin is updated to the patched release. - Add `ws: 8.21.1` (SNYK-JS-WS-17988732). - Remove the now-redundant `pnpm.overrides` block from package.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
test(cli-plugins): repair failing unit test suites across packages [DX-9770]
…sertions Covers all four publish/unpublish paths (entry publish, entry unpublish, asset publish via sys_assets, asset unpublish via sys_assets) and verifies api_version: '3.2' is present in headers on every call. Also asserts branch header inclusion and omission. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… CI [DX-9770] Post-merge consistency pass over the plugin test suites and CI: - Scope every `test` to the unit suite (test/unit/**); stop the default run from pulling integration tests (import). Remove failure-masking that made suites always report green (branches `|| exit 0`, clone grep + `|| true`). - Decouple lint from test: drop asset-management `posttest: npm run lint` (lint runs via lint.yml, matching the cli-core convention). - Rewrite unit-test.yml into a package-wise matrix (one check per plugin, fail-fast: false) so a failure is attributed to its package at a glance. - Standardize the base test dir to `test/`: rename tests/ -> test/ for cli-tsgen and content-type (jest configs + scripts updated). - Add tsgen unit tests for helper.ts (22 tests, 100% line coverage) and fix tsgen-integration-test.yml to call `test:integration` (it was running unit). - Complete the external-migrate vitest -> mocha/chai migration cleanup: remove vitest.config.ts and the dead jest `test:integration` script. - Fix pre-existing v2 test bugs surfaced by the full run: import-setup login-handler `logStub` reference; seed importer jest.mock for @contentstack/cli-cm-import; variants .mocharc `--no-experimental-strip-types` so ts-node handles JSON imports under Node 24. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
Revert unit-test.yml from the package-wise matrix (one check per plugin) back to a single consolidated run, to avoid ~20 checks per PR. Keeps --no-bail so every package still runs even when one fails and pnpm prints a per-package summary, so failures stay easy to locate in the one log. No exclusions needed anymore (tsgen has unit tests; external-migrate is on mocha). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…eed babel dep [DX-9770] - Remove dead `test:integration` scripts that pointed at nonexistent files (branches, query-export). - Remove orphaned integration harnesses not wired to any workflow: export/import `test:integration`(`:report`) scripts + `run.test.js` + `test/integration/**`. - bootstrap: drop the one real e2e test (live GitHub clone); fix the cross-test sinon stub leak (per-method `sandbox.stub(proto, 'method')` instead of whole-prototype stub + Object.assign, which left a phantom `getAllRepos` stub behind `restore()`); drop `nyc` (its spawn-wrap threw "expand is not a function" under Node 24 when tests stub `child_process.spawn`); make `test` invoke mocha directly (`pretest` compiles), removing the `test:e2e` indirection and the `|| exit 0` mask so the suite actually gates. 66 tests, all unit in nature. - seed: declare `@babel/preset-env` as a devDependency — its jest config uses it to transform `uuid`, but it was only resolving via another package's hoisted copy (removed during this cleanup). - Sync pnpm-lock.yaml with these package.json changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…le [DX-9770] Update the pnpm-lock.yaml checksum and allowlist the migrated contentstack-cli-cm-regex-validate connect-stack.test.ts (fake `blt1234` test tokens) so the Talisman pre-commit scan passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replaces the bulk-array globalfields.json export with individual {uid}.json
files per global field, consistent with how content types are handled.
Export writes each global field to global_fields/{uid}.json instead of
collecting all into a single array file. Import and content-types modules
now use readGlobalFieldSchemas to scan the directory and read all per-file
schemas. The audit base command is updated to use the same function when
loading global field schemas for cross-reference validation.
The globalfields.json fileName config values are retained for type
compatibility but are no longer read or written at runtime.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
apps-cli's `test` ran `nyc --extension .ts mocha`, but nyc's spawn-wrap throws "expand is not a function" in CI (Node 22) for apps-cli's tests that stub process.exit — corrupting the run and cascading into spurious 401 / "session timed out" failures (the tests themselves pass; v2-dev's green nyc run proves it). Run plain mocha (coverage isn't needed for the PR gate), matching the bootstrap fix. 61 tests passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…nfigs [DX-9770]
Unit-test CI (apps-cli):
- deploy/update tests read region + developerHubBaseUrl from ambient configHandler
at module load and built their nock mocks from it, so they only passed when a
prior package (old CI order) or local config had seeded a region. My single-run
unit-test.yml runs apps-cli early -> no seeded region -> nock URLs mismatched ->
real 401 ("session timed out"). Seed a complete region at module load so the
mocks are deterministic regardless of execution order. (Temp nock 'no match'
logger added to surface any residual escaping request in CI; removed once green.)
Lint CI (new lint.yml, never gated on v2-dev):
- asset-management + regex-validate eslint.config.js used eslintrc-style configs
(eslint-config-oclif-typescript / strict semi+spacing) that ESLint 10 flat config
rejects or that their own src violates. Replaced with the standard flat template
(debt as warnings), matching the other packages. All packages now lint clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
feat: force api_version 3.2 (NRP) on all entry/asset/taxonomy publish and unpublish
…lib [DX-9770] Root cause of the 12 apps-cli deploy/update CI failures: apps-cli's tests stub the SRC command classes (BaseCommand/Update/initMarketplaceSDK). oclif only loads commands from src (via ts-node in dev) when NO oclif.manifest.json exists; when a manifest is present it loads the compiled lib, so the src stubs never apply and the command makes a real developer-hub HTTP call -> 401 'session timed out'. The build script had been changed to `pnpm compile && oclif manifest && oclif readme`, which created the manifest during the CI build step; v2-dev's build was `tsc -b` (no manifest), which is why v2-dev stayed green. Reproduced locally: no manifest -> tests pass; manifest present -> tests fail. Fix: build = `pnpm compile` only. The manifest is still generated by prepack for publishing. Reverts the exploratory hermetic/diagnostic edits to the test files (not needed once the manifest cause was found). apps-cli: 61 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
Backmerge latest v2-dev (PR #304: bulk-operations api_version 3.2 hardening, external-migrate create-stack, taxonomy NRP header). Only conflict was .talismanrc — resolved by taking the union of both sides' allowlist entries (version '1.0'; refreshed the merged pnpm-lock.yaml checksum). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…st to mocha [DX-9770] The v2-dev backmerge (PR #304) added create-stack.test.ts written in vitest, but this branch converted external-migrate to mocha and removed the vitest dependency, so the file failed to compile ('Cannot find module vitest'). Rewrote its 6 scheduleEntryAction api_version:3.2 header tests using mocha/chai/sinon (stub axios.post + configHandler + authHandler), preserving PR #304's coverage. Refreshed the .talismanrc checksum for the rewritten file. external-migrate: 48 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…) [DX-9770]
makeSpaceDir() used `am-test-${Date.now()}`, which collided when two tests ran within
the same millisecond, so one test's asset index leaked into another's space dir. That
intermittently made resolveAssetsChunkedLocation find an index in the 'empty space' test,
skipping the empty-space branch and flaking expect(tickStub.callCount).to.equal(1)
(seen as 'expected +0 to equal 1'). Use fsReal.mkdtempSync for a guaranteed-unique dir.
Verified: 8/8 consecutive runs now 242 passing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NbgqgVDTDmh6c9LwDtMEf9
…json stubs, add per-uid file assertions across export/import/audit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dx 9770 v2 dev
feat(global-fields): switch to per-file export/import format
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
chore: fixed entry publish
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
No description provided.