« Back to Search  |  Reader Mode  |  Switch to Full Retro Site View Links: Stay in Reader  |  Retro Mode: ON  |  Original »
GitHub · Extracted in 1454 ms

fix: use url-encoded ID in all paths (alternate method) by JohnVillalovos · Pull Request #1820 · python-gitlab/python-gitlab

Source: https://github.com/python-gitlab/python-gitlab/pull/1820

Repository navigation

fix: use url-encoded ID in all paths (alternate method) - #1820


Closed
JohnVillalovos wants to merge 1 commit into main from jlvillal/encoded_id_alt
Closed

fix: use url-encoded ID in all paths (alternate method) #1820 JohnVillalovos wants to merge 1 commit into main from jlvillal/encoded_id_alt

Conversation

JohnVillalovos commented Jan 9, 2022



Copy link Copy Markdown
Member

An alternative to #1819

Make sure all usage of the ID in the URL path is encoded. Normally it
isn't an issue as most IDs are integers or strings which don't contain
a slash ('/'). But when the ID is a string with a slash character it
will break things.

Add a test case that shows this fixes wikis issue with subpages which
use the slash character.

Closes : #1079

JohnVillalovos force-pushed the jlvillal/encoded_id_alt branch from 37dff7e to fd8a747
Compare
January 9, 2022 07:20

codecov-commenter commented Jan 9, 2022 · edited Loading



Copy link Copy Markdown

Codecov Report

Merging #1820 (99e1f8b ) into main (ac81272 ) will increase coverage by 0.08%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main    #1820      +/-   ##
==========================================
+ Coverage   92.10%   92.18%   +0.08%     
==========================================
  Files          76       76              
  Lines        4801     4826      +25     
==========================================
+ Hits         4422     4449      +27     
+ Misses        379      377       -2     
Flag Coverage Δ
cli_func_v4 81.37% <26.35%> (+0.01%) ⬆️
py_func_v4 80.16% <58.91%> (-0.01%) ⬇️
unit 83.23% <34.10%> (+0.19%) ⬆️

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

Impacted Files Coverage Δ
gitlab/v4/objects/epics.py 74.41% <0.00%> (ø)
gitlab/v4/objects/features.py 72.22% <0.00%> (+3.80%) ⬆️
gitlab/v4/objects/geo_nodes.py 68.57% <0.00%> (ø)
gitlab/v4/objects/groups.py 87.78% <33.33%> (ø)
gitlab/v4/objects/jobs.py 77.27% <33.33%> (ø)
gitlab/v4/objects/projects.py 87.19% <33.33%> (ø)
gitlab/v4/objects/repositories.py 83.07% <55.55%> (ø)
gitlab/v4/objects/merge_requests.py 84.78% <62.50%> (ø)
gitlab/mixins.py 91.45% <63.15%> (-0.09%) ⬇️
gitlab/v4/objects/issues.py 89.02% <66.66%> (ø)
... and 10 more
JohnVillalovos force-pushed the jlvillal/encoded_id_alt branch from fd8a747 to 1df929c
Compare
January 9, 2022 07:41 JohnVillalovos marked this pull request as draft January 9, 2022 07:51 fix: use url-encoded ID in all paths ALTERNATE METHOD 99e1f8b
An alternative to #1819

Make sure all usage of the ID in the URL path is encoded. Normally it
isn't an issue as most IDs are integers or strings which don't contain
a slash ('/'). But when the ID is a string with a slash character it
will break things.

Add a test case that shows this fixes wikis issue with subpages which
use the slash character.

Closes: #1079
JohnVillalovos force-pushed the jlvillal/encoded_id_alt branch from 1df929c to 99e1f8b
Compare
January 9, 2022 08:53

JohnVillalovos commented Jan 9, 2022



Copy link Copy Markdown
Member

Author

The EncodedId class is kind of cool 😎 in my opinion... But also kind of complicated. It was really interesting figuring this out.

Interested to hear what you think @nejch

JohnVillalovos requested a review from nejch January 9, 2022 08:55 JohnVillalovos mentioned this pull request Jan 9, 2022 fix: use url-encoded ID in all paths #1819 Merged nejch changed the title fix: use url-encoded ID in all paths ALTERNATE METHOD fix: use url-encoded ID in all paths (alternate method) Jan 9, 2022

nejch commented Jan 13, 2022



Copy link Copy Markdown
Member

I guess we can close this one @JohnVillalovos as the changes were essentially incorporated into the original one right?

JohnVillalovos commented Jan 13, 2022



Copy link Copy Markdown
Member

Author

I guess we can close this one @JohnVillalovos as the changes were essentially incorporated into the original one right?

Yep!

JohnVillalovos closed this Jan 13, 2022 nejch deleted the jlvillal/encoded_id_alt branch May 9, 2022 19:51 Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

3 participants