-
Notifications
You must be signed in to change notification settings - Fork 2.8k
refactor(aws): extract and restructure alias-handling logic to enable safe upcoming fixes #6021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: u-kai <[email protected]>
Signed-off-by: u-kai <[email protected]>
Signed-off-by: u-kai <[email protected]>
|
Hi @u-kai. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/ok-to-test |
Pull Request Test Coverage Report for Build 20164321325Details
💛 - Coveralls |
ivankatliarchuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thank you for taking a look. I don’t think the missing test coverage in the previous tests is a problem, since the behavior between the previous implementation and the refactored one has already been verified to be identical by the comprehensive tests added in commit b50b0a. The currently untested case is essentially: if providerSpecificAlias does not exist, nothing happens if it does exist, it gets removed In both cases, the final outcome is the same — providerSpecificAlias is absent. That said, if you think it should be covered explicitly, I’m happy to add a test. |
|
/lgtm |


What does it do?
This PR refactors the alias-handling logic inside
adjustEndpointAndNewAaaaIfNeededand prepares the codebase for upcoming fixes in #5997 and #6017.To ensure safety and correctness, the refactoring was performed in multiple verifiable stages:
Extracted the existing logic
In commit 7fda240, the original implementation was split into
oldAdjustEndpointAndNewAaaaIfNeededand a newadjustEndpointAndNewAaaaIfNeeded,with the latter simply delegating to the former.
Added comprehensive compatibility tests
These tests verified that both functions returned identical results for all meaningful input patterns.
This test suite ensured that extraction did not introduce any behavioral changes.
Refactored the new implementation
In commit b50b0a5, the new function was rewritten for clarity and testability.
The compatibility tests confirmed the refactored logic remained fully identical to the old version.
Removed the old logic and updated tests
After strict behavioral parity was confirmed, the old function and compatibility tests were removed.
The test suite was rewritten to validate the intended behavior directly.
This staged process allowed the refactoring to be completed safely while maintaining full functional equivalence throughout the transition.
Motivation
This work originates from the discussion here:
#5997 (comment)
To make future fixes #5997 and #6017 easier and safer to apply, the logic needed to be isolated, simplified, and thoroughly tested.
More