Skip to content

Conversation

@cotti
Copy link
Contributor

@cotti cotti commented Dec 8, 2025

This PR provides a set of adjustments to the inner workings of versioning in the context of applies_to. This draft will be further updated with front-end changes, but badge-related changes can be checked independently.

It is part of #2135.

Problem description

Describing versions within applicability contains several quirks and limitations, such as:

  • Lack of version range support: Authors can only specify single versions, making it difficult to document features that span multiple versions
  • Patch-level badge overload: Showing full Major.Minor.Patch versions creates visual clutter, specially for more complex applicability scenarios
  • Missing base version context: When no version is specified for versioned products, readers don't know they're viewing version-specific documentation (e.g., "Stack 9.0+")

Proposed changes

Version Specification (VersionSpec)

A new VersionSpec class has been created. It builds on SemVersion, and supports the following versioning types:

  • Greater than or equal to: x.x+ or x.x (default)
  • Range (inclusive): x.x-y.y
  • Exact version: =x.x
// Examples:
stack: ga 9.1          // 9.1+ (default behavior)
stack: ga 9.1+         // 9.1+ (explicit)
stack: preview 9.0-9.2 // Range
stack: beta =9.1       // Exact version only

Simplified Badge Display

  • Badges now display Major.Minor versions only, regardless of patch specification:
    9.5.0, 9.5.1, 9.5.6 -> all display as 9.5 or 9.5+

Base Version Display

When no version is specified for versioned products, the base version is now shown:

Before: stack: ga -> Badge shows just "Stack"
After: stack: ga -> Badge shows "Stack│8.0+" (assuming base = 8.0)

Unversioned products continue to show no version.

Validation Rules

Implemented validation in ApplicableToYamlConverter:

  • One version declaration per lifecycle
  • Only one "greater than or equal" per entry is allowed
  • Ranges must not have a minimum version larger than the maximum version
  • Overlapping version ranges are not allowed
# Valid:
stack: ga 9.2+, beta 9.0-9.1
stack: ga 9.2, beta =9.1

# Invalid - throws a warning:
stack: ga 9.2+, beta 9.0+     # Multiple >=
stack: ga 9.2+, beta 9.0-9.2  # Overlapping ranges

Tooltip -> Popover overhaul

The badge tooltip was replaced by a popover component.

image

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

🔍 Preview links for changed docs

Copy link
Member

@reakaleek reakaleek left a comment

Choose a reason for hiding this comment

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

There are two test cases that made me curious.

Otherwise, LGTM.

Nice work.

"sub_type": "stack",
"lifecycle": "ga",
"version": "9999.9999.9999"
"version": "all"
Copy link
Member

Choose a reason for hiding this comment

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

➕ thanks for fixing this and making it properly.

@reakaleek
Copy link
Member

I'm wondering a bit why there are so many warnings. What's the reason we can't do this backwards compatible?

Copy link
Contributor

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

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

LGTM functionally what's implemented here works as expected.

  • Some corner cases (that are more about handling contribution mistakes or very rare scenarios) might still require fixing or better validation handling
  • This PR doesn't seem to implement the x.x.x! syntax to force showing patches - this is fine for me as I don't think we need it

It'd be nice to get this merged soon so we can do a cleanup pass with the cumulative docs group on the content, so that we can re-enable warnings asap.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Applies_to updates: allow version ranges and limit versions to Major.Minor

7 participants