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: raise error if there is a 301/302 redirection#1486

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 1 commit intopython-gitlab:masterfromJohnVillalovos:jlvillal/prohibit_redirection
Sep 8, 2021
Merged

fix: raise error if there is a 301/302 redirection#1486

nejch merged 1 commit intopython-gitlab:masterfromJohnVillalovos:jlvillal/prohibit_redirection
Sep 8, 2021

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovosJohnVillalovos commentedMay 30, 2021
edited
Loading

Before we raised an error if there was a 301, 302 redirect but only
from an http URL to an https URL. But we didn't raise an error for
any other redirects.

This caused two problems:

  1. PUT requests that are redirected get changed to GET requests
    which don't perform the desired action but raise no error. This
    is because the GET response succeeds but since it wasn't a PUT it
    doesn't update. See issue:
    Changing milestone of issue does not work #1432
  2. POST requests that are redirected also got changed to GET
    requests. They also caused hard to debug tracebacks for the user.
    See issue:
    Not possible to create note in issue #1477

Correct this by always raising a RedirectError exception and improve
the exception message to let them know what was redirected.

Closes:#1485
Closes:#1432
Closes:#1477

@codecov-commenter
Copy link

codecov-commenter commentedMay 30, 2021
edited
Loading

Codecov Report

Merging#1486 (638b269) intomaster (b8a47ba) willdecrease coverage by8.52%.
The diff coverage is88.88%.

@@            Coverage Diff             @@##           master    #1486      +/-   ##==========================================- Coverage   91.18%   82.66%   -8.53%==========================================  Files          74       74                Lines        4188     4188              ==========================================- Hits         3819     3462     -357- Misses        369      726     +357
FlagCoverage Δ
cli_func_v4?
py_func_v4?
unit82.66% <88.88%> (+0.16%)⬆️

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

Impacted FilesCoverage Δ
gitlab/client.py84.78% <88.88%> (-1.98%)⬇️
gitlab/v4/cli.py40.37% <0.00%> (-41.14%)⬇️
gitlab/v4/objects/files.py52.94% <0.00%> (-39.71%)⬇️
gitlab/v4/objects/milestones.py71.42% <0.00%> (-28.58%)⬇️
gitlab/v4/objects/labels.py65.21% <0.00%> (-28.27%)⬇️
gitlab/cli.py60.34% <0.00%> (-25.87%)⬇️
gitlab/v4/objects/tags.py63.88% <0.00%> (-25.00%)⬇️
gitlab/utils.py65.51% <0.00%> (-24.14%)⬇️
gitlab/v4/objects/repositories.py57.62% <0.00%> (-23.73%)⬇️
gitlab/v4/objects/settings.py73.68% <0.00%> (-21.06%)⬇️
... and17 more

Copy link
Member

@max-wittigmax-wittig 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 your MR. Just some suggestions!

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.

Only some tiny notes from me. I think this should go into the 3.0.0 milestone, right?

@nejchnejch added this to thev3.0.0 milestoneJun 9, 2021
@JohnVillalovos
Copy link
MemberAuthor

Only some tiny notes from me. I think this should go into the 3.0.0 milestone, right?

3.0.0 is fine for me. Earlier is also fine for me.

@JohnVillalovosJohnVillalovos self-assigned thisJun 13, 2021
@nejchnejch mentioned this pull requestJun 14, 2021
15 tasks
@JohnVillalovos
Copy link
MemberAuthor

@nejch Is there anything else that needs to be done for this to get merged?

@nejch
Copy link
Member

@nejch Is there anything else that needs to be done for this to get merged?

Actually no@JohnVillalovos this was ready but I had this idea of getting a bunch of things into 3.0.0 🤣 Let's just do it. Could you just rebase & amend the commit message to have a breaking change trailer for semantic-release?

@JohnVillalovos
Copy link
MemberAuthor

amend the commit message to have a breaking change trailer for semantic-release?

How do I do that? I'm not sure what goes in the message to indicate a breaking change.

Thanks.

@nejch
Copy link
Member

amend the commit message to have a breaking change trailer for semantic-release?

How do I do that? I'm not sure what goes in the message to indicate a breaking change.

Thanks.

Sure! Here are some exampleshttps://www.conventionalcommits.org/en/v1.0.0/#examples

Actually, maybe it's easier to just amend the title asfix!: raise error if there is a 301/302 redirection, looks like it'll have the same effect :) Then the release action should bump it.

Before we raised an error if there was a 301, 302 redirect but onlyfrom an http URL to an https URL.  But we didn't raise an error forany other redirects.This caused two problems:  1. PUT requests that are redirected get changed to GET requests     which don't perform the desired action but raise no error. This     is because the GET response succeeds but since it wasn't a PUT it     doesn't update. See issue:#1432  2. POST requests that are redirected also got changed to GET     requests. They also caused hard to debug tracebacks for the user.     See issue:#1477Correct this by always raising a RedirectError exception and improvethe exception message to let them know what was redirected.Closes:#1485Closes:#1432Closes:#1477
@JohnVillalovos
Copy link
MemberAuthor

Actually, maybe it's easier to just amend the title asfix!: raise error if there is a 301/302 redirection, looks like it'll have the same effect :) Then the release action should bump it.

Done!

Thanks.

@JohnVillalovos
Copy link
MemberAuthor

Thanks for your MR. Just some suggestions!

@max-wittig I believe I resolved all your comments. I marked them as resolved.

@nejch
Copy link
Member

Thanks for your MR. Just some suggestions!

@max-wittig I believe I resolved all your comments. I marked them as resolved.

I've also opened an issue to resolve the rest (by using responses instead)

@nejchnejch merged commit3742405 intopython-gitlab:masterSep 8, 2021
@JohnVillalovosJohnVillalovos deleted the jlvillal/prohibit_redirection branchJanuary 4, 2022 06:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nejchnejchnejch approved these changes

@max-wittigmax-wittigAwaiting requested review from max-wittig

Assignees

@JohnVillalovosJohnVillalovos

Labels
None yet
Projects
None yet
Milestone
v3.0.0
Development

Successfully merging this pull request may close these issues.

RFE: We should catch all 301, 302 redirects Not possible to create note in issue Changing milestone of issue does not work
4 participants
@JohnVillalovos@codecov-commenter@nejch@max-wittig

[8]ページ先頭

©2009-2025 Movatter.jp