Skip to content

feat: add dx-sap-spartacus-import skill (DX-32793) - #38

Merged
timbenniks-contentstack merged 1 commit into
nextfrom
feat/sap-spartacus-import-skill-main
Nov 17, 2026
Merged

timbenniks-contentstack merged 1 commit into
nextfrom
feat/sap-spartacus-import-skill-main

Conversation

@vaishnavi-kedar-cstk

@vaishnavi-kedar-cstk vaishnavi-kedar-cstk commented Nov 17, 2026 •

Copy link
Copy Markdown

Base

One commit on next. It's the same change as #37 (closed), rebased onto next after this PR's base moved from main.

What

A new action skill, dx-sap-spartacus-import. It imports the CMS content of a running SAP Commerce Cloud (Spartacus) storefront into a Contentstack stack, in the model @contentstack/contentstack-spartacus-connector reads. Optionally, it sets up the SAP Commerce Cloud marketplace app so editors pick carousel products from SAP. Jira: DX-32793.

The pipeline:

  1. Extract the site over OCC.
  2. Resolve navigation.
  3. Map it onto the connector's starter-pack content types.
  4. Gate 1: unknown component types need a mapping decision.
  5. Gate 2: a summary of everything that will be written, plus a check against the installed starter pack.
  6. SAP Commerce Cloud app (optional): install and configure the app once, then find its Product field.
  7. Seed (idempotent, keyed by sap_uid, url and title). When the app is set up, this adds the sap_products picker field to the carousel and fills it.
  8. Publish.
  9. Verify: a round trip against OCC and a Delivery API read.
  10. Optional per-locale localization.

Origin

This is my spartacus-content-modelling-agent, packaged for this bundle. It supersedes #35, which packaged an earlier version of the agent. I kept that PR's public-bundle changes:

  • OCC TLS is verified by default (OCC_INSECURE_TLS=1 is an explicit opt-in).
  • No hardcoded backend.
  • The starter pack is read from the installed connector.
  • Content pages map to landing_page.
  • Gate 2 checks the installed pack.

It also adds what the agent gained after #35 was cut.

SAP Commerce Cloud product picker (scripts/marketplace-app/, references/sap-commerce-app.md):

  • Installs the app and configures it exactly once, through the user's csdx auth:login --oauth session (a management token can't install apps). Writing the config a second time breaks the install on the app's server (HTTP 414), so re-runs only check an existing install. --reinstall-app repairs a broken one.
  • Seeds sap_products with the same value the picker saves: code + name, which stays under the 20 KB JSON-field limit.
  • Agent procedure: check the picker in the browser, repair it at most twice, then let the user choose between fixing it and use_products.py, which falls back to the plain products SKU list.

Auth: every stage writes with CS_MANAGEMENT_TOKEN, or with the user's csdx login when no token is set (CS_AUTH=auto|token|csdx). The csdx login refreshes the OAuth token once after a 401.

Live Preview: the environment gets a URL for every locale (CS_PREVIEW_URL).

Changes for a public bundle beyond #35:

  • The picker turns on from configuration, not a site name. --carousel-field auto uses sap_products only when SAP_APP_API_BASE_URL, SAP_APP_BASE_SITE and SAP_APP_BACKOFFICE_URL are exported. Otherwise carousels keep products. The original hardcoded electronics-spa and its demo SAP server.
  • No TLS bypass on the picker path. Product names come from the app's SAP server with TLS verified. The OCC fallback follows OCC_INSECURE_TLS.
  • Bug fix: --inventory without OCC_BASE_URL no longer crashes at nav-resolve. Nav-resolve is skipped when the inventory already has resolved navigation. Writes and --locales still require an OCC base.

Files

  • skills/dx-sap-spartacus-import/:
    • SKILL.md
    • references/pipeline.md, references/mapping-profile.md, references/sap-commerce-app.md
    • scripts/ (Python 3.9+ stdlib; Node only for cs-seed/csdx_auth.cjs and marketplace-app/sap_app.cjs)
  • docs/skills/dx-sap-spartacus-import.md, plus a row in docs/skills/index.md, and the skill count bumped to 34 in docs/skills/index.md and docs/README.md
  • A row in README.md
  • evals/routing-dx-sap-spartacus-import-{1,2}: each loads the skill and checks that migration-companion is skipped

Testing

  • node scripts/validate.mjs: 34 skills, 7 manifests valid (version 0.4.1).
  • Every script compiles, and --help runs, so the imports resolve across cs-seed/, marketplace-app/ and verify/.
  • Offline dry runs from the electronics-spa inventory against the connector starter pack:
    • Planned 6 pages, 112 entries (32 components) and 37 assets. No unknown typeCodes. The starter-pack check passes.
    • Without SAP_APP_*, carousels go into products.
    • With SAP_APP_*, both carousels become sap_products placeholders (11 and 7 SKUs), and the pack check allows the field the seed adds.
  • The picker stage and the csdx auth were run end to end against live stacks in the source repo before packaging: install, configure once, the field and picker working, the reinstall repair and the products fallback.

Not run yet:

  • A full seed, publish and verify of this packaged copy against a fresh stack.
  • Routing evals.
  • snyk-agent-scan (CI runs it).

🤖 Generated with Claude Code

@vaishnavi-kedar-cstk
vaishnavi-kedar-cstk requested review from a team as code owners November 17, 2026 10:06
@snyk-io

snyk-io Bot commented Nov 17, 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)
✅ Code Security 0 0 0 0 0 issues

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

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@vaishnavi-kedar-cstk
vaishnavi-kedar-cstk changed the base branch from main to next November 17, 2026 10:23
Imports a running SAP Commerce Cloud (Spartacus) storefront's CMS content
over OCC into a Contentstack stack, shaped for
@contentstack/contentstack-spartacus-connector: extract, nav-resolve,
model, two approval gates with a starter-pack check, seed, publish,
round-trip and Delivery API verify, optional localization.

Builds on the public-bundle packaging from #35 and adds what the
spartacus-content-modelling-agent gained since:
- optional SAP Commerce Cloud marketplace app stage: installs and
  configures the app once, adds the sap_products picker field to the
  carousel and fills it, with a verify / repair / fallback procedure
- writes with CS_MANAGEMENT_TOKEN or the user's csdx OAuth login
- environment Live Preview URLs per locale

Co-authored-by: Tim Benniks <tim.benniks@contentstack.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vaishnavi-kedar-cstk
vaishnavi-kedar-cstk force-pushed the feat/sap-spartacus-import-skill-main branch from e31b414 to 627a1ac Compare November 17, 2026 10:27
@vaishnavi-kedar-cstk vaishnavi-kedar-cstk changed the title feat: add dx-sap-spartacus-import skill (DX-32793) [main] feat: add dx-sap-spartacus-import skill (DX-32793) Nov 17, 2026
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@timbenniks-contentstack
timbenniks-contentstack merged commit 7943813 into next Nov 17, 2026
8 checks passed
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.

3 participants