-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
theme: prefix git tags with 'v' to support go module versioning #514
Comments
I can not promising anything, yet. Personally I dislike the arbitrary Also, it's unclear how to proceed with the existing tags. And what to do with the current tag |
Cool np. I personally hate the My recommendation for the existing tags is to not do anything. Leave the old release tags as-is as it's unlikely that new customers are going to pin to old versions. For the If you choose to adopt this, the upgrade would require existing customers to update their import and theme path to add the major version suffix, so my recommendation is to start this as a new major version release: Not a huge issue by any means and not all major hugo theme providers are doing this. Just an observation with potential to improve ongoing CX. |
Also, I'm willing to send over a PR for this. |
Thanks ❤️ for the advises. I'll first have to decide which way to go. If I then need further help, I'll post to this issue. |
@tlindsay42 I am willing to do this for an upcoming v6 and it shouldn't be complicated as the current GitHub actions are already modifying files during the release. Anyways, with this kind of versioning what's the command to always use the latest version - regardless of a major version change and also, what's the command to stay on a minor release but getting all patch release versions? At the moment I am providing tags for this. Eg. the version |
Sounds good & agreed.
If you proceed, this project will inherit golang's minimal version selection philosophy, which means that major version changes require explicit changes by the customer. To perform a major version upgrade, they'll have to do 3 things:
Golang doesn't offer a version constraint mechanism for accomplishing this unlike pretty much every other major package management system. It's baffling and I hate it, but that's what they decided on and is what it is.
Nah, but it shouldn't impact your customers much because customers that consume your theme via hugo modules are still ultimately pinned to commits despite the tag via the go module fallback of pseudo-versioning. Same for any customers that consume your theme via submodule, as git submodules are also pinned to commits and (still) has no interop with git tags. Even more so for anyone that consumes your theme via download. IMO, hugo modules are the best of the 3 (for both customers and theme providers), but given the poor documentation and unintuitive aspects around these, I recommend adding some documentation to help out your customers. |
During the last year, I've changed my mind a bit about this. While in general, go versioning sounds like a preferable goal, I am reluctant of implementing it due to the fact that the build of Hugo's theme repository is quite brittle if theme authors are switching major verion numbers. This might be due to the fact that they are unexperienced in go versioning - but so am I. It's not off the table, but will not happen in my foreseeable future. |
Noticed that release tags currently don't include the
v
prefix required in the go module version spec, so customers using this theme via hugo modules currently use the fallback of the pseudo-version (v0.0.0-{commit timestamp}-{commit hash}). This makes it slightly more difficult for customers to determine what version they're using.I created a fork and cut a release to illustrate the difference.
Here's what Relearn
5.12.5
looks like in a customer'sgo.mod
andgo.sum
when added viahugo mod get github.com/McShelby/[email protected]
:go.mod
go.sum
And here's what Relearn
5.12.5
looks like in a customer'sgo.mod
andgo.sum
files when added viahugo mod get github.com/tlindsay42/hugo-theme-relearn/[email protected]
, which is more straightforward for customers.go.mod
go.sum
To implement this successfully, you'll also need to append the current major version to your module statement in go.mod L1, and bump it as part of the workflow for major version changes.
If you choose to proceed, it's probably worth adding a note and/or example to the installation section to help out customers unfamiliar with go modules, as neither Hugo, nor Golang, do a great job of explaining how this works in an easily approachable manner (especially for major versions above v1).
Example:
Customers should run the following to add the module
Add the theme to the config
And add the module import statement to the config
The text was updated successfully, but these errors were encountered: