Skip to content
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

Fix snapshot versioning #2412

Closed
ainar-g opened this issue Dec 10, 2020 · 2 comments
Closed

Fix snapshot versioning #2412

ainar-g opened this issue Dec 10, 2020 · 2 comments
Assignees
Labels
infrastructure CI, CD, releases, etc. P3: Medium
Milestone

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Dec 10, 2020

Our current snapshot versioning scheme is broken according to SemVer. For example, every snapshot release after v0.104.3 is built as something like v0.104.3-SNAPSHOT-1234abcd, but that would make it sort before v0.104.3. It also doesn't account for the fact that a Git hash can always be numeric-only, which can also affect sorting in weird ways. What we should do instead is something like:

NEXT_MINOR_RELEASE-alpha.NUM.gCOMMIT_HASH

Where NUM is the number of commits since the last real release, and COMMIT_HASH is the hash of the commit. The g prefix is required to force alphabetical sorting as opposed to a numeric one.

We could also adopt the practice of having a VERSION file in the repo that is updated before every release. This way, ZIP downloads of the repo will also be able to build with the correct version.

Related:

  1. Simplify CI/CD scripts #2276
  2. Building SNAPSHOT with an error called "invalid snap version cannot be longer than 32 characters (got: 33)" #2410
@ainar-g ainar-g added P2: High infrastructure CI, CD, releases, etc. labels Dec 10, 2020
@ainar-g ainar-g added this to the v0.106.0 milestone Dec 10, 2020
@ainar-g ainar-g self-assigned this Dec 10, 2020
adguard pushed a commit that referenced this issue Dec 10, 2020
Merge in DNS/adguard-home from 2410-fix-snapshot to master

Updates #2410.
Updates #2412.

Squashed commit of the following:

commit 6718e01
Merge: ba5fc4c e02308d
Author: Ainar Garipov <[email protected]>
Date:   Thu Dec 10 14:36:19 2020 +0300

    Merge branch 'master' into 2410-fix-snapshot

commit ba5fc4c
Author: Ainar Garipov <[email protected]>
Date:   Thu Dec 10 13:12:12 2020 +0300

    all: fix snapshot release version length
@stale stale bot added the wontfix label Feb 13, 2021
@AdguardTeam AdguardTeam deleted a comment from stale bot Feb 13, 2021
@stale stale bot removed the wontfix label Feb 13, 2021
@ainar-g
Copy link
Contributor Author

ainar-g commented Mar 10, 2021

We've merged the first part of it—the one about better snapshotting—into master today. New snapshot versions look like v0.123.0-a.56+abcd1234, where 123 is the next minor (not patch) release, and 56 is the number of commits since the last minor (not patch) release.

The next steps are a mechanism for ZIP downloads and a mechanism for release branches.

@ameshkov ameshkov modified the milestones: v0.106.0, v0.107.0 Mar 15, 2021
@ainar-g
Copy link
Contributor Author

ainar-g commented May 26, 2021

It seems like source code archives containing the version isn't a high priority for most users. Release branches seem to be working well. I think there isn't anything left to do here.

@ainar-g ainar-g closed this as completed May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure CI, CD, releases, etc. P3: Medium
Projects
None yet
Development

No branches or pull requests

2 participants