Skip to content

Shorten dist artifact retention - #234

Merged
Bre77 merged 1 commit into
mainfrom
fm/gha-retention-tfa
Nov 24, 2026
Merged

Bre77 merged 1 commit into
mainfrom
fm/gha-retention-tfa

Conversation

@Bre77

@Bre77 Bre77 commented Nov 24, 2026

Copy link
Copy Markdown
Member

The CI dist upload now keeps artifacts for 7 days and the release workflow's python-package-distributions upload for 1 day, instead of the 90-day default. The release artifact is only consumed by the publish and GitHub Release jobs in the same run, and PyPI and the GitHub Release hold the durable copies.

@gitar-bot

gitar-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 🟡 Medium risk 0 closed / 1 findings

Shortening CI and release artifact retention to 7 and 1 days could limit later access to build outputs needed for debugging or recovery.

Shortens CI dist artifact retention to 7 days and the release workflow's python-package-distributions retention to 1 day, down from the 90-day default. The release artifact is only consumed within the same run, and PyPI and GitHub Releases hold the durable copies.

  • Open suggestion: a 1-day retention can break delayed publish-to-pypi approvals or re-runs of publish-to-pypi/github-release after 24 hours, since download-artifact will fail on the expired artifact. A few days of retention (3–7) would still save most storage while covering these recovery cases.
💡 Edge Case: 1-day retention can break delayed PyPI publishes and re-runs of failed jobs

📄 .github/workflows/release.yml:45 📄 .github/workflows/release.yml:51-53 📄 .github/workflows/release.yml:57-61 📄 .github/workflows/release.yml:72-76

publish-to-pypi runs in the pypi environment. If that environment requires a reviewer, the job waits for approval, and GitHub lets that wait last up to 30 days. If someone approves more than 24 hours after gate, or re-runs only the failed publish-to-pypi/github-release job a day later (for example after a PyPI outage or a failed gh release upload), download-artifact fails because the artifact has expired. The only way out is to re-run every job, which rebuilds the dist. A few days of retention (e.g. 3–7) still saves most of the storage and covers these recovery cases.

Keep the release artifact long enough to cover approval delays and re-runs of single jobs
retention-days: 7
🤖 Prompt for agents
Code Review: Shortens CI `dist` artifact retention to 7 days and the release workflow's `python-package-distributions` retention to 1 day, down from the 90-day default. The release artifact is only consumed within the same run, and PyPI and GitHub Releases hold the durable copies.
  
  - Open suggestion: a 1-day retention can break delayed `publish-to-pypi` approvals or re-runs of `publish-to-pypi`/`github-release` after 24 hours, since `download-artifact` will fail on the expired artifact. A few days of retention (3–7) would still save most storage while covering these recovery cases.

1. 💡 Edge Case: 1-day retention can break delayed PyPI publishes and re-runs of failed jobs
   Files: .github/workflows/release.yml:45, .github/workflows/release.yml:51-53, .github/workflows/release.yml:57-61, .github/workflows/release.yml:72-76

   `publish-to-pypi` runs in the `pypi` environment. If that environment requires a reviewer, the job waits for approval, and GitHub lets that wait last up to 30 days. If someone approves more than 24 hours after `gate`, or re-runs only the failed `publish-to-pypi`/`github-release` job a day later (for example after a PyPI outage or a failed `gh release upload`), `download-artifact` fails because the artifact has expired. The only way out is to re-run every job, which rebuilds the dist. A few days of retention (e.g. 3–7) still saves most of the storage and covers these recovery cases.

   Fix (Keep the release artifact long enough to cover approval delays and re-runs of single jobs):
   retention-days: 7

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Approved

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

with:
name: python-package-distributions
path: dist/
retention-days: 1

@gitar-bot gitar-bot Bot Nov 24, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: 1-day retention can break delayed PyPI publishes and re-runs of failed jobs

publish-to-pypi runs in the pypi environment. If that environment requires a reviewer, the job waits for approval, and GitHub lets that wait last up to 30 days. If someone approves more than 24 hours after gate, or re-runs only the failed publish-to-pypi/github-release job a day later (for example after a PyPI outage or a failed gh release upload), download-artifact fails because the artifact has expired. The only way out is to re-run every job, which rebuilds the dist. A few days of retention (e.g. 3–7) still saves most of the storage and covers these recovery cases.

Keep the release artifact long enough to cover approval delays and re-runs of single jobs:

retention-days: 7

Was this helpful? React with 👍 / 👎

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR (configure)

@Bre77
Bre77 merged commit b8e2a35 into main Nov 24, 2026
8 checks passed
@Bre77
Bre77 deleted the fm/gha-retention-tfa branch November 24, 2026 06:21
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