Skip to content

fix: prevent duplicate entries in NIGHTLY_BUILD_SCHEDULE#1229

Merged
TRNWWZ merged 1 commit into
aws:mainfrom
bhavya2109sharma:fix/nightly-schedule-deduplication
Jun 22, 2026
Merged

fix: prevent duplicate entries in NIGHTLY_BUILD_SCHEDULE#1229
TRNWWZ merged 1 commit into
aws:mainfrom
bhavya2109sharma:fix/nightly-schedule-deduplication

Conversation

@bhavya2109sharma

Copy link
Copy Markdown
Contributor

Problem

NIGHTLY_BUILD_SCHEDULE accumulates duplicate entries because:

  • add_next_versions() appends without checking if version already exists
  • remove_version() uses list.remove() which only removes the first occurrence

This causes remove-nightly-build.yml to appear successful but leave residual entries, resulting in unintended nightly rebuilds.

Fix

  • remove_version: use list comprehension to remove ALL occurrences
  • add_next_versions: guard all appends with if v not in list check
  • Applied to all lists: active_nightly_builds, patch_base_versions, minor_base_versions, major_base_versions

Testing

  • All 12 existing tests pass (no behavior change for normal case)
  • Added 3 new tests for deduplication scenarios
  • pytest test/test_nightly_build_helper.py -v → 15/15 pass

Impact

Operations become idempotent — calling them multiple times produces the same result. No change to happy-path behavior.

@bhavya2109sharma bhavya2109sharma requested a review from a team as a code owner June 12, 2026 16:28
@bhavya2109sharma bhavya2109sharma force-pushed the fix/nightly-schedule-deduplication branch from 846f2d7 to 2a0de4d Compare June 12, 2026 16:30
- 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
@TRNWWZ TRNWWZ merged commit 5e09167 into aws:main Jun 22, 2026
1 check passed
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.

4 participants