Skip to content

ci: set artifact retention on dist uploads - #75

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

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

Conversation

@Bre77

@Bre77 Bre77 commented Nov 24, 2026

Copy link
Copy Markdown
Member

Sets retention-days on the two dist uploads: 7 days for the CI build artifact and 1 day for the release python-package-distributions artifact, which only needs to live until the publish job in the same run downloads it. Both previously used the 90-day default, so each run kept built wheels and sdists far longer than anything reads them.

@gitar-bot

gitar-bot Bot commented Nov 24, 2026 •

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

Setting CI and release artifact retention to 7 and 1 days shortens access to built distributions, limiting later inspection or recovery.

Sets retention-days on the two dist uploads: 7 days for the CI build artifact and 1 day for the release python-package-distributions artifact. Consider raising the release artifact retention to a few days so that re-running a failed github-release job or a delayed pypi approval after 24 hours does not hit an expired artifact and leave the release half-published.

💡 Edge Case: 1-day retention breaks re-runs and delayed approval of release jobs

📄 .github/workflows/release.yml:80 📄 .github/workflows/release.yml:84-96 📄 .github/workflows/release.yml:100-111

The python-package-distributions artifact is downloaded by two jobs in the same run: publish-to-pypi, which is gated on the pypi environment, and github-release. With retention-days: 1, two things break once 24 hours have passed. First, re-running a failed github-release (for example after a gh release error) fails at download-artifact because the artifact has expired. Second, a pypi approval that waits more than a day hits the same failure. Recovering with "re-run all jobs" rebuilds the dists, but the PyPI upload then fails because that version already exists, so the release is stuck halfway. A few days of retention still saves most of the storage and leaves time to recover.

Keep release dists long enough to re-run failed jobs or approve a delayed deployment
retention-days: 7
🤖 Prompt for agents
Code Review: Sets `retention-days` on the two dist uploads: 7 days for the CI build artifact and 1 day for the release `python-package-distributions` artifact. Consider raising the release artifact retention to a few days so that re-running a failed `github-release` job or a delayed `pypi` approval after 24 hours does not hit an expired artifact and leave the release half-published.

1. 💡 Edge Case: 1-day retention breaks re-runs and delayed approval of release jobs
   Files: .github/workflows/release.yml:80, .github/workflows/release.yml:84-96, .github/workflows/release.yml:100-111

   The `python-package-distributions` artifact is downloaded by two jobs in the same run: `publish-to-pypi`, which is gated on the `pypi` environment, and `github-release`. With `retention-days: 1`, two things break once 24 hours have passed. First, re-running a failed `github-release` (for example after a `gh release` error) fails at download-artifact because the artifact has expired. Second, a `pypi` approval that waits more than a day hits the same failure. Recovering with "re-run all jobs" rebuilds the dists, but the PyPI upload then fails because that version already exists, so the release is stuck halfway. A few days of retention still saves most of the storage and leaves time to recover.

   Fix (Keep release dists long enough to re-run failed jobs or approve a delayed deployment):
   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 breaks re-runs and delayed approval of release jobs

The python-package-distributions artifact is downloaded by two jobs in the same run: publish-to-pypi, which is gated on the pypi environment, and github-release. With retention-days: 1, two things break once 24 hours have passed. First, re-running a failed github-release (for example after a gh release error) fails at download-artifact because the artifact has expired. Second, a pypi approval that waits more than a day hits the same failure. Recovering with "re-run all jobs" rebuilds the dists, but the PyPI upload then fails because that version already exists, so the release is stuck halfway. A few days of retention still saves most of the storage and leaves time to recover.

Keep release dists long enough to re-run failed jobs or approve a delayed deployment:

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 d93e906 into main Nov 24, 2026
16 checks passed
@Bre77
Bre77 deleted the fm/gha-retention-stream 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