Repository navigation
Conversation
…0314)
cm:branches:diff --format detailed-text reported content type option
changes (e.g. options.is_page) as "Unknown Field" with Field Path "N/A".
The compare API returns these as { path: "options.<key>", value } with no
uid or display_name; only title, description and options.singleton were
special-cased, so every other option fell through to the schema-field
path. The CSV writer also hard-coded Field Path to "N/A" for every row.
- Handle any options.* difference as its own entry, labelled
"Options → <key>", with its path and old/new values (modified, added
and deleted cases)
- Write the real diff path to the CSV Field Path column instead of "N/A"
- Show actual old/new values for content type level changes (options,
title, description) instead of the item's uid
- getFieldDisplayName falls back to the path before "Unknown Field"
- Add unit tests for option changes, field paths and singleton values
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 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:
✅ BUILD PASSED - All security checks passed |
…314) options.singleton had its own special case that labelled the change "Single"/"Multiple" with an empty path. Route it through the generic options.* handling so it is reported as "Options → singleton" with path options.singleton and its old/new values, like every other option. - Remove options.singleton from the title/description special case - Replace the synthetic singleton test with one driven by the API shape - Add a test for content type rename values (the remaining special case) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔒 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:
✅ BUILD PASSED - All security checks passed |
Summary
Fixes DX-30314:
csdx cm:branches:diff --format detailed-textreported content type option changes (e.g.options.is_page) as "Unknown Field" with Field Path "N/A", so customers could not tell what changed. The change itself was detected and merges correctly; only the labelling was wrong.Root cause
The branch compare API returns content type option differences as
{ "path": "options.is_page", "value": true }, with nouidordisplay_name.prepareModifiedDiff()only special-casedtitle,descriptionandoptions.singleton. Every other option fell through to the schema-field path, andgetFieldDisplayName()found no name, so it returned"Unknown Field".addCSVRow()hard-codedfieldPath: 'N/A'for every CSV row, so the Field Path column was never filled.Changes
branch-diff-utility.ts: handle anyoptions.*difference as its own entry labelledOptions → <key>, with its path and old/new values. Covers the modified, added (compare only) and deleted (base only) cases.options.singletonno longer has its own special case (it was labelled "Single"/"Multiple" with an empty path). It now goes through the same handling and shows asOptions → singleton.csv-utility.ts:addCSVRow()now writes the real diff path (falling back to uid, thenN/A)getFieldDisplayName()falls back to the path before"Unknown Field"interfaces/index.ts: optionalfieldPathonAddCSVRowParamsBefore / after
Same command against a test stack, where the compare branch only flips
options.is_pagefromfalsetotrue:Console output changes from
± "Unknown Field" field fieldto± "Options → is_page" (options.is_page) option.Testing
@contentstack/cli@2.0.2, then re-ran the same command with this branch linkedtest/unit/utils/csv-utility.test.ts(option changes incl. added option, field paths, singleton values). They fail on the old code and pass with the fixtsc --noEmitclean; eslint shows no errors on the changed filesNotes for reviewers
pnpm testin this package fails atpretest(tsc -p test) because of missing mocha globals in three test files this PR doesn't touch (delete.test.ts,list.test.ts,create-merge-scripts.test.ts). Tests were run with mocha directly.apps-cli,asset-management); this PR changes no dependencies. Talisman passed.cm:branches:diffissues found while testing (swapped source/target on added/deleted rows, CSV not escaping quotes, field paths likeschema[2],--csv-pathwith a file name creating a folder, etc.) will be raised separately.🤖 Generated with Claude Code