-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix RepoSpec
query extraction
#4863
Fix RepoSpec
query extraction
#4863
Conversation
/cc @KnVerey, I think it'll be good to have your input here since you are probably the most familiar with this code out of all of us. |
* Remove redundant code * Add comment
@annasong20: This PR has multiple commits, and the default merge method is: merge. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/label tide/merge-method-squash |
RepoSpec
query extraction
2c760fd
to
226a5c2
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: annasong20, KnVerey The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Clean query processing * Improve readability * Remove redundant code * Add comment * Return path literal when not parsable * Handle url.Parse() error in future
This PR aims to fix #4849. It's also intended to be the 1st in a series of PRs to refactor the
RepoSpec
code, which is currently hard to read and filled with edge cases.In addition to adding tests to cover the fix, the PR refactors some existing testing structure to make results more comprehensible.
Effectively, this PR moves query parsing to the top to avoid accidentally identifying the query as part of the host, orgRepo, or path. RFC 3986 provides support for this logic. Handling the query once and early should also make the rest of the code easier to read.