Skip to content

Retry coverage publication after concurrent pushes - #763

Draft
brandonganem wants to merge 1 commit into
py-cov-action:mainfrom
brandonganem:brandonganem/retry-coverage-publication-20261012
Draft

brandonganem wants to merge 1 commit into
py-cov-action:mainfrom
brandonganem:brandonganem/retry-coverage-publication-20261012

Conversation

@brandonganem

@brandonganem brandonganem commented Oct 12, 2026 •

Copy link
Copy Markdown

No linked issue.

Summary

Concurrent publishers can advance the coverage branch between checkout and push. Retry only the exact branch's porcelain fetch first or non-fast-forward rejection, with at most three push attempts.

  • Keep both publication histories without force-pushing, including simultaneous creation of an orphan report branch.
  • Restore each operation's complete committed snapshot. Preserve independent remote paths, remove stale directory contents, and avoid replaying already-consumed ReplaceDir sources.
  • Do not merge individual JSON fields from coupled reports. The last successful publication supplies a same-path snapshot; earlier reports remain in Git history.
  • Propagate authentication, policy, fetch, inspection, and exhausted-retry failures. Clear failed report changes before returning to the original checkout so cleanup does not mask an inspection error.

Validation

  • uv run --no-sync --offline pytest tests/unit tests/integration — passed: 328 tests on Python 3.14.8.
  • uv run --no-sync --offline prek run --all-files — passed: all configured formatting, lint, type, README, workflow, and security-lint checks.
  • Built the production Docker action for Linux amd64. Four offline, synthetic real-Git publication scenarios passed in that image on Python 3.14.8. These checks were emulated on an ARM host, not native Linux CI.
  • Hosted CI passed: Run linters, Run tests & display coverage, and Autofix. See the CI run.
  • GitHub-hosted end-to-end tests were not run. They require maintainer-controlled accounts and can delete repositories or change Git configuration.

Checklist:

  • Tests
    • (not applicable?)
  • Documentation
    • (not applicable?)

Preserve both histories and replay complete committed report snapshots with bounded retries. Keep permanent failures visible and restore the source checkout on Git errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1696b8f-58b8-4381-92a1-a3b52fb3ce13
@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  coverage_comment
  storage.py
Project Total  

This report was generated by python-coverage-comment-action

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant