Skip to content

Conversation

@Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Jul 14, 2025

Version are exposed during build using the {{versions.VERSIONING_SCHEME}} variable.

For example stack versioning variables are exposed as {{versions.stack}}. As well as offering several specialized suffixes to expose components or next version numbers.

image

@Mpdreamz Mpdreamz requested review from a team as code owners July 14, 2025 19:11
@Mpdreamz Mpdreamz self-assigned this Jul 14, 2025
@Mpdreamz Mpdreamz linked an issue Jul 14, 2025 that may be closed by this pull request
2 tasks
@github-actions
Copy link

github-actions bot commented Jul 14, 2025

🔍 Preview links for changed docs

Comment on lines 17 to 19
| `{{versions.stack.next_major}}` | {{version.stack.next_major}} | The next major version |
| `{{versions.stack.next_minor}}` | {{version.stack.next_minor}} | The next minor version |
| `{{versions.stack.base}}` | {{version.stack.base}} | The first version on the new doc system |
Copy link
Contributor

@shainaraskas shainaraskas Jul 14, 2025

Choose a reason for hiding this comment

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

would probably drop the patch segment from these (@lcawl + @colleenmcginnis should confirm they're not needed)

Copy link
Contributor

@colleenmcginnis colleenmcginnis Jul 14, 2025

Choose a reason for hiding this comment

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

I might be too preoccupied with consistency, but I'd rather see a consistent pattern across current/next versions. Something like:

current next format
version.stack version.stack.next #.#.#
version.stack.major_minor version.stack.next_major_minor #.#
version.stack.major_x version.stack.next_major_x #.x
version.stack.major_component version.stack.next_major_component #

I don't have a strong opinion about versions.stack.base.

Copy link
Member Author

Choose a reason for hiding this comment

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

version.stack would be version.stack.current but I see your point.

I think {{version.stack.current}} might be too verbose though.

See also my comment on bases here #1560 (comment)


| Version substitution | result | purpose |
|--------------------------------------|-----------------------------------|-----------------------------------------|
| `{{versions.stack}}` | {{version.stack}} | Current version |
Copy link
Contributor

Choose a reason for hiding this comment

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

in most cases I think we want the base usage to be the major_minor version. might want to make that the "core" and make a versions.stack.patch or something instead

Copy link
Member Author

Choose a reason for hiding this comment

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

Should it be formatted e.g 9.0.0 = 9.0 and 9.0.1 would be 9.0.1 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about that. I think so though?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that the installation instructions would need the full V.R.M but that would not be the general case.

Copy link
Contributor

Choose a reason for hiding this comment

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

in most cases I think we want the base usage to be the major_minor version.

I agree that the installation instructions would need the full V.R.M but that would not be the general case.

Installation instructions and download links are probably the most important use cases for me. 😬

Should it be formatted e.g 9.0.0 = 9.0 and 9.0.1 would be 9.0.1 ?

I think I'd prefer it to be major-minor-patch if only for consistency.

Copy link
Member Author

Choose a reason for hiding this comment

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

I also think the path of least surprise is to have the base be full V.R.M

  • {{versions.stack}}
  • {{versions.stack.base}}
  • {{versions.stack.next_major}}
  • {{versions.stack.next_minor}}

Where the V.R and V.x and V variants can all be obtained using a *.suffix.

Copy link
Member Author

Choose a reason for hiding this comment

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

I opened #1563 as a completely new approach that allows a more generic approach to reformatting variables.

In that PR we only expose:

  • {{versions.stack}}
  • {{versions.stack.base}}

With operators to get a specific format e.g

  • {{versions.stack | M.x }}

Comment on lines 182 to 186
key = $"version.{name}.next_minor";
_substitutions[key] = new SemVersion(current.Major, current.Minor + 1, current.Patch, current.Prerelease, current.Metadata);

key = $"version.{name}.next_major";
_substitutions[key] = new SemVersion(current.Major + 1, current.Minor, current.Patch, current.Prerelease, current.Metadata);
Copy link
Member

Choose a reason for hiding this comment

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

Are these actually required?

I'm afraid that these variables will cause confusion and will output an unexpected version if used wrongly by the user.

Copy link
Member

Choose a reason for hiding this comment

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

I can't think of a use case where you want to have a next version that changes over time.

Can you explain the use case you were thinking of?

Copy link
Member Author

Choose a reason for hiding this comment

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

@lcawl and wider @elastic/docs-tech-leads can you confirm whether we have a use-case for next major/minor as variables?

Copy link
Member Author

Choose a reason for hiding this comment

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

Also keen to hear thoughts on {{versions.*}} vs {{version.*}} :)

Copy link
Member Author

Choose a reason for hiding this comment

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

These are no longer exposed directly but can be obtained through variable mutation operators. See #1563

Copy link
Member Author

Choose a reason for hiding this comment

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

Sticking with {{version.*}} for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

As per my comment here: #1560 (comment) next major and minor are not exposed through variables but can be obtained using variable mutations.

Mpdreamz and others added 2 commits July 15, 2025 09:37
* Add support for variable operator syntax

* do not report version variables as unused

* Allow a space after {{

* carry trimming over to split

* Temporarily make variables with spaces that are not found hints, we used to not do anything here

* flip ternary
@Mpdreamz Mpdreamz merged commit 333d0c5 into main Jul 16, 2025
17 checks passed
@Mpdreamz Mpdreamz deleted the feature/expose-version-variables branch July 16, 2025 08:47
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.

Add support for *-version attributes in the docs

6 participants