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

feat(hostRules/matchHost): massage and validate #29487

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

RahulGautamSingh
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh commented Jun 6, 2024

Changes

  • Prefix matchHost url which contain : or / with htps:// (migrated as well)

  • Validate matchHost urls

    1. if its an empty string
    2. check is it is a valid url if the url includes :// (ie. only check for valid if url has scheme)

Context

Closes: #29425

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@RahulGautamSingh RahulGautamSingh changed the title massage and validate hostRules.matchHost feat(hostRules/matchHost): massage and validate Jun 6, 2024
lib/config/validation.ts Outdated Show resolved Hide resolved
@rarkins
Copy link
Collaborator

rarkins commented Jun 6, 2024

Please test for both global and repo config

@RahulGautamSingh
Copy link
Collaborator Author

Please test for both global and repo config

Done ☑️

rarkins
rarkins previously approved these changes Jun 7, 2024
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

lib/config/validation.ts Outdated Show resolved Hide resolved
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

lib/config/migrations/custom/host-rules-migration.ts Outdated Show resolved Hide resolved
@RahulGautamSingh RahulGautamSingh marked this pull request as draft June 23, 2024 20:53
@RahulGautamSingh RahulGautamSingh marked this pull request as ready for review June 23, 2024 21:02
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.

hostRules: improve matchHost validation and parsing
3 participants