Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): do not require config file to run CLI #1743

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

nejch
Copy link
Member

@nejch nejch commented Dec 12, 2021

BREAKING CHANGE: A config file is no longer needed to run
the CLI. python-gitlab will default to https://gitlab.com
with no authentication if there is no config file provided.
python-gitlab will now also only look for configuration
in the provided PYTHON_GITLAB_CFG path, instead of merging
it with user- and system-wide config files. If the
environment variable is defined and the file cannot be
opened, python-gitlab will now explicitly fail.

Needed for #1296

@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2021

Codecov Report

Merging #1743 (92a893b) into main (af33aff) will decrease coverage by 0.00%.
The diff coverage is 97.22%.

@@            Coverage Diff             @@
##             main    #1743      +/-   ##
==========================================
- Coverage   91.97%   91.97%   -0.01%     
==========================================
  Files          76       76              
  Lines        4737     4759      +22     
==========================================
+ Hits         4357     4377      +20     
- Misses        380      382       +2     
Flag Coverage Δ
cli_func_v4 81.34% <94.44%> (+0.04%) ⬆️
py_func_v4 80.71% <73.61%> (-0.21%) ⬇️
unit 83.23% <94.44%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
gitlab/config.py 94.44% <97.22%> (+0.77%) ⬆️
gitlab/cli.py 98.16% <0.00%> (-1.84%) ⬇️

@nejch nejch force-pushed the feat/cli-without-config-file branch 2 times, most recently from 8884417 to d0c6005 Compare December 12, 2021 19:44
@nejch nejch marked this pull request as ready for review December 12, 2021 19:47
Copy link
Member

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

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

Can functional tests be added for this. In particular a functional test that demonstrates it works without a config file? Though I guess that will try to contact https://gitlab.com/ 😟

gitlab/config.py Outdated Show resolved Hide resolved
gitlab/config.py Show resolved Hide resolved
@nejch nejch force-pushed the feat/cli-without-config-file branch from d0c6005 to e6449d3 Compare December 12, 2021 23:47
BREAKING CHANGE: A config file is no longer needed to run
the CLI. python-gitlab will default to https://gitlab.com
with no authentication if there is no config file provided.
python-gitlab will now also only look for configuration
in the provided PYTHON_GITLAB_CFG path, instead of merging
it with user- and system-wide config files. If the
environment variable is defined and the file cannot be
opened, python-gitlab will now explicitly fail.
Copy link
Member

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

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

Looks good to me. I wasn't sure if you wanted to merge it or not.

Please merge whenever you are ready.

Thanks.

@nejch nejch merged commit 170a4d9 into main Dec 13, 2021
@nejch nejch deleted the feat/cli-without-config-file branch December 13, 2021 08:32
@nejch nejch mentioned this pull request Jan 5, 2022
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants