Skip to content

Conversation

jcazevedo
Copy link
Member

This pull request proposes fetching the most recent version we refer to the in the README from the most recent header in the Changelog. We frequently forget to update the VERSION mdoc variable so I think this helps to keep things in sync.

Does this change relate to existing issues or pull requests?

No.

Does this change require an update to the documentation?

This is an update to the documentation.

How has this been tested?

I manually executed docs/mdoc and made sure the VERSION variable was properly filled, resulting in the update to README.md included in this pull request.

@jcazevedo jcazevedo requested a review from bdmendes October 7, 2025 10:36
"VERSION" ->
// This is reading the most recent header from the CHANGELOG that looks like a version, assuming that's the most
// recent version to refer to in the docs.
IO.readLines(file("CHANGELOG.md")).flatMap("""^## \[([0-9.]+)\]""".r.findFirstMatchIn).head.group(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 am fine with this approach. But as food for thought, could we reason about the returned value in comparison to what's in version.sbt? It would be nice to be able to catch an error like a wrong header in the md file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe, but that's hard to solve in general because version.sbt holds the "current" version and this VERSION should include the last published version, so we would need some mechanism able to compare versions (assuming a scheme and snapshot versions). Since an update to this VERSION variable results in an update to the README, I think mistakes are easy to spot as is.

Copy link
Contributor

Choose a reason for hiding this comment

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

Precisely, I was thinking about a semantic check, e.g. look for patch/minor/major bump. But anyway. I think it's perfectly fine this way and a great improvement.

@bdmendes bdmendes merged commit 245f7b7 into master Oct 7, 2025
14 checks passed
@bdmendes bdmendes deleted the read-latest-version-from-changelog-header branch October 7, 2025 12:19
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.

2 participants