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(cli): url-encode path components of the URL #1790

Merged
merged 2 commits into from Jan 8, 2022
Merged

Conversation

JohnVillalovos
Copy link
Collaborator

@JohnVillalovos JohnVillalovos commented Jan 2, 2022

In the CLI we need to make sure the components put into the path
portion of the URL are url-encoded. Otherwise they will be interpreted
as part of the path. For example can specify the project ID as a path,
but in the URL it must be url-encoded or it doesn't work.

Also stop adding the components of the path as query parameters in the
URL.

Closes: #783
Closes: #1498

@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2022

Codecov Report

Merging #1790 (4b779bd) into main (bc6c6e6) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1790      +/-   ##
==========================================
+ Coverage   92.02%   92.03%   +0.01%     
==========================================
  Files          76       76              
  Lines        4790     4798       +8     
==========================================
+ Hits         4408     4416       +8     
  Misses        382      382              
Flag Coverage Δ
cli_func_v4 81.42% <100.00%> (+0.05%) ⬆️
py_func_v4 80.09% <0.00%> (-0.12%) ⬇️
unit 83.09% <11.11%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/v4/cli.py 81.85% <100.00%> (+0.46%) ⬆️
gitlab/v4/objects/services.py 100.00% <0.00%> (ø)
gitlab/v4/objects/commits.py 94.73% <0.00%> (+0.07%) ⬆️

gitlab/v4/cli.py Outdated Show resolved Hide resolved
tests/functional/cli/test_cli_variables.py Show resolved Hide resolved
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

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

Thanks John. Just a few suggestions and could you maybe rename the commit message to say fix(cli): ... so that it's parsed as a scope?

gitlab/v4/cli.py Outdated Show resolved Hide resolved
tests/functional/cli/test_cli_variables.py Outdated Show resolved Hide resolved
tests/functional/cli/test_cli_variables.py Outdated Show resolved Hide resolved
gitlab/v4/cli.py Outdated Show resolved Hide resolved
tests/functional/cli/test_cli_variables.py Outdated Show resolved Hide resolved
Previously c8256a5 was done to fix
this but it missed two other failures.
In the CLI we need to make sure the components put into the path
portion of the URL are url-encoded. Otherwise they will be interpreted
as part of the path. For example can specify the project ID as a path,
but in the URL it must be url-encoded or it doesn't work.

Also stop adding the components of the path as query parameters in the
URL.

Closes: #783
Closes: #1498
@JohnVillalovos JohnVillalovos changed the title fix: cli: url-encode path components of the URL fix(cli): url-encode path components of the URL Jan 8, 2022
@JohnVillalovos
Copy link
Collaborator Author

Thanks John. Just a few suggestions and could you maybe rename the commit message to say fix(cli): ... so that it's parsed as a scope?

Done!

@nejch nejch enabled auto-merge January 8, 2022 22:32
@nejch nejch merged commit 22a1516 into main Jan 8, 2022
@nejch nejch deleted the jlvillal/parent_attrs branch January 8, 2022 22:34
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.

Suggestion: url encode project paths automatically inconsistency with project id option
3 participants