Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update remaining usages of LOCALHOST_HOSTNAME #9578

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

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

simonrw
Copy link
Contributor

@simonrw simonrw commented Nov 7, 2023

Motivation

Some usages of LOCALHOST_HOSTNAME were missed during the migration to LOCALSTACK_HOST. This PR addresses that.

Note: usages of returning LOCALHOST_HOSTNAME are changed, not internal usages of LOCALHOST_HOSTNAME to return to localhost. This is important, because LOCALSTACK_HOST is a "cosmetic" variable, and as such should not be used as a value to reach localhost.

Changes

  • Update external usages of LOCALHOST_HOSTNAME to use LOCALSTACK_HOST.
  • Move Route53 hosted zone fixture to a common location for use in the network configuration tests in LocalStack Pro
  • LOCALSTACK_HOST no longer configures the edge port if GATEWAY_LISTEN is not specified
    • this was weird behaviour, and a confusing mix of cosmetic and functional variables

@simonrw simonrw added the semver: major Breaking changes which can be included in a major release only label Nov 7, 2023
@simonrw simonrw self-assigned this Nov 7, 2023
@simonrw simonrw requested review from dfangl and joe4dev November 7, 2023 21:54
@simonrw simonrw mentioned this pull request Nov 7, 2023
20 tasks
Copy link

github-actions bot commented Nov 7, 2023

LocalStack Community integration with Pro

       2 files  ±0         2 suites  ±0   1h 5m 37s ⏱️ +17s
2 305 tests ±0  2 009 ✔️ ±0  296 💤 ±0  0 ±0 
2 306 runs  ±0  2 009 ✔️ ±0  297 💤 ±0  0 ±0 

Results for commit 3359d80. ± Comparison against base commit 2a2ea5d.

♻️ This comment has been updated with latest results.

@simonrw simonrw marked this pull request as ready for review November 8, 2023 07:27
@coveralls
Copy link

coveralls commented Nov 8, 2023

Coverage Status

coverage: 84.097% (+0.02%) from 84.073%
when pulling 3359d80 on localstack-host-3
into 2a2ea5d on release/v3.0.

Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@simonrw simonrw requested a review from thrau as a code owner November 8, 2023 11:49
Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More explicit, clearer, and easier 💯 LGTM 🚀

(the major change is a bit sneaky in the usage update PR ;)

@@ -603,16 +603,6 @@ def populate_edge_configuration(
localstack_host_raw = environment.get("LOCALSTACK_HOST")
gateway_listen_raw = environment.get("GATEWAY_LISTEN")

# new for v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see this complexity go and keep LOCALSTACK_HOST purely cosmetic ✨

also localstack_host_port was confusing to follow

We have not advertised this shortcut anywhere. So let's hope this breaking change goes smooth 🤞

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be interesting to know why we added it in the first place but I guess that remains unknown 🪄

# * ip only
# * host and ip
# and there are two variables so 16 total tests
@pytest.mark.parametrize(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lovely thorough test coverage 💯

We do lose the human-readable names but that's worth the full coverage (at least for len(gateway_listen) == 1) ⚖️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also simplify removing EDGE_PORT from populate_edge_configuration if we wish to do so later 👍

@simonrw
Copy link
Contributor Author

simonrw commented Nov 8, 2023

(the major change is a bit sneaky in the usage update PR ;)

I've put in the PR description, so it's fine right?! 🤷

@simonrw simonrw requested a review from macnev2013 as a code owner November 8, 2023 12:42
Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Test cases look good as well, i think it's quite clear what's going on.

@simonrw simonrw merged commit 7bf2184 into release/v3.0 Nov 8, 2023
@simonrw simonrw deleted the localstack-host-3 branch November 8, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: major Breaking changes which can be included in a major release only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants