Skip to content

fix(sap-smartedit): set ContentPage url from label and homepage flag - #1155

Open
pritesh-jain-cstk wants to merge 2 commits into
contentstack:feature/sap-smarteditfrom
pritesh-jain-cstk:bugfix/sap-contentpage-url
Open

pritesh-jain-cstk wants to merge 2 commits into
contentstack:feature/sap-smarteditfrom
pritesh-jain-cstk:bugfix/sap-contentpage-url

Conversation

@pritesh-jain-cstk

@pritesh-jain-cstk pritesh-jain-cstk commented Nov 2, 2026 •

Copy link
Copy Markdown

What

SAP ContentPage entries get a url. Every content type has a mandatory url field, but ContentPage never filled it: SAP keeps the route in label and marks the homepage with homepage. With no url, a storefront that looks pages up by url (the Contentstack Spartacus connector) finds none of them.

createEntry now sets the url for ContentPage:

SAP row url
homepage = true (any case, e.g. TRUE) /
no homepage column and label = homepage (SAP's default homepage label; HAC exports often omit the flag) /
label = /faq /faq
label = shipping /shipping
no label, not the homepage no url (nothing invented)
later partial UPDATE row without a label url already set is kept

Other types are untouched.

Why

Found in an end-to-end run SAP SmartEdit → migration-v2 → Contentstack → Spartacus (Jira DX-30753, gap G27). Before: 0 of 5 pages had a url.

Testing

  • 9 unit tests in sap-smartedit.service.test.ts (2 new fixtures); 6 of them fail without the change.
  • api suite: 947/947 pass.
  • v2's own SAP datasets (sample-export, edge-cases, medium-500, realistic-customer, 5 MB / 600-page export): every page with a label gets a url, no duplicates; sample-export's homepage now gets /.
  • Live v2 UI run on a test stack (5-page OCC export of electronics-spa): 219 entries; /, /faq, /contact, /terms-and-conditions, /help; scripts/reconcile-sap.ts PASSED.

Not covered

SAP page variations that share one label (restriction-based) get the same url; import still works (url is not unique), but telling them apart belongs with restrictions support.

Independent of the companion PR for nav labels (G28); either can merge alone.

🤖 Generated with Claude Code

Re-verified 2026-11-05

Re-run on this PR's head by an independent verification pass (spot-checked by re-running). Only what was run is listed as verified.

Ran on head 2d5dac38, api/: npx vitest run 947/947 (90 files); sap-smartedit.service.test.ts 87/87. Correction: with the service reverted to the base, 8 of the new tests fail, not 6. tsc --noEmit 58 errors, identical on feature/sap-smartedit. Merges cleanly with #1156.

Branch state: the base feature/sap-smartedit is 9 commits behind main. CI security-sca is failing (log not yet read).

Not verified: the dataset sweep; the live v2 UI run and reconcile-sap.ts; lint.

PriteshJain and others added 2 commits November 1, 2026 21:53
Every migrated SAP ContentPage had an empty url: each content type gets a
mandatory url field, but ContentPage carries its route in label and the
homepage flag. Storefronts that look pages up by url found none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ny case

Exports without a homepage column (HAC exports often omit it) now give the
page labelled homepage the root url, SAP's default homepage label. The
homepage flag is read in any case, like the rest of the connector's booleans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pritesh-jain-cstk
pritesh-jain-cstk requested a review from a team November 2, 2026 13:16
@snyk-io

snyk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants