Repository navigation
Conversation
Releases are listed by creation time (newest first), so any pre-release appearing after a synced stable release is older than it and provides no newer builds. With skip_old_pre_release enabled (default false), such pre-releases are skipped without consuming the pre-release quota, so limits can be spent on newer entries instead.
There was a problem hiding this comment.
🟡 Changes recommended
Separate-limit mode can fetch the entire release history after filtering makes the remaining pre-release quota impossible to fill.
1 open finding
What changed in this PR
Adds optional filtering of older pre-releases to the GitHub release sync process.
Changes:
- Introduces
skip_old_pre_release, disabled by default. - Tracks accepted stable releases and skips subsequent pre-releases without consuming their quota.
| File | Description |
|---|---|
| github-release.py | Adds configuration, stable-release tracking, and pre-release filtering. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| n_prerelease += 1 | ||
| else: | ||
| n_release += 1 | ||
| seen_stable = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds a new
skip_old_pre_releaseoption (defaultfalse, backward compatible). When enabled together with pre-release syncing, pre-releases older than a stable release are skipped.GitHub's releases API returns releases sorted by creation time, newest first. Once a stable (non-draft, non-prerelease) release has been accepted for syncing, every later pre-release in the list is older than it. Syncing such pre-releases serves no purpose, since the mirror can no longer provide "a newer pre-release than the stable release".
Behavior
pre_release: true, orrelease_versions/pre_release_versionsconfigured).versions/pre_release_versions), so the quota can be used by pre-releases newer than the stable release.release_versions: 0(or the stable quota leaves no stable release accepted), all pre-releases are still synced: the "seen a stable release" flag is only set when a stable release is actually accepted. Drafts never set the flag.falsekeeps existing behavior unchanged.Example
{ "repo": "M2Team/NanaZip", "release_versions": 1, "pre_release_versions": 1, "skip_old_pre_release": true }Testing
Added a mock test covering 7 scenarios: baseline without the flag (older pre-release consumes quota), flag enabled (quota goes to the newer stable release), stable release newest (all pre-releases skipped),
release_versions: 0(all pre-releases kept), separate-limits cross-check with/without the flag, and a pre-release-only repository. All 7 pass.