Repository navigation
feat(dx-sap-spartacus-import): SAP product picker for B2B powertools sites, picker preflight - #39
vaishnavi-kedar-cstk wants to merge 3 commits into
Conversation
…sites, picker preflight The SAP Commerce Cloud app picker already turned on from the SAP_APP_* configuration for any site; this makes the powertools (B2B) case explicit and safe, from a run that set it up end to end on a fresh powertools-spa stack. - New marketplace-app/sap_preflight.py, run at gate 2 when carousels go into sap_products: checks the picker's SAP server with TLS verified (trusted certificate, base site present, product search returns products without a login, carousel codes found). The dry run prints it; a write stops with exit code 4 before the app is installed or anything is written. Each failure names its fix (e.g. a full powertoolsIndex for an empty search). - references/sap-commerce-app.md: which base site per demo (electronics, powertools-spa), same-catalog rule, the preflight table. - localize.py: retry a failed entry update once (transient 422 seen on global_slots) and exit 3 when something still failed; the orchestrator records that locale as warn and names it in the final banner instead of marking it ok. - orchestrate.py: --carousel-field help no longer says auto means electronics-spa. - SKILL.md, pipeline.md, docs page: powertools picker inputs, exit code 4, an example. - evals/routing-dx-sap-spartacus-import-3: a powertools picker prompt loads the skill. 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
✅ BUILD PASSED - All security checks passed |
…tial errors, key handling An agent following SKILL.md imported powertools with the picker into a fresh stack (exit 0, 44 min, all stages ok) and listed where the skill was unclear or didn't match the scripts. - Gate 2 names the target stack and says whether it's empty (new cs-seed/stack_info.py, read-only), counts the full starter pack it imports (17 types, not the 13 the entries use), and splits components / navigation / pages. The app line shows the base site on its own. - Gate 2 warns when the installed connector reads only `products` (connector 0.1.0): picker carousels render empty until the connector release that reads sap_products. - Seed and publish exit 3 on per-item errors (recorded as warn, named in the final summary) instead of reporting ok; content-type import errors are always printed. Publish ends with a totals line and publishes in CS_MASTER_LOCALE instead of a hard-coded en-us. - cda_read: with no CS_DELIVERY_TOKEN (always on a fresh stack) it exits 5 with what to do; the manifest note and the final summary say so. - sap_app.py passes the stack API key to node through the environment, not argv (ps). - The picker-preflight manifest note keeps only the check results, not the server URL. - SKILL.md: required vs optional env vars, `curl -k` only with OCC_INSECURE_TLS=1, --locales and --run-dir in the dry run too, run the ~45-minute write in the background, the delivery check on a fresh stack, warn statuses, and asking the user to check the picker when there's no browser. References: use_products --starter-pack, warn and exit-5 notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
…led connector renders it
--carousel-field auto now picks sap_products only when the SAP_APP_* settings are exported
AND the installed connector reads sap_products; otherwise carousels keep the plain
`products` list and gate 2 says why ("SAP product picker not set up: the installed
connector (0.1.0) reads only `products`").
The version can't decide it: a build of the connector repo's main branch also says 0.1.0.
So the orchestrator checks the connector's code: the installed bundle (node_modules, a
`file:` tarball or an npm link), else a connector checkout's dist/ build or src/ (specs
excluded) when CONNECTOR_STARTER_PACK points into it.
Tested with dry runs: npm 0.1.0 + picker settings -> products with the explanation; a
connector built from main -> sap_products (preflight 17/17); CONNECTOR_STARTER_PACK at a
connector checkout -> sap_products (14/14); npm 0.1.0 + --carousel-field sap_products ->
sap_products with the empty-carousel warning; no picker settings -> products.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
Base
One commit on
next. Follows #38 (dx-sap-spartacus-import).What
The SAP Commerce Cloud app's product picker already turned on from the
SAP_APP_*configuration for any site. This makes the powertools (B2B) case explicit and safe, from a run that set the picker up end to end on a freshpowertools-spastack.Picker preflight (
scripts/marketplace-app/sap_preflight.py, new). With carousels going intosap_products, gate 2 checks the server the picker will search, with TLS verified:CN=hybris)SAP_APP_BASE_SITEisn't a base site thereThe dry run prints the result. A write stops with exit code 4 before the app is installed or anything is written, and each failure names its fix. All four failures were real steps on the way to the powertools picker: the old demo server's certificate, a missing
powertools-spa, then an empty index.Localize. A failed entry update is retried once. A transient 422 on
global_slots(site_links) happened once and passed on retry. If something still fails,localize.pyexits 3, and the orchestrator records that locale aswarnand names it in the final banner. Before this, the locale was markedokeven with a failed entry.Smaller fixes:
--carousel-fieldhelp saidautomeanselectronics-spa; it's theSAP_APP_*configuration.references/sap-commerce-app.mdgains a base-site table (electronics →electronics, powertools →powertools-spa), the same-catalog rule and the preflight table.SKILL.md,pipeline.mdand the docs page cover the powertools picker inputs, exit code 4 and an example.evals/routing-dx-sap-spartacus-import-3: a powertools picker prompt loads the skill.Testing
node scripts/validate.mjs: 34 skills, 7 manifests valid. All scripts compile.powertools-spapasses (252 products, 14/14 codes).electronicspasses (221 products, 17/17 codes).site, exit 4.tls, exit 4.picker-preflight: failandgate2: blocked, and no app, seed or publish stage.localize.pyafter this change: Japanese and German re-runs on that stack, 0 errors.powertools-spaSAP storefront … with German, Japanese and Chinese", picker on) and the settings in the shell. Exit 0 in 44 minutes:picker-preflight: pass,sap-app: ok,seed: ok,publish: ok,verify-roundtrip: pass(23/23 components, 2/2 nav trees), and de/ja/zhok.verify-cda: check, as expected: there's no delivery token on a fresh stack.Second commit: fixes from the agent-prompt run
cs-seed/stack_info.py, read-only);products(0.1.0), gate 2 warns that its carousels render empty.ok:warnand named in the final summary;CS_MASTER_LOCALE.CS_DELIVERY_TOKEN(always the case on a fresh stack),cda_read.pyexits 5 and says what to do. The manifest note and the summary repeat it.sap_app.pypasses the stack API key to node through the environment, not argv, where it would be visible inps. The preflight's manifest note keeps only the check results.curl -konly withOCC_INSECURE_TLS=1;--locales/--run-dirin the dry run too;warnstatuses;Re-test of the second commit (on the agent-flow stack, picker on):
sap_products.validate.mjspasses and all scripts compile.Third commit: the picker follows the installed connector
--carousel-field autonow chooses the picker only when theSAP_APP_*settings are exported and the installed connector readssap_products. Otherwise the carousels keep the plainproductslist, and gate 2 says why.products, so the import seedsproducts.mainbranch (a build, afile:tarball, an npm link, or a checkout viaCONNECTOR_STARTER_PACK) readssap_products, so the import seeds the picker.The version can't tell them apart (both say 0.1.0), so the orchestrator checks the connector's code.
Dry-run results:
products, "SAP product picker not set up: the installed connector (0.1.0) reads onlyproducts"sap_products, preflight 17/17CONNECTOR_STARTER_PACKsap_products, 14/14--carousel-field sap_productssap_products, with the empty-carousel warningproductsNot covered: the seed's speed. A picker re-run on an existing stack took about 95 minutes, at about one Management API call per second. Worth its own change.
🤖 Generated with Claude Code