fix: scope API mapping cache entries to their domains - #2194
Open
Shubham-Padkonde wants to merge 1 commit into
Open
Shubham-Padkonde wants to merge 1 commit into
Shubham-Padkonde wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Issue #: Fixes #2134.
Description of changes:
The REST and WebSocket API mapping models both use
api_mappingas their resource name. When their mount paths match,RemoteStatereuses an existence result from the other domain because its cache key does not include the domain passed toresource_exists.After an existing REST mapping is checked, a new WebSocket mapping can therefore appear to exist. Planning then fails while reading deployment values for the new domain with
ValueError: Deployed values for resource does not exist: websocket_api_custom_domain. In the opposite order, an existing mapping can incorrectly appear to be missing.Include the domain name in API-mapping cache keys. Repeated checks within the same domain stay cached, and other resource keys are unchanged. Adds a release note and three regression cases: both existence-result orders, with exact underlying calls and repeated cache hits, plus planning a new WebSocket domain after an existing REST domain using real
RemoteStateand mocked AWS responses. All three fail on unmodified master; the planner test reproduces the reported exception exactly. All 111 planner tests pass after the fix.Validation: 1,400 tests passed and 27 skipped on Linux/Python 3.11.15 with pinned development requirements. Full
make prcheckpassed, including linting, documentation link checking and HTML build, and mypy (63 source files).No live AWS deployment or other Python/OS matrix was run. Implementation and validation were assisted by OpenAI Codex; no independent human review is claimed.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.