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

feat(api): default to gitlab.com if no URL given#1278

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
JohnVillalovos merged 1 commit intomasterfromfeat/default-url
Sep 8, 2021

Conversation

nejch
Copy link
Member

The github CLI (gh) defaults to github.com if no arguments are given. Something similar would make sense here IMO, just for convenience :)

bufferoverflow reacted with thumbs up emoji
Copy link
Member

@bufferoverflowbufferoverflow left a comment

Choose a reason for hiding this comment

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

great idea!

@codecov-io
Copy link

Codecov Report

Merging#1278 (2edd69c) intomaster (643454c) willincrease coverage by0.00%.
The diff coverage is100.00%.

Impacted file tree graph

@@           Coverage Diff           @@##           master    #1278   +/-   ##=======================================  Coverage   78.19%   78.19%           =======================================  Files          12       12             Lines        2884     2885    +1     =======================================+ Hits         2255     2256    +1  Misses        629      629
FlagCoverage Δ
unit78.19% <100.00%> (+<0.01%)⬆️

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

Impacted FilesCoverage Δ
gitlab/const.py100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update643454c...2edd69c. Read thecomment docs.

@nejchnejch marked this pull request as ready for reviewFebruary 4, 2021 22:04
@JohnVillalovos
Copy link
Member

JohnVillalovos commentedFeb 23, 2021
edited
Loading

If you do decide to make a breaking change I wonder if requiring kwargs would be a good idea?

def __init__(    self,    *,    url,    private_token=None,    oauth_token=None,    job_token=None,    ssl_verify=True,    http_username=None,    http_password=None,    timeout=None,    api_version="4",    session=None,    per_page=None,    pagination=None,    order_by=None,    user_agent=gitlab.const.USER_AGENT,):

And okay if people think it is a terrible idea 🙂 Just thought I would mention it.

@max-wittig
Copy link
Member

@JohnVillalovos Not sure what you mean byrequiring kwargs would be a good idea. Could you elaborate?

@JohnVillalovos
Copy link
Member

JohnVillalovos commentedFeb 26, 2021
edited
Loading

@JohnVillalovos Not sure what you mean byrequiring kwargs would be a good idea. Could you elaborate?

Sure. So by using the* in the argument list it will require people to use keyword arguments.

Allowed:

gl = gitlab.Gitlab(url="gitlab.com")

Not allowed:

gl = gitlab.Gitlab("gitlab.com")TypeError: __init__() takes 1 positional argument but 2 were given

It is a breaking change for sure to do that.

@max-wittig
Copy link
Member

@JohnVillalovos I'm not so sure. I'm not really a fan of this change. This would really break everything.

@JohnVillalovos
Copy link
Member

JohnVillalovos commentedFeb 26, 2021
edited
Loading

@JohnVillalovos I'm not so sure. I'm not really a fan of this change. This would really break everything.

No worries. As a note you can put the* where ever you like in the arguments list. So if you wanted to require keyword arguments for everything buturl you could put the* after theurl argument.

def __init__(    self,    url,    *,    private_token=None,    oauth_token=None,    job_token=None,    ssl_verify=True,    http_username=None,    http_password=None,    timeout=None,    api_version="4",    session=None,    per_page=None,    pagination=None,    order_by=None,    user_agent=gitlab.const.USER_AGENT,):

@nejchnejch mentioned this pull requestApr 25, 2021
@nejchnejch added this to thev3.0.0 milestoneApr 27, 2021
@nejchnejch mentioned this pull requestJun 14, 2021
15 tasks
@nejchnejchforce-pushed thefeat/default-url branch 2 times, most recently from7bc388c toedfb416CompareSeptember 8, 2021 20:22
BREAKING CHANGE: python-gitlab will now default to gitlab.comif no URL is given
@nejch
Copy link
MemberAuthor

@JohnVillalovos I'm not so sure. I'm not really a fan of this change. This would really break everything.

No worries. As a note you can put the* where ever you like in the arguments list. So if you wanted to require keyword arguments for everything buturl you could put the* after theurl argument.

def __init__(    self,    url,    *,    private_token=None,    oauth_token=None,    job_token=None,    ssl_verify=True,    http_username=None,    http_password=None,    timeout=None,    api_version="4",    session=None,    per_page=None,    pagination=None,    order_by=None,    user_agent=gitlab.const.USER_AGENT,):

I agree with Max I've seen a lot of use of this in tiny scripts, and there people probably want to use quick one-liners without kwargs just to instantiateGitlab with a private token, so I'd keep this as is for now.

@nejch
Copy link
MemberAuthor

@JohnVillalovos while resolving conflicts I consolidated the URL redirect warnings as I saw they were in 3 places, in case you'd like to have 1 final look, but this should also be ready now.

@nejchnejch assignedJohnVillalovos and unassignednejchSep 8, 2021
@JohnVillalovosJohnVillalovos merged commit8236281 intomasterSep 8, 2021
@JohnVillalovosJohnVillalovos deleted the feat/default-url branchSeptember 8, 2021 20:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@bufferoverflowbufferoverflowbufferoverflow approved these changes

@JohnVillalovosJohnVillalovosJohnVillalovos 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.

5 participants
@nejch@codecov-io@JohnVillalovos@max-wittig@bufferoverflow

[8]ページ先頭

©2009-2025 Movatter.jp