feat(intsch): emit dpPreview=true on non-master workspaces (DPT-67)#552
feat(intsch): emit dpPreview=true on non-master workspaces (DPT-67)#552garibu wants to merge 3 commits into
Conversation
Adds workspace-driven QA mode for Delivery Promises: the Intsch client now appends `dpPreview=true` to product-search and facets requests whenever the current IO workspace is not `master`. Storefronts running QA in a workspace get DP activated end-to-end on the IS API without the store having to flip the persisted `deliveryPromisesEnabled` setting. Production traffic in `master` is untouched. - New `shouldInjectDPPreview(workspace)` helper centralizes the policy (`master` and undefined/empty values stay opted out). - `dpPreview` added to the IS API query keys allowlist so the param survives `filterByAllowedIntelligentSearchQueryKeys`. - Coverage for the helper and the allowlist behavior. Refs: https://vtex-dev.atlassian.net/browse/DPT-67 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
Tighten the comments added in the previous commit. Helper names and the PR description carry the rationale — inline blocks were repeating each other. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Enables Delivery Promises QA behavior for the modern intsch (Rust) Intelligent Search API calls by automatically emitting dpPreview=true whenever the request is running on a non-master VTEX IO workspace, while keeping master (production) traffic unchanged.
Changes:
- Added
dpPreviewto the Intelligent Search query-param allowlist so it survives request param filtering. - Introduced
shouldInjectDPPreview(workspace)helper and used it inproductSearch()andfacets()to conditionally injectdpPreview=true. - Added unit tests for the new helper and for allowlist behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| node/clients/intsch/utils.ts | Adds dpPreview to the allowlist and introduces shouldInjectDPPreview() to gate param injection by workspace. |
| node/clients/intsch/index.ts | Injects dpPreview=true into product-search and facets requests on non-master workspaces before allowlist filtering. |
| node/clients/intsch/utils.test.ts | Adds unit coverage for shouldInjectDPPreview() and verifies dpPreview is allowlisted. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…pace name Per review: a workspace can be non-master yet still production, so keying the QA override off the workspace name would leak dpPreview into real production traffic on named production workspaces. Gate on `context.production` instead — only non-production workspaces emit the param. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
dpPreview=trueautomatically on every workspace other thanmaster. Production traffic inmasteris unchanged.deliveryPromisesEnabledin order to validate DP end-to-end. The persisted store setting becomes a clean signal of production adoption.Changes
node/clients/intsch/utils.tsshouldInjectDPPreview(workspace)helper. Returnstruefor any workspace that is notmasterand not undefined/empty.dpPreviewadded toINTELLIGENT_SEARCH_PRODUCT_QUERY_KEYSso the param survivesfilterByAllowedIntelligentSearchQueryKeys.node/clients/intsch/index.tsproductSearch()andfacets()derivedpPreviewfromthis.context.workspaceand add it to the merged params before the allowlist filter.node/clients/intsch/utils.test.tsContext
This is the storefront half of DPT-67. The companion PRs:
dpPreviewquery param parsing, gatekeep, and APM activation-source label: https://github.com/vtex/sp-node/pull/486The
intelligent-search-api(TS legacy) was intentionally left out of scope — only the modernintsch(Rust) path receives the new behavior.Test plan
yarn test— 163 passing (3 unrelated skips), including the new helper specsyarn lint— clean (tsc --noEmit)masterdo not carrydpPreviewin the IS API querydpPreview=truedeliveryPromisesEnabled=falseonly fires in the non-master workspaceTicket
https://vtex-dev.atlassian.net/browse/DPT-67