What's up with dev in the version number?

AI-generated summary

In a discussion titled ā€œWhat’s up with dev in the version number?ā€ under the Support category, pfaffman noticed that Discourse’s version string now includes -dev (e.g., 3.2.0.beta1-dev) and questioned whether this was intentional. Bas confirmed it was intentional and noted that documentation explaining the change would follow soon. pfaffman suspected the change broke their version-comparison code, possibly used to trigger bootstrapping, and expressed concern. david clarified that the new version format still complies with semantic versioning and is parseable via Gem::Version.new, recommending its use for comparisons. He also pointed to a relevant commit that restructured version.rb to support the suffix. pfaffman acknowledged the issue likely stems from their own code and considered switching to checking commit hashes for upgrade decisions instead. The community offered support for debugging the issue if the code is shared.

    <meta name="generator" content="Discourse 3.2.0.beta1-dev - https://github.com/discourse/discourse version 20481abefcd025fec5f7c586aacc9354bdad94ec">

Version now has dev appended. Is this on purpose?

It is on purpose :slight_smile:

But we should probably explain the reasoning behind it, somewhere in the near future..

I think it broke my code that compared version numbers to decide whether to run a bootstrap, but I haven’t had time to figure out exactly how. :crying_cat_face:

Here’s a summary of the changes:

These new version numbers are still valid semver, and are parseable by Gem::Version.new, so that’s the best way to compare them.

If you were trying to parse version.rb manually, then the relevant change might be this one which restructured the file to support this new suffix.

If you can share the relevant code, then I’m sure we can help to figure it out.

Thanks! I"m not sure yet if it’s the Ansible code that compares the versions or my code that retrieves it. I suspect it’s my code and it’s a problem of my own making.

For the reasons that the -dev got added, I suspect that I should be checking for a commit hash and then figuring out whether to upgrade based on that.