Fix never-converging job diff on reordered webhook notifications - #6060
Open
radakam wants to merge 3 commits into
Open
Fix never-converging job diff on reordered webhook notifications#6060radakam wants to merge 3 commits into
radakam wants to merge 3 commits into
Conversation
The Jobs API treats webhook_notifications.on_* lists as unordered sets and may return them in a different order than submitted. The direct engine compared these lists positionally (structdiff with no key func), so a stable server-side reordering produced a phantom diff that "bundle plan"/"bundle deploy" could never converge past. Add the job-, task-, and for_each-task-level webhook_notifications.on_* paths to ResourceJob.KeyedSlices(), keyed by id, so the diff is order-insensitive. This matches the existing pattern for depends_on.
denik
reviewed
Jul 24, 2026
Deploys a job with webhook_notifications.on_* destinations, then uses edit_resource.py to reorder the remote lists (simulating the Jobs API returning them in a different order) and asserts bundle plan reports 0 to change. Without the KeyedSlices fix this plan shows 1 to change.
Collaborator
Integration test reportCommit: 0078d4b
10 interesting tests: 4 RECOVERED, 4 SKIP, 2 flaky
Top 18 slowest tests (at least 2 minutes):
|
radakam
marked this pull request as ready for review
July 24, 2026 11:04
Contributor
Approval status: pending
|
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.
Summary
The Jobs API treats
webhook_notifications.on_*destination lists as unordered sets and may return them in a different order than submitted. The direct engine diffed these lists positionally (structdiffwith no key func), so a stable server-side reorder produced a phantom diff thatbundle plan/bundle deploycould never converge past (1 to changeforever). This reproduces afterbundle deployment migrate, and on any direct deploy where the remote returns a different-but-valid permutation.Fix
Register the job-, task-, and
for_each_task-levelwebhook_notifications.on_*paths inResourceJob.KeyedSlices(), keyed byid, so the lists are compared as sets rather than by index — the same pattern already used fordepends_on.Tests
jobs/webhook-reorder-remote: deploys a job, reorders the remote lists viaedit_resource.py, and assertsbundle planreports0 to change. Verified it fails (1 to change) with the fix removed.for_each_taskwebhook paths.