Skip to content

fix(index): cap maintained versions at three majors - #15632

Open
skjnldsv wants to merge 1 commit into
masterfrom
fix/index-duplicate-supported-stable-label
Open

skjnldsv wants to merge 1 commit into
masterfrom
fix/index-duplicate-supported-stable-label

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Sep 17, 2026

Copy link
Copy Markdown
Member

The index on docs.nextcloud.com labelled both 33 and 32 "This documents the last supported stable version of Nextcloud", visible on the page deployed by #15631.

Two things caused that. detect_versions() selected every version inside the 12-month support window, and with a 4-month release cadence four versions sit inside that window for the ~10 days between a release and the oldest one's end of life (35 released 2026-09-15, 32 EOL 2026-09-26). build-index.php then derived the section role from the loop index:

$index = ($idx + 1 === count($stableVersions) && count($stableVersions) > 1) ? 3 : $idx + 1;

generate_section() only defines roles 0 to 3, so with four entries index 2 got $idx + 1 = 3 and index 3 got 3 from the last-element rule. Both render the same sentence. At five entries the role falls through to an empty note and the section silently loses its status line.

The supported set is now capped at MAINTAINED_MAJORS = 3 in detect-versions.php, matching the maintenance schedule, and exposed as supported so build-index.php consumes it instead of recomputing the window itself. Roles became named constants assigned by position (first, last, anything between) so the collision cannot come back with a longer list. verify-index.php now fails on a duplicated or missing status note, which generate-top-index.yml already runs on every PR.

The conf.py version_start fallback goes 32 → 33 because build-docs.yml fails the master build when that fallback disagrees with lowest_stable.

Capping stops rebuilding server/32 nine days before 32's published EOL. The deploy step only adds version folders and never prunes, so the existing tree stays and the legacy block keeps linking it, PDFs and ePubs included.

☑️ Resolves

No issue filed, spotted on the deployed page from #15631.

🖼️ Screenshots

✅ Checklist

  • I have built the documentation locally and reviewed the output
  • Screenshots are included for visual changes
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

Verified by regenerating the index against the live release data and diffing it against the deployed one, the only change is 32 moving into the legacy block:

$ php build/build-index.php 35 34 33 32 … 12
📦 Maintained versions: 35, 34, 33
$ php build/verify-index.php
✓ All 4 maintained version sections carry a distinct status note

Both new assertions were checked against a deliberately broken index (note "last supported stable" appears 2 times, 4 maintained version sections but 3 status notes). The Sphinx manuals were not rebuilt, so the conf.py version picker change is reasoned about rather than observed: range(33, 35) yields 33 and 34, plus stable 35 and latest 36.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

Nextcloud maintains the three most recent majors, but detect-versions.php
selected every version inside the 12-month support window. With a 4-month
cadence those overlap for about ten days after each release, so 35, 34, 33
and 32 were all listed as maintained.

build-index.php then derived the section role from the loop index, which
only defines 0..3, so the fourth version collided with the "last supported
stable" role and the note was rendered twice, on 33 and on 32.

Roles are now named constants assigned by position (first, last, middle)
instead of arithmetic on the index, so a longer list cannot collide.
verify-index.php rejects a duplicated or missing status note.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

🔍 Open preview →

No RST documentation pages changed in this PR.

Last updated: Thu, 17 Sep 2026 14:02:16 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant