add_to_pydotorg.py currently deletes the existing release-file rows before it
creates the replacement rows. If one of the later create requests fails, the
helper returns -1, the caller skips the failed row, and the script continues.
That can leave the release with only the subset of replacement files that were
created before the failure.
Reproducer
Using mocked API calls:
- Make
DELETE /downloads/release_file/?release=... return 204.
- Make the first
POST /downloads/release_file/ return a created row.
- Make the second
POST /downloads/release_file/ fail.
- Run the publishing flow.
The script still reaches Done - 1 files added.
Expected behavior
A failed release-file create should fail the publishing run. Any rows created by
that same run should be cleaned up so the command does not finish with a partial
replacement set.
add_to_pydotorg.pycurrently deletes the existing release-file rows before itcreates the replacement rows. If one of the later create requests fails, the
helper returns
-1, the caller skips the failed row, and the script continues.That can leave the release with only the subset of replacement files that were
created before the failure.
Reproducer
Using mocked API calls:
DELETE /downloads/release_file/?release=...return204.POST /downloads/release_file/return a created row.POST /downloads/release_file/fail.The script still reaches
Done - 1 files added.Expected behavior
A failed release-file create should fail the publishing run. Any rows created by
that same run should be cleaned up so the command does not finish with a partial
replacement set.