Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: use url-encoded ID in all paths#1819

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 3 commits intomainfromjlvillal/encoded_id
Jan 13, 2022
Merged

Conversation

JohnVillalovos
Copy link
Member

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

@JohnVillalovosJohnVillalovos marked this pull request as draftJanuary 9, 2022 02:41
@JohnVillalovosJohnVillalovos marked this pull request as ready for reviewJanuary 9, 2022 02:47
@codecov-commenter
Copy link

codecov-commenter commentedJan 9, 2022
edited
Loading

Codecov Report

Merging#1819 (2d9612b) intomain (824151c) willdecrease coverage by0.02%.
The diff coverage is65.11%.

@@            Coverage Diff             @@##             main    #1819      +/-   ##==========================================- Coverage   92.19%   92.17%   -0.03%==========================================  Files          77       77                Lines        4819     4843      +24     ==========================================+ Hits         4443     4464      +21- Misses        376      379       +3
FlagCoverage Δ
cli_func_v481.33% <27.13%> (-0.02%)⬇️
py_func_v480.19% <57.36%> (+0.03%)⬆️
unit83.19% <34.10%> (+0.02%)⬆️

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

Impacted FilesCoverage Δ
gitlab/v4/objects/epics.py74.41% <0.00%> (ø)
gitlab/v4/objects/features.py68.42% <0.00%> (ø)
gitlab/v4/objects/geo_nodes.py68.57% <0.00%> (ø)
gitlab/v4/objects/merge_request_approvals.py90.58% <0.00%> (ø)
gitlab/v4/objects/groups.py87.96% <33.33%> (ø)
gitlab/v4/objects/jobs.py77.27% <33.33%> (ø)
gitlab/v4/objects/projects.py87.19% <33.33%> (ø)
gitlab/v4/objects/repositories.py83.07% <55.55%> (ø)
gitlab/v4/objects/merge_requests.py84.78% <62.50%> (ø)
gitlab/mixins.py91.50% <65.00%> (-0.05%)⬇️
... and10 more

JohnVillalovos added a commit that referenced this pull requestJan 9, 2022
An alternative to#1819Make sure all usage of the ID in the URL path is encoded. Normally itisn't an issue as most IDs are integers or strings which don't containa slash ('/'). But when the ID is a string with a slash character itwill break things.Add a test case that shows this fixes wikis issue with subpages whichuse the slash character.Closes:#1079
JohnVillalovos added a commit that referenced this pull requestJan 9, 2022
An alternative to#1819Make sure all usage of the ID in the URL path is encoded. Normally itisn't an issue as most IDs are integers or strings which don't containa slash ('/'). But when the ID is a string with a slash character itwill break things.Add a test case that shows this fixes wikis issue with subpages whichuse the slash character.Closes:#1079
JohnVillalovos added a commit that referenced this pull requestJan 9, 2022
An alternative to#1819Make sure all usage of the ID in the URL path is encoded. Normally itisn't an issue as most IDs are integers or strings which don't containa slash ('/'). But when the ID is a string with a slash character itwill break things.Add a test case that shows this fixes wikis issue with subpages whichuse the slash character.Closes:#1079
JohnVillalovos added a commit that referenced this pull requestJan 9, 2022
An alternative to#1819Make sure all usage of the ID in the URL path is encoded. Normally itisn't an issue as most IDs are integers or strings which don't containa slash ('/'). But when the ID is a string with a slash character itwill break things.Add a test case that shows this fixes wikis issue with subpages whichuse the slash character.Closes:#1079
@JohnVillalovosJohnVillalovos marked this pull request as draftJanuary 9, 2022 08:55
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/encoded_id branch 2 times, most recently from9b40dda to54abe80CompareJanuary 9, 2022 20:09
@JohnVillalovosJohnVillalovos marked this pull request as ready for reviewJanuary 9, 2022 20:09
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/encoded_id branch 3 times, most recently from9896154 tof9fed09CompareJanuary 10, 2022 02:55
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/encoded_id branch 3 times, most recently fromc865920 toaf3f5aeCompareJanuary 10, 2022 06:31
Copy link
Member

@nejchnejch left a comment

Choose a reason for hiding this comment

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

Thanks for the update again! Just a few questions from me :)

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/encoded_id branch 2 times, most recently froma5ff3b5 to826a03fCompareJanuary 11, 2022 02:11
Make sure all usage of the ID in the URL path is encoded. Normally itisn't an issue as most IDs are integers or strings which don't containa slash ('/'). But when the ID is a string with a slash character itwill break things.Add a test case that shows this fixes wikis issue with subpages whichuse the slash character.Closes:#1079
Add EncodedId string class. This class returns a URL-encoded stringbut ensures it will only URL-encode it once even if recursivelycalled.Also added some functional tests of 'lazy' objects to make sure theywork.
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/encoded_id branch 2 times, most recently froma3983fc to2d9612bCompareJanuary 13, 2022 18:47
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/encoded_id branch 3 times, most recently from16f725f toa05ee47CompareJanuary 13, 2022 19:12
utils.EncodedId() has basically the same functionalityy of usingutils._url_encode(). So remove utils._url_encode() as we don't needit.
Copy link
Member

@nejchnejch left a comment

Choose a reason for hiding this comment

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

Awesome@JohnVillalovos this will fix like 90% of the CLI path issues for sub-resources :)

JohnVillalovos reacted with thumbs up emoji
@nejchnejch merged commitbc48840 intomainJan 13, 2022
@nejchnejch deleted the jlvillal/encoded_id branchJanuary 13, 2022 19:48
@JohnVillalovos
Copy link
MemberAuthor

Thanks for all the reviews@nejch Looks a LOT better from where I started 😊

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nejchnejchnejch approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

project.wikis.create with subpages results in 404 Wiki Page Not Found
3 participants
@JohnVillalovos@codecov-commenter@nejch

[8]ページ先頭

©2009-2025 Movatter.jp