CEXT-6834: Plan webhook upgrades from live state - #717
Open
iivvaannxx wants to merge 1 commit into
Open
iivvaannxx wants to merge 1 commit into
iivvaannxx wants to merge 1 commit into
Conversation
iivvaannxx
added this pull request to stack #718
October 2, 2026 10:07
🦋 Changeset detectedLatest commit: 96a5e91 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
9 of 11 tasks
iivvaannxx
marked this pull request as ready for review
October 2, 2026 10:10
iivvaannxx
force-pushed
the
CEXT-6834/webhooks-from-live-state
branch
from
October 2, 2026 10:29
5657a25 to
96a5e91
Compare
4 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Webhook upgrades now plan from what is subscribed in Commerce instead of diffing the baseline config against the target config.
planlists the webhooks in Commerce and maps them into the resolved config shape (toResolvedWebhookPayload). If the read fails, the plan is blocked withWEBHOOK_LIVE_READ_FAILED.__OW_NAMESPACE, the same check as CEXT-6770: Remove app-owned resources left behind by failed upgrades #711. The baseline check covers webhooks with an explicit URL. This needsappId, which is now onLifecycleContext.configuredValues). A successful upgrade resets this.changewhen the target adds the webhook or changes it compared with the baseline config, anddriftotherwise. A remove ischangewhen the baseline declares the webhook, anddriftwhen only ownership found it. For the baseline comparison, a field the target drops counts as changed.pruneStaleWebhooksis removed. The plan's remove operations find leftovers.fieldValuesEqualandisUnsetlive incommon/utils/values.ts, so events can use them too.Known trade-offs:
required: falseisn't stored, andbatch_orderis per batch.Related Issue
https://jira.corp.adobe.com/browse/CEXT-6834
Motivation and Context
Example: 1.0.0 is installed. 1.1.0 changes a webhook and fails after unsubscribing it. 1.1.0 is then redeployed with that change reverted. The baseline is still 1.0.0, and 1.0.0 matches the target, so the old planner saw nothing to do. The upgrade succeeded while the webhook was missing in Commerce. Reading live state removes the dependency on the baseline matching reality.
Stacked on #716.
How Has This Been Tested?
pnpm --filter @adobe/aio-commerce-lib-app test: 1342 passing.plan.test.tsis rewritten around live state. It covers: add, update and remove; the rule for fields the target leaves out, including the chain across failed attempts;envnarrowing and widening; ownership by baseline and by URL; operation order; the reason for each kind. Mutation checks: dropping the baseline evidence, labeling undeclared webhooks as drift, and hardcoding any of the three reasons each fail a test.webhooks.test.tscover the scenario above and the removal of a webhook the target dropped.pnpm typecheckand Biome are clean.Screenshots (if appropriate):
Not applicable.
Types of changes
Checklist: