Skip to content

fix(ci): order the re-pointed payment-method functions before the NONE data source deletes - #845

Merged
dmeiser merged 2 commits into
mainfrom
fm/KW-DEPLOY-768-FIX-1
Oct 27, 2026
Merged

dmeiser merged 2 commits into
mainfrom
fm/KW-DEPLOY-768-FIX-1

Conversation

@dmeiser

@dmeiser dmeiser commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Deploy Production has failed 13 runs in a row since the merge of #822; prod is frozen at the #813 build.

What was wrong

5f3e1a46 (PR #822, #750) deleted the payment_methods_none and filter_payment_methods_none aws_appsync_datasource resources and re-pointed three functions to the shared aws_appsync_datasource.none. Removing the blocks also removed the config edge ordering their destroys after those function updates, so OpenTofu walks the destroy nodes first and AWS refuses both calls:

Error: deleting AppSync Data Source ... Data source is still in use by functions

Not one of the planned in-place updates is attempted, so state never advances and every later merge replays the identical failure. The resolver-ordering guard did fire, but its hand-maintained target list had no payment-method entry, so it updated nine unrelated objects and left the blockers untouched.

What changed

Added the three re-pointed functions to the appsync-ensure-resolver-order.sh target list in both call sites, so their UpdateFunction calls land before the full apply reaches the destroys:

-t module.appsync.aws_appsync_function.inject_global_payment_methods
-t module.appsync.aws_appsync_function.set_owner_account_id_in_stash
-t module.appsync.aws_appsync_function.filter_payment_methods_by_access

Both data sources are type = "NONE", so re-binding a function between them is semantically inert and the function ids are unchanged — no resolver downtime. No tofu module config was touched.

Tests

tests/unit/test_ephemeral_deploy_resolver_parity.py previously checked only one resolver address. It now extracts every -t module.appsync.… target from each call site and asserts set equality, so the two lists cannot drift silently, plus an explicit check that the three new targets are present in both. Full unit suite passes at 100% coverage; shellcheck and the guards job tests pass.

…Sync ordering guard

PR #822 consolidated the two per-purpose NONE data sources into the shared
NoneDataSource and re-pointed inject_global_payment_methods,
set_owner_account_id_in_stash and filter_payment_methods_by_access. Removing
the data source blocks also removed the config edge that ordered their
destroys after the function updates, so the full apply destroys the
still-referenced data sources first and AWS refuses with "Data source is
still in use by functions". Add the three function targets to both
appsync-ensure-resolver-order.sh call sites and make the parity test assert
the full target set.
@dmeiser dmeiser added the no-release No release/version bump expected from this change label Oct 27, 2026
@dmeiser
dmeiser deployed to ephemeral October 27, 2026 01:48 — with GitHub Actions Active
@dmeiser
dmeiser merged commit f50768c into main Oct 27, 2026
12 checks passed
@dmeiser
dmeiser deleted the fm/KW-DEPLOY-768-FIX-1 branch October 27, 2026 02:58
@dmeiser
dmeiser deployed to ephemeral October 27, 2026 02:58 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
ephemeral — ddfacf63 Deployed Oct 27, 2026 by dmeiser via Tear down ephemeral environment for PR #333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release No release/version bump expected from this change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant