canonical / pebble

Pebble is a lightweight Linux service manager with layered configuration and an HTTP API.
https://canonical-pebble.readthedocs-hosted.com/
GNU General Public License v3.0
149 stars 54 forks source link

Versioned releases #202

Closed jnsgruk closed 1 year ago

jnsgruk commented 1 year ago

Given that this project is now used in:

I think it's important that we start to land some versioned releases. As we start to see more usage, it'd be useful to enable people to report the version they're on with some clarity, and we could also begin a "public roadmap" / "release log" similar to snapd and juju.

benhoyt commented 1 year ago

Makes sense. I think we want Pebble to be able to say its version number, too, meaning we have to include a version number in a .go file somewhere. Is the best way to do that just good old fashioned const Version = "1.2.3" in a version.go file that we update by hand? Mildly annoying, but probably simplest.

If it's just a git tag, that's hard to embed in the binary, right? Or it will depend on how Pebble is built.

jnsgruk commented 1 year ago

Looks like we already have some scripts and infra in place for generating versions, so shouldn't be too hard.

I've also used -ldflags -X main.version=$(git describe --tags) or similar before. Either approach works fine and prevents us from needed to hard-code a version using a human - I think doing it based on tags would be most sensible?