Skip to content

fix: milestone lookup pagination + first-beta next-major#87

Merged
skjnldsv merged 3 commits into
mainfrom
fix/milestone-script-bugs
Jun 8, 2026
Merged

fix: milestone lookup pagination + first-beta next-major#87
skjnldsv merged 3 commits into
mainfrom
fix/milestone-script-bugs

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Two bugs in the milestone scripts (merged in #84), surfaced while dry-running a real v34.0.0 update. One commit each.

1. Paginate milestone lookups (fix: paginate milestone lookups across all pages)

find_milestone (update) and the audit's milestone fetch queried milestones?state=all&per_page=100 without --paginate, so they only saw the first 100 milestones. nextcloud/server has >100 — the current milestone (Nextcloud 34 = #333) sits on a later page and was never found, so the repo was silently skipped (No milestone found ... skipping).

Impact: the busiest repo got no milestone management at all.

Fix: add --paginate to both calls (--paginate + --jq filters per page and concatenates, so the lookup still works). Test fake-gh now caps a single page at 100 entries; new paginated-lookup scenario puts the target past page 1 to guard it.

2. First beta creates the next major (fix: first beta creates the next major milestone (N+1))

The first-beta path created Nextcloud N (the tag's own major), which already exists from the previous cycle. The first beta of major N opens development of N+1, so it must create Nextcloud N+1 — e.g. v34.0.0beta1Nextcloud 35.

Fix: Nextcloud $((MAJOR + 1)); README example + first-beta/first-beta-idempotent scenarios updated.

Testing

  • bash tests/milestone-scripts/run.sh — 19 scenarios pass (incl. new paginated-lookup)
  • bash tests/milestone-scripts/unit.sh — 13 pass
  • shellcheck clean
  • Negative control: removing --paginate makes paginated-lookup fail; reverting the N+1 change breaks first-beta

skjnldsv added 2 commits June 8, 2026 14:37
find_milestone (update) and the audit's milestone fetch queried
`milestones?state=all&per_page=100` without --paginate, so they only ever
saw the first 100 milestones. Busy repos like nextcloud/server have well
over 100, so the current milestone sits on a later page and was never
found - the repo was silently skipped ("No milestone found").

Add --paginate to both calls. The test fake-gh now caps a single page at
100 entries (only --paginate walks further), and a new paginated-lookup
scenario places the target milestone past the first page to guard the fix.

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The first-beta path created "Nextcloud N" (the tag's own major), but that
milestone already exists from the previous cycle. The first beta of major N
is what opens development of N+1, so it should create "Nextcloud N+1"
(e.g. v34.0.0beta1 -> Nextcloud 35).

Use $((MAJOR + 1)) for the milestone name and update the README example and
the first-beta / first-beta-idempotent test scenarios accordingly.

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added the bug Something isn't working label Jun 8, 2026
The two boolean inputs were easy to confuse. Spell out that dry_run
previews the update (and skips the audit), while audit_only skips the
update and only reports inconsistencies.

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv merged commit 24e6dbb into main Jun 8, 2026
2 checks passed
@skjnldsv skjnldsv deleted the fix/milestone-script-bugs branch June 8, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

1 participant