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(cli): make 'timeout', 'per_page' and 'page' type explicit#1862

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

Conversation

@thomasgl-orange
Copy link
Contributor

@thomasgl-orangethomasgl-orange commentedJan 25, 2022
edited
Loading

This PR is mainly for fixing handling of--timeout /GITLAB_TIMEOUT.

Before:

$ docker run -it --rm python-gitlab:latest --timeout=10 project get --id gitlab-org/gitlabImpossible to get object (Timeout value connect was 10, but it must be an int, float or None.)$ docker run -it --rm -e GITLAB_TIMEOUT=10 python-gitlab:latest project get --id gitlab-org/gitlabImpossible to get object (Timeout value connect was 10, but it must be an int, float or None.)

After (withbbb7df5):

$ docker run -it --rm python-gitlab:latest --timeout 10 project get --id gitlab-org/gitlabid: 278964path: gitlab$ docker run -it --rm -e GITLAB_TIMEOUT=10 python-gitlab:latest project get --id gitlab-org/gitlabid: 278964path: gitlab$ docker run -it --rm python-gitlab:latest --timeout xxx project get --id gitlab-org/gitlabusage: gitlab [--version] [-v] [-d] [-c CONFIG_FILE] [-g GITLAB] [-o {json,legacy,yaml}] [-f FIELDS] [--server-url SERVER_URL] [--ssl-verify SSL_VERIFY] [--timeout TIMEOUT] [--api-version API_VERSION] [--per-page PER_PAGE]              [--pagination PAGINATION] [--order-by ORDER_BY] [--user-agent USER_AGENT] [--private-token PRIVATE_TOKEN | --oauth-token OAUTH_TOKEN | --job-token JOB_TOKEN]gitlab: error: argument --timeout: invalid int value: 'xxx'$ docker run -it --rm -e GITLAB_TIMEOUT=xxx python-gitlab:latest project get --id gitlab-org/gitlabusage: gitlab [--version] [-v] [-d] [-c CONFIG_FILE] [-g GITLAB] [-o {json,legacy,yaml}] [-f FIELDS] [--server-url SERVER_URL] [--ssl-verify SSL_VERIFY] [--timeout TIMEOUT] [--api-version API_VERSION] [--per-page PER_PAGE]              [--pagination PAGINATION] [--order-by ORDER_BY] [--user-agent USER_AGENT] [--private-token PRIVATE_TOKEN | --oauth-token OAUTH_TOKEN | --job-token JOB_TOKEN]gitlab: error: argument --timeout: invalid int value: 'xxx'

The 2nd commit (d493a5e) is less a fix, it's more to make things coherent for these two otherint arguments. It improves handling of non-int values, I think.

Before:

$ docker run -it --rm -e GITLAB_PER_PAGE=xxx python-gitlab:latest project listImpossible to list objects (400: per_page is invalid)$ docker run -it --rm python-gitlab:latest --per-page xxx project listImpossible to list objects (400: per_page is invalid)$ docker run -it --rm python-gitlab:latest --per-page 2 project list --page xxxImpossible to list objects (400: page is invalid)

After (withd493a5e):

$ docker run -it --rm -e GITLAB_PER_PAGE=xxx python-gitlab:latest project listusage: gitlab [--version] [-v] [-d] [-c CONFIG_FILE] [-g GITLAB] [-o {json,legacy,yaml}] [-f FIELDS] [--server-url SERVER_URL] [--ssl-verify SSL_VERIFY] [--timeout TIMEOUT] [--api-version API_VERSION] [--per-page PER_PAGE]              [--pagination PAGINATION] [--order-by ORDER_BY] [--user-agent USER_AGENT] [--private-token PRIVATE_TOKEN | --oauth-token OAUTH_TOKEN | --job-token JOB_TOKEN]gitlab: error: argument --per-page: invalid int value: 'xxx'$ docker run -it --rm python-gitlab:latest --per-page xxx project listusage: gitlab [--version] [-v] [-d] [-c CONFIG_FILE] [-g GITLAB] [-o {json,legacy,yaml}] [-f FIELDS] [--server-url SERVER_URL] [--ssl-verify SSL_VERIFY] [--timeout TIMEOUT] [--api-version API_VERSION] [--per-page PER_PAGE]              [--pagination PAGINATION] [--order-by ORDER_BY] [--user-agent USER_AGENT] [--private-token PRIVATE_TOKEN | --oauth-token OAUTH_TOKEN | --job-token JOB_TOKEN]gitlab: error: argument --per-page: invalid int value: 'xxx'$ docker run -it --rm python-gitlab:latest --per-page 2 project list --page xxxusage: gitlab project list [-h] [--sudo SUDO] [--archived ARCHIVED] [--id-after ID_AFTER] [--id-before ID_BEFORE] [--last-activity-after LAST_ACTIVITY_AFTER] [--last-activity-before LAST_ACTIVITY_BEFORE] [--membership MEMBERSHIP]                           [--min-access-level MIN_ACCESS_LEVEL] [--order-by ORDER_BY] [--owned OWNED] [--repository-checksum-failed REPOSITORY_CHECKSUM_FAILED] [--repository-storage REPOSITORY_STORAGE]                           [--search-namespaces SEARCH_NAMESPACES] [--search SEARCH] [--simple SIMPLE] [--sort SORT] [--starred STARRED] [--statistics STATISTICS] [--topic TOPIC] [--visibility VISIBILITY]                           [--wiki-checksum-failed WIKI_CHECKSUM_FAILED] [--with-custom-attributes WITH_CUSTOM_ATTRIBUTES] [--with-issues-enabled WITH_ISSUES_ENABLED] [--with-merge-requests-enabled WITH_MERGE_REQUESTS_ENABLED]                           [--with-programming-language WITH_PROGRAMMING_LANGUAGE] [--page PAGE] [--per-page PER_PAGE] [--all]gitlab project list: error: argument --page: invalid int value: 'xxx'

Note: all tests/examples above are run after rebuilding a container as documented in the README, so it seems to be with Python 3.10 (on Alpine).

@max-wittigmax-wittig self-assigned thisJan 27, 2022
@max-wittig
Copy link
Member

That's a cool change! Thanks 👍

@max-wittigmax-wittig merged commit3fb4486 intopython-gitlab:mainJan 27, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JohnVillalovosJohnVillalovosJohnVillalovos approved these changes

@nejchnejchAwaiting requested review from nejch

Assignees

@max-wittigmax-wittig

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@thomasgl-orange@max-wittig@JohnVillalovos

[8]ページ先頭

©2009-2025 Movatter.jp