Skip to content

Fix documentation switcher generation for 2.+ releases#6246

Merged
JanuszL merged 1 commit intoNVIDIA:mainfrom
JanuszL:fix_switcher_generation
Mar 5, 2026
Merged

Fix documentation switcher generation for 2.+ releases#6246
JanuszL merged 1 commit intoNVIDIA:mainfrom
JanuszL:fix_switcher_generation

Conversation

@JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Mar 3, 2026

  • The documentation switcher previously assumed a 1 major
    current version and did not handle cases for 2.+.
    This PR resolves that issue and adds a TODO for supporting
    additional major release logic if needed in the future.

Category:

Bug fix (non-breaking change which fixes an issue)

Description:

  • The documentation switcher previously assumed a 1 major
    current version and did not handle cases for 2.+.
    This PR resolves that issue and adds a TODO for supporting
    additional major release logic if needed in the future.

Additional information:

Affected modules and functionalities:

Key points relevant for the review:

  • NA

Tests:

  • Existing tests apply
    • check created docs from the build
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

- The documentation switcher previously assumed a 1 major
  current version and did not handle cases for 2.+.
  This PR resolves that issue and adds a TODO for supporting
  additional major release logic if needed in the future.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL
Copy link
Contributor Author

JanuszL commented Mar 3, 2026

!build

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR successfully fixes the documentation version switcher in docs/conf.py for DALI 2.x releases. The previous code assumed a single major version (1.x) and broke when generating docs for 2.x.

What changed:

  • Added a new loop to generate switcher entries for releases of the current major version (e.g., 2.0, 2.1, etc.)
  • Changed the pre-2.0 hardcoded range from dynamic to fixed (10–53) to ensure all 1.x releases are captured
  • Added a TODO for future handling of additional major releases

Assessment:
The fix is correct and achieves its goal. It properly generates version entries for 2.x builds while preserving existing 1.x and 0.x handling. The TODO comment appropriately defers broader major-version refactoring for future work.

Confidence Score: 5/5

  • The PR safely fixes the documentation switcher for 2.x releases without introducing regressions for existing 1.x/0.x paths. Deferred work is appropriately flagged with a TODO for future refactoring.
  • The fix is narrow, correct, and well-scoped. It adds a new loop for the current major version (2.x) and preserves all existing 1.x and 0.x handling. Concerns about edge cases (v_major==1 duplicates, future 2.34+ URL conventions) are part of broader major-version refactoring that the author appropriately deferred with a TODO comment. The change achieves its stated goal without introducing regressions for the primary use case (v_major >= 2).
  • No files require special attention.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Start: parse version_short] --> B["Extract v_major and v_minor\nfrom version_short"]
    B --> C["Loop: range(0, v_minor + correction)\nAppend v_major.i entries<br/>for current major version"]
    C --> D["TODO: handle major releases\n2..current-1"]
    D --> E["Pre-2.0 loop: range(10, 54)\nAppend 1.10–1.53<br/>with short_user for >= 34"]
    E --> F["Append 1.0–1.9<br/>with legacy dali_1i0 format"]
    F --> G["Append 0.x versions<br/>with various formats"]
    G --> H["Sort by Version descending"]
    H --> I["Insert current release at index 0"]
    I --> J["Insert 'main unstable' at index 1"]
    J --> K["Trim to 10 entries"]
    K --> L["Append 'older releases' link"]
    L --> M["Validate and write switcher.json"]
Loading

Last reviewed commit: 3c04ab3

1 similar comment
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR successfully fixes the documentation version switcher in docs/conf.py for DALI 2.x releases. The previous code assumed a single major version (1.x) and broke when generating docs for 2.x.

What changed:

  • Added a new loop to generate switcher entries for releases of the current major version (e.g., 2.0, 2.1, etc.)
  • Changed the pre-2.0 hardcoded range from dynamic to fixed (10–53) to ensure all 1.x releases are captured
  • Added a TODO for future handling of additional major releases

Assessment:
The fix is correct and achieves its goal. It properly generates version entries for 2.x builds while preserving existing 1.x and 0.x handling. The TODO comment appropriately defers broader major-version refactoring for future work.

Confidence Score: 5/5

  • The PR safely fixes the documentation switcher for 2.x releases without introducing regressions for existing 1.x/0.x paths. Deferred work is appropriately flagged with a TODO for future refactoring.
  • The fix is narrow, correct, and well-scoped. It adds a new loop for the current major version (2.x) and preserves all existing 1.x and 0.x handling. Concerns about edge cases (v_major==1 duplicates, future 2.34+ URL conventions) are part of broader major-version refactoring that the author appropriately deferred with a TODO comment. The change achieves its stated goal without introducing regressions for the primary use case (v_major >= 2).
  • No files require special attention.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Start: parse version_short] --> B["Extract v_major and v_minor\nfrom version_short"]
    B --> C["Loop: range(0, v_minor + correction)\nAppend v_major.i entries<br/>for current major version"]
    C --> D["TODO: handle major releases\n2..current-1"]
    D --> E["Pre-2.0 loop: range(10, 54)\nAppend 1.10–1.53<br/>with short_user for >= 34"]
    E --> F["Append 1.0–1.9<br/>with legacy dali_1i0 format"]
    F --> G["Append 0.x versions<br/>with various formats"]
    G --> H["Sort by Version descending"]
    H --> I["Insert current release at index 0"]
    I --> J["Insert 'main unstable' at index 1"]
    J --> K["Trim to 10 entries"]
    K --> L["Append 'older releases' link"]
    L --> M["Validate and write switcher.json"]
Loading

Last reviewed commit: 3c04ab3

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@JanuszL
Copy link
Contributor Author

JanuszL commented Mar 4, 2026

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [45298725]: BUILD STARTED

@stiepan stiepan self-requested a review March 4, 2026 10:43
@stiepan stiepan self-assigned this Mar 4, 2026
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [45298725]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [45298725]: BUILD PASSED

@JanuszL JanuszL merged commit 8eff681 into NVIDIA:main Mar 5, 2026
7 checks passed
@JanuszL JanuszL deleted the fix_switcher_generation branch March 5, 2026 06:20
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