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

Continuous (single-digit) versioning #1957

Open
laughedelic opened this issue Apr 22, 2021 · 5 comments
Open

Continuous (single-digit) versioning #1957

laughedelic opened this issue Apr 22, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@laughedelic
Copy link
Contributor

laughedelic commented Apr 22, 2021

Describe the bug

v0 + major bump = null πŸ’₯

To Reproduce

  • latest (and the only) git (annotated) tag is v0
  • default release type is major to always increment the first digit
  • running auto latest --dry-run:
βœ” Latest Release:  v0 (...​)
...
βœ”  success   Calculated SEMVER bump: major
β„Ή  info      Would have created a release on GitHub for version: null

Expected behavior

v0 + major bump = v1

(or generally vN + major bump = v(N+1))

Environment information:

Redacted (private repo):

Environment Information:

"auto" version: v10.20.0
"git"  version: v2.30.2
"node" version: v12.18.1

Project Information:

...
βœ” Current Version: v0
βœ” Latest Release:  v0 (​https://github.com/.../releases/tag/v0​)

βœ” Labels configured on GitHub project 

Standalone Auto installation (non-npm project). Plugins:

{
  "plugins": [
    [
      "docker",
      {
        "registry": "...",
        "image": "..."
      }
    ],
    "released"
  ],
  "shipit": {
    "noChangelog": true
  },
  "latest": {
    "noChangelog": true
  },
  "canary": {
    "force": true
  },
  "labels": [
    {
      "name": "release",
      "changelogTitle": "πŸš€ Enhancement",
      "description": "Any change, feature or enhancement",
      "releaseType": "major",
      "default": true
    },
    {
      "name": "no-release",
      "changelogTitle": "🏠 Internal",
      "description": "Changes that don't touch user-facing code",
      "releaseType": "none"
    }
  ]
}

Additional context

I'm not sure if this behavior is meant to supported, but I'm filing it as a bug because null is never a valid answer πŸ˜„

@laughedelic laughedelic added the bug Something isn't working label Apr 22, 2021
@laughedelic
Copy link
Contributor Author

Another observation: if I remove the docker plugin, version bump works like this: v0 + major bump = v1.0.0. Which sort of makes sense, but isn't what I wanted. In any case, I think it should work at least like this with docker.

I also tried it with git-tag instead of docker and also got null.

@hipstersmoothie
Copy link
Collaborator

Hmm interesting. Auto is heavily built around the idea of semver. Changing this assumption would probably leads to lots of little bugs like this.

How about setting "default: true" on the major label? Then auto would only ever do major bumps and your version would always be something like 1.0.0. Does that work for you?

@hipstersmoothie
Copy link
Collaborator

I don't think that would change what a changelog looks like. Unlabeled prs would default to major though

@laughedelic
Copy link
Contributor Author

How about setting "default: true" on the major label? Then auto would only ever do major bumps and your version would always be something like 1.0.0. Does that work for you?

Yes, this is what we are using at the moment, but it's definitely not the same.

Would you be open to generalizing the way versions are treated in the code? For example, if version is a template, like ${major}.${minor}.${patch} (pseudo-syntax) for SemVer and all version transformations in the code use that template, then this template could be configurable and set to ${major} or ${major}.${minor} or even something more interesting like ${year}.${month}.${patch} (CalVer of sorts).

@JReinhold
Copy link

Would you be open to generalizing the way versions are treated in the code? For example, if version is a template, like ${major}.${minor}.${patch} (pseudo-syntax) for SemVer and all version transformations in the code use that template, then this template could be configurable and set to ${major} or ${major}.${minor} or even something more interesting like ${year}.${month}.${patch} (CalVer of sorts).

Yeah this would be a great addition. We're starting to use auto to release applications, and in those scenarios semver rarely makes sense (when is a change "breaking" or "minor" in an application?). We want to use something like ${year}.${month}.${patch} as that is more human-readable.

It could also just be a plugin release hook that allowed you to override the calculated version that auto uses throughout the pipeline. At first I thought that was what the version hook did, but from the docs it doesn't seem like we're able to return a version number, only act on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants