question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't bump a part if a parent part has its 'final' ('production') value

See original GitHub issue

bump2version 0.5.11

Here’s my config:

[bumpversion]
current_version = 0.2.0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<suffix>[a-z]+))?(\.(?P<build>\d+))?
serialize = 
	{major}.{minor}.{patch}-{suffix}.{build}
	{major}.{minor}.{patch}-{suffix}
	{major}.{minor}.{patch}

[bumpversion:part:suffix]
optional_value = prod
values = 
	dev
	prod

[bumpversion:file:VERSION]

If I try to run bumpversion build it will result in 0.2.0-0.1 which it should not. It should throw error similar to the suffix part (ValueError: The part has already the maximum value among...)

bumpversion part current_version new_version works correctly?
build 0.1.0-dev 0.1.0-dev.1 ✅yes
suffix 0.1.0-dev.1 0.1.0 ✅yes
minor 0.1.0 0.2.0-dev ✅yes
build 0.2.0-dev 0.2.0-dev.1 ✅yes
suffix 0.2.0-dev.1 0.2.0 ✅yes
build 0.2.0 0.2.0-0.1 ❌ should throw error
suffix 0.2.0-0.1 n/a ❌throws
ValueError: The part has already the maximum value among ['dev', 'prod'] and cannot be bumped.,
should throw regex mismatch error
build 0.2.0-0.1 0.2.0-0.1 ❌ should throw regex mismatch error

Also checked my regex, it works properly https://regexr.com/4rqaj

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
florislacommented, Jan 12, 2020

I understand your use case now.

The behaviour you want could be implemented as an optional feature in a [part:name] section.

0reactions
n3tn0decommented, Jan 12, 2020

Semver generally concerns releases, not commits, but I see your reasoning.

But this usually solved one way or another with develop/feature branches and/or CI/CD tools, for example, by adding branch name and commit hash to version string in compiled files, if commit doesn’t have a tag and/or not in the master branch.

Anyway, I think we went off topic on this.

Bumping build part on prod should either result in error, 0.2.0-dev.1 or 0.2.0-dev to comply with the scheme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Japanese gov't wants to give people an extra ¥80,000 to have ...
Currently, new parents in Japan receive a Childbirth and Childcare Lump-Sum Grant of 420,000 yen upon the birth of their child. Health, Labor ......
Read more >
Netflix, Disney, NFL: Executives make media predictions for ...
CNBC asked 12 past and present media executives for one industry-shaking prediction for 2023 under the veil of anonymity.
Read more >
Boomerang Children May Unknowingly Expose Their Parents ...
A parent of an adult child living at home who can be claimed as a dependent is liable for a non-exempt, uninsured dependent,...
Read more >
When trends aren't a straight line of progress (part two): Productivity ...
In part two of this series on productivity, explore the factors that are driving the global slowdown in productivity growth.
Read more >
Reverse Stock Split: What It Is, How It Works, Examples
A reverse stock split consolidates the number of existing shares of corporate stock into fewer, proportionally more valuable, shares.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found