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

How to keep the metadata part when bumping version? #80

Open
martinm82 opened this issue Aug 7, 2019 · 3 comments
Open

How to keep the metadata part when bumping version? #80

martinm82 opened this issue Aug 7, 2019 · 3 comments

Comments

@martinm82
Copy link

Hello,

I have reported already the same question on the original project but then found this one which seems to be actively maintained.

We are using semantic versioning (semver.org) in our projects and stumbled upon the following problem:

We have some projects that extend some other upstream projects with some functionality (eg. forks). We want to version our projects with the following semver schema:

1.2.3+4.2.1
1.2.3-SNAPSHOT+4.2.1

where 1.2.3 is our own version of the project and 4.2.1, the metadata part of semver, which reflects the upstream version our changes are based on.

When releasing our versions we would like to have the following flow:

# current_version=1.2.3-SNAPSHOT+4.2.1
$ bumpversion release
# current_version=1.2.3+4.2.1
$ bumpversion patch
# current_version=1.2.4-SNAPSHOT+4.2.1

Right now we use the following configuration:

parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-zA-Z]+))?
serialize =
  {major}.{minor}.{patch}-{release}
  {major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = rel
values =
  dev
  rel

Is it possible to implement this kind of workflow where the metadata part (eg. +4.2.1) won't be touched?
I have tried various things but did not come up with something that just leaves the metadata part.
Also it would be great to have one config that covers the case with +metadata and without it.

Thanks a lot.

@florisla
Copy link
Collaborator

Note: ADVbumpversion implemented this as a new option in the part config called independent. See https://github.com/andrivet/ADVbumpversion.

The only workaround I know is to supply the metadata as an environment variable.

I think the independent flag is cleaner so I'd consider that a good feature to support.

@c4urself
Copy link
Owner

I like the independent flag -- on that note it may be a good idea to reach out to @andrivet and see if incorporating that will allow all use-cases supported by the fork to be supported by us so that we can cease the fork...

@andrivet
Copy link
Contributor

Can I help for something to help going on with this "issue"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants