fix: prevent duplicate entries in NIGHTLY_BUILD_SCHEDULE#1229
Merged
TRNWWZ merged 1 commit intoJun 22, 2026
Conversation
846f2d7 to
2a0de4d
Compare
- remove_version: remove ALL occurrences instead of just first (list.remove only removes one) - add_next_versions: skip append if version already present (idempotency) - Apply same dedup pattern to patch_base_versions, minor_base_versions, major_base_versions - Add 3 unit tests for deduplication behavior
2a0de4d to
a03f16d
Compare
TRNWWZ
approved these changes
Jun 22, 2026
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.
Problem
NIGHTLY_BUILD_SCHEDULEaccumulates duplicate entries because:add_next_versions()appends without checking if version already existsremove_version()useslist.remove()which only removes the first occurrenceThis causes
remove-nightly-build.ymlto appear successful but leave residual entries, resulting in unintended nightly rebuilds.Fix
remove_version: use list comprehension to remove ALL occurrencesadd_next_versions: guard all appends withif v not in listcheckactive_nightly_builds,patch_base_versions,minor_base_versions,major_base_versionsTesting
pytest test/test_nightly_build_helper.py -v→ 15/15 passImpact
Operations become idempotent — calling them multiple times produces the same result. No change to happy-path behavior.