DiamondLightSource / DiamondLightSource/python-copier-template

PyPi Upload Fails with Two Tags on the Same Commit

未关闭
#162 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Jinja
星标
25
派生
10
平均合并
4 小时 4 分钟
30 天内合并 PR
6

描述

When making a tag on a commit, the pypi upload job uses the first tag, not the most recent one, so fails because it tries to upload the same file twice.

## Example

https://github.com/DiamondLightSource/blueapi/actions/runs/9115458365/job/25090049200
```shell
Run pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
repository_url: https://upload.pypi.org/legacy/
packages_dir: dist
verify_metadata: true
skip_existing: false
verbose: false
print_hash: false
/usr/bin/docker run --name cf9f72ad7225c6a41cdb185c142b806b2b4_5d18ac --label 583cf9 --workdir /github/workspace --rm -e "INPUT_USER" -e "INPUT_PASSWORD" -e "INPUT_REPOSITORY-URL" -e "INPUT_REPOSITORY_URL" -e "INPUT_PACKAGES-DIR" -e "INPUT_PACKAGES_DIR" -e "INPUT_VERIFY-METADATA" -e "INPUT_VERIFY_METADATA" -e "INPUT_SKIP-EXISTING" -e "INPUT_SKIP_EXISTING" -e "INPUT_VERBOSE" -e "INPUT_PRINT-HASH" -e "INPUT_PRINT_HASH" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/blueapi/blueapi":"/github/workspace" 583cf9:f72ad7225c6a41cdb185c142b806b2b4 "__token__" "" "" "" "" "" "false" ""
Checking dist/blueapi-0.4.3a1-py3-none-any.whl: PASSED
Checking dist/blueapi-0.4.3a1.tar.gz: PASSED
Uploading distributions to https://upload.pypi.org/legacy/
Uploading blueapi-0.4.3a1-py3-none-any.whl
25l
0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/75.1 kB • --:-- • ?
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.1/75.1 kB • 00:00 • 79.6 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.1/75.1 kB • 00:00 • 79.6 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.1/75.1 kB • 00:00 • 79.6 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.1/75.1 kB • 00:00 • 79.6 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.1/75.1 kB • 00:00 • 79.6 MB/s
25hUploading blueapi-0.4.3a1.tar.gz
25l
0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/986.8 kB • --:-- • ?
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 986.8/986.8 kB • 00:00 • 15.7 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 986.8/986.8 kB • 00:00 • 15.7 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 986.8/986.8 kB • 00:00 • 15.7 MB/s
25hWARNING Error during upload. Retry with the --verbose option for more details.
ERROR HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
File already exists. See https://pypi.org/help/#file-name-reuse for
more information.
```

(ran on tag 0.4.3-a2)

贡献指南

打开贡献指南

调研方向

Start with the PyPI upload job and compare its tag handling with the example run at https://github.com/DiamondLightSource/blueapi/actions/runs/9115458365/job/25090049200. Reproduce the failure using two tags on one commit, then verify that the job selects the most recent tag and no longer attempts to upload the same file twice.

由索引模型根据 Issue 内容生成。

评估

技术栈
github-actions, python
领域
ci-cd, release
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。