Skip to content
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

fix: correctly check isOnline with port #12706

Merged
merged 1 commit into from
Dec 10, 2024
Merged

fix: correctly check isOnline with port #12706

merged 1 commit into from
Dec 10, 2024

Conversation

ascorbic
Copy link
Contributor

Changes

@astrojs/upgrade checks if it's online by doign a DNS lookup for the registry host. This was broken for registries that have a port in the URL (mostly local ones like Verdaccio) because it was using url.host, which includes the port. This PR fixes that by using url.hostname.

Fixes #12660

Testing

Docs

Copy link

changeset-bot bot commented Dec 10, 2024

🦋 Changeset detected

Latest commit: 3f90794

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Would love to have a couple of lines in the PR description regarding testing

@ascorbic
Copy link
Contributor Author

From what I can tell, it's not a very testable feature unfortunately. It uses a shell command to find the registry, and node:dns lookup to resolve it. I don't know how any of that can be mocked in our current setup. If you have any ideas that would be great!

@ascorbic ascorbic merged commit f6c4214 into main Dec 10, 2024
14 checks passed
@ascorbic ascorbic deleted the upgrade-host branch December 10, 2024 20:01
This was referenced Dec 10, 2024
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.

@astrojs/upgrade fails when registry URL includes port
2 participants