Skip to content

Bug: add_to_pydotorg can finish after partial release-file creation #398

@e-q

Description

@e-q

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:

  1. Make DELETE /downloads/release_file/?release=... return 204.
  2. Make the first POST /downloads/release_file/ return a created row.
  3. Make the second POST /downloads/release_file/ fail.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions