Skip to content

chore: move app URL parsing to its own package #11651

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 9 commits into from
Jan 17, 2024

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Jan 16, 2024

What this does

Parsing CODER_WILDCARD_ACCESS_URL as a url.URL was always incorrect (see https://goplay.tools/snippet/YHUpcSkVrli). Since wildcard urls do not have a scheme, the url parsing was never accurate to how it parsed things. And it would not accept ports.

We have a wildcard parse function, so why not make that the validation instead of using the url and url.String().

Lastly I moved appurl to it's own package to avoid import loops. This is a reasonable thing to package.

In support of #8189. We need to move the field from a url to a string to support ports.

Copy link
Member Author

Emyrk commented Jan 16, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Emyrk and the rest of your teammates on Graphite Graphite

@Emyrk Emyrk changed the title chore: move app url parsing to it's own package chore: move app URL parsing to its own package Jan 16, 2024
@Emyrk Emyrk marked this pull request as ready for review January 17, 2024 01:20
Comment on lines +13 to +14
// nameRegex is the same as our UsernameRegex without the ^ and $.
nameRegex = "[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*"
Copy link
Member

Choose a reason for hiding this comment

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

I think it should still trim the old regex instead TBH

Copy link
Member Author

Choose a reason for hiding this comment

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

Because of import loops, we would need to put that regex in some other package then 😢.

Copy link
Member

Choose a reason for hiding this comment

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

codersdk maybe?

@Emyrk Emyrk added release/breaking This label is applied to PRs to detect breaking changes as part of the release process and removed release/breaking This label is applied to PRs to detect breaking changes as part of the release process labels Jan 17, 2024
@Emyrk Emyrk merged commit b246f08 into main Jan 17, 2024
@Emyrk Emyrk deleted the stevenmasley/ports_in_wildcard branch January 17, 2024 16:41
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants