8000 Unify hostnames in returned URLs by simonrw · Pull Request #7774 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content
8000

Unify hostnames in returned URLs #7774

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 27 commits into from
Mar 20, 2023
Merged

Unify hostnames in returned URLs #7774

merged 27 commits into from
Mar 20, 2023

Conversation

simonrw
Copy link
Contributor
@simonrw simonrw commented Mar 1, 2023

This PR centralises the way we decide what hostname is returned when requested by the resource.

This PR contains tests that ensure the current behaviour. This is important as I consider changing the way the user configures returned names to be a backwards incompatible change. In a future PR when v2 will be released, we will update the new url function to be systematic, based on the new configuration.

@simonrw simonrw self-assigned this Mar 1, 2023
@simonrw simonrw temporarily deployed to localstack-ext-tests March 1, 2023 14:33 — with GitHub Actions Inactive
@github-actions
Copy link
github-actions bot commented Mar 1, 2023

LocalStack integration with Pro

       3 files  ±  0         3 suites  ±0   1h 42m 44s ⏱️ + 2m 34s
1 819 tests +13  1 435 ✔️ +12  384 💤 +1  0 ±0 
2 537 runs  +13  1 801 ✔️ +12  736 💤 +1  0 ±0 

Results for commit ba95b63. ± Comparison against base commit 1dfc637.

♻️ This comment has been updated with latest results.

@simonrw simonrw temporarily deployed to localstack-ext-tests March 1, 2023 16:31 — with GitHub Actions Inactive
@simonrw simonrw force-pushed the network-unification branch from 7756af7 to bd97e9a Compare March 1, 2023 17:13
@simonrw simonrw temporarily deployed to localstack-ext-tests March 1, 2023 17:13 — with GitHub Actions Inactive
@coveralls
Copy link
coveralls commented Mar 1, 2023

Coverage Status

Coverage: 85.113% (-5.0e-05%) from 85.113% when pulling ba95b63 on network-unification into 1dfc637 on master.

@simonrw simonrw temporarily deployed to localstack-ext-tests March 3, 2023 11:10 — with GitHub Actions Inactive
@simonrw simonrw force-pushed the network-unification branch from 6e58a00 to 08982ed Compare March 3, 2023 11:36
@simonrw simonrw temporarily deployed to localstack-ext-tests March 3, 2023 11:36 — with GitHub Actions Inactive
@simonrw simonrw force-pushed the network-unification branch from 08982ed to 03d9fc3 Compare March 3, 2023 13:27
@simonrw simonrw temporarily deployed to localstack-ext-tests March 3, 2023 13:27 — with GitHub Actions Inactive
@simonrw simonrw force-pushed the network-unification branch from 03d9fc3 to 72abce8 Compare March 3, 2023 15:24
@simonrw simonrw temporarily deployed to localstack-ext-tests March 3, 2023 15:24 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 3, 2023 16:24 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 3, 2023 18:15 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 7, 2023 14:14 — with GitHub Actions Inactive
@simonrw simonrw marked this pull request as ready for review March 7, 2023 14:55
@simonrw simonrw temporarily deployed to localstack-ext-tests March 8, 2023 09:53 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 9, 2023 10:15 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 9, 2023 11:32 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 9, 2023 16:05 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 10, 2023 14:28 — with GitHub Actions Inactive
Copy link
Member
@baermat baermat left a comment

Choose a reason for hiding this comment

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

Looks great! Small things remaining which can be fixed super quickly and then it's a go from my side 🎉

@simonrw
Copy link
Contributor Author
simonrw commented Mar 10, 2023

Looks great! Small things remaining which can be fixed super quickly and then it's a go from my side tada

Thanks @baermat, I've implemented your changes

@simonrw simonrw temporarily deployed to localstack-ext-tests March 13, 2023 09:26 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 13, 2023 17:49 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 15, 2023 14:42 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 15, 2023 15:37 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 16, 2023 07:01 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 17, 2023 08:47 — with GitHub Actions Inactive
We need to listen on the HTTP port rather than the HTTPS port
@simonrw simonrw temporarily deployed to localstack-ext-tests March 17, 2023 10:16 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 17, 2023 11:58 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 17, 2023 13:53 — with GitHub Actions Inactive
@simonrw simonrw temporarily deployed to localstack-ext-tests March 17, 2023 16:06 — with GitHub Actions Inactive
Comment on lines 260 to +264
if config.SQS_PORT_EXTERNAL:
host_url = external_service_url("sqs")
host_definition = localstack_host(
use_hostname_external=True, custom_port=config.SQS_PORT_EXTERNAL
)
host_url = f"{get_protocol()}://{host_definition.host_and_port()}"
Copy link
Member

Choose a reason for hiding this comment

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

hey! i can see that SQS_PORT_EXTERNAL is still in the control path here although we decided to boot it. can we just remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR is just matching existing behaviour. I'll get rid of it in a follow up PR targeting the v2 branch once this is merged 👍

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.

I mostly looked at the lambda parts, LGTM!

@simonrw simonrw merged commit 3b41e13 into master Mar 20, 2023
@simonrw simonrw deleted the network-unification branch March 20, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
0