Skip to content

[Bug]: bumpVersionsForPrerelease() rolls back instead of forward, if a commit is reverted #5256

@mikeharder

Description

@mikeharder

Describe the bug

If a commit to a package is rolled back, the package will fail to publish, and the next change to the spec will also fail to publish, due to how the version numbers are calculated.

One "fix" could be that we need to be disciplined to never revert the changelogs under .chronus/changes. If you need to git revert a previous commit, you'll still need to add a new changelog, and leave the previous changelog present. Perhaps some team members already knew this, but I did not.

Reproduction

  1. Add a commit to change a package (with a changelog under .chronus/changes)
  2. The dev version of the package should be incremented (from say 1.0.0-dev.1 to 1.0.0-dev.2), and the package should be published
  3. Revert the commit in step Add PR Validation #1

Expected: Dev version of the package should be incremented again, and the package should be published
Actual: Since the log under .chronus/changes was also reverted, the dev version was rolled back to 1.0.0-dev.1, and the package could not be published since it already exists.

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions