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

--skip-existing: add support for Gitlab Enterprise #698

Merged
merged 1 commit into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ Felipe Mulinari Rocha Campos <[email protected]>
Devesh Kumar Singh <[email protected]>
Yesha Maggi <[email protected]>
Cyril de Catheu <[email protected]> (https://catheu.tech/)
Thomas Miedema <[email protected]>
9 changes: 9 additions & 0 deletions tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ def test_prints_skip_message_for_response(
),
id="artifactory_new",
),
pytest.param(
dict(
status_code=400,
text=(
'{"message":"validation failed: file name has already been taken"}'
),
),
id="gitlab_enterprise",
),
],
)
def test_skip_existing_skips_files_on_repository(response_kwargs):
Expand Down
2 changes: 2 additions & 0 deletions twine/commands/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def skip_upload(
or (status == 400 and any("updating asset" in x for x in [reason, text]))
# Artifactory (https://jfrog.com/artifactory/)
or (status == 403 and "overwrite artifact" in text)
# Gitlab Enterprise Edition (https://about.gitlab.com)
or (status == 400 and "already been taken" in text)
)


Expand Down