GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(api): default to gitlab.com if no URL given by nejch · Pull Request #1278 · python-gitlab/python-gitlab

Conversation

@nejch

@nejch nejch commented Jan 31, 2021

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bufferoverflow reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
bufferoverflow
bufferoverflow approved these changes Jan 31, 2021
View reviewed changes

@bufferoverflow bufferoverflow left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

great idea!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
nejch
nejch commented Feb 4, 2021
View reviewed changes
Comment thread gitlab/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nejch
nejch force-pushed the feat/default-url branch from 019c2d9 to 2edd69c Compare February 4, 2021 21:55
@codecov-io

codecov-io commented Feb 4, 2021

Copy link
Copy Markdown

Codecov Report

Merging #1278 (2edd69c) into master (643454c) will increase coverage by 0.00%.
The diff coverage is 100.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           
Flag Coverage Δ
unit 78.19% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
gitlab/const.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 643454c...2edd69c. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nejch
nejch marked this pull request as ready for review February 4, 2021 22:04
max-wittig
max-wittig approved these changes Feb 6, 2021
View reviewed changes
Comment thread gitlab/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gitlab/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@max-wittig max-wittig assigned nejch Feb 6, 2021
@nejch
nejch requested a review from max-wittig February 7, 2021 11:48
@JohnVillalovos

JohnVillalovos commented Feb 23, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@max-wittig

max-wittig commented Feb 26, 2021

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@max-wittig max-wittig mentioned this pull request Feb 26, 2021
feat(api): add merge request pipeline manager and deprecate mr.pipelines() method #1323
Merged
@JohnVillalovos

JohnVillalovos commented Feb 26, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@JohnVillalovos Not sure what you mean by requiring 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@max-wittig

max-wittig commented Feb 26, 2021

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JohnVillalovos

JohnVillalovos commented Feb 26, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@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 but url you could put the * after the url 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,
):

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nejch nejch mentioned this pull request Apr 25, 2021
chore: bump version to 2.7.0 #1408
Merged
@nejch nejch added this to the v3.0.0 milestone Apr 27, 2021
@nejch nejch mentioned this pull request Jun 14, 2021
Breaking changes in 3.0.0 #1520
Closed
15 tasks done
@nejch
nejch force-pushed the feat/default-url branch 2 times, most recently from 7bc388c to edfb416 Compare September 8, 2021 20:22
@nejch
feat: default to gitlab.com if no URL given
8677756
BREAKING CHANGE: python-gitlab will now default to gitlab.com
if no URL is given
@nejch
nejch force-pushed the feat/default-url branch from edfb416 to 8677756 Compare September 8, 2021 20:32
@nejch

nejch commented Sep 8, 2021

Copy link
Copy Markdown
Member Author

@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 but url you could put the * after the url 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 instantiate Gitlab with a private token, so I'd keep this as is for now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nejch

nejch commented Sep 8, 2021

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nejch nejch assigned JohnVillalovos and unassigned nejch Sep 8, 2021
JohnVillalovos
JohnVillalovos approved these changes Sep 8, 2021
View reviewed changes
@JohnVillalovos
JohnVillalovos merged commit 8236281 into master Sep 8, 2021
@JohnVillalovos
JohnVillalovos deleted the feat/default-url branch September 8, 2021 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bufferoverflow bufferoverflow bufferoverflow approved these changes
@JohnVillalovos JohnVillalovos JohnVillalovos approved these changes
@max-wittig max-wittig Awaiting requested review from max-wittig

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@JohnVillalovos JohnVillalovos

Labels

None yet

Projects

None yet

Milestone

v3.0.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@nejch @codecov-io @JohnVillalovos @max-wittig @bufferoverflow
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.