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

Add means to check if version is a snapshot programatically. #749

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

solonovamax
Copy link

Exposes cached DecoratedVersion, and introduce isSnapshot() to DecoratedVersion.

Fixes #678.

  • Introduces a method, getDecoratedVersion() in the VersionConfig class, allowing you to easily retrieve the cached decorated version, instead of having to do versionProvider().get(), which looks less nice (imo) (and is especially nice in groovy/kotlin code where you'll do decoratedVersion instead of versionProvider().get())
  • Also introduces a method, isSnapshot() to DecoratedVersion, which allows you to check if the decorated version is a snapshot. This is passed the value of VersionContact.isSnapshot(). This is convenient for checking if a version is a snapshot or not when building the project.

…edVersion

Introduces a method, getDecoratedVersion() in the VersionConfig class, allowing you to easily retrieve the cached decorated version, instead of having to do versionProvider().get(), which looks less nice (imo)

Also introduces a method, isSnapshot() to DecoratedVersion, which allows you to check if the decorated version is a snapshot.
This is passed the value of VersionContact.isSnapshot().
This is convenient for checking if a version is a snapshot or not when building the project.
Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 62.74%. Comparing base (ed0a385) to head (1cd4a56).
Report is 24 commits behind head on main.

Files Patch % Lines
...ch/build/axion/release/domain/VersionConfig.groovy 0.00% 1 Missing ⚠️
...ech/build/axion/release/domain/VersionService.java 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #749      +/-   ##
============================================
+ Coverage     61.00%   62.74%   +1.74%     
- Complexity      398      404       +6     
============================================
  Files            81       81              
  Lines          1554     1530      -24     
  Branches        147      148       +1     
============================================
+ Hits            948      960      +12     
+ Misses          535      504      -31     
+ Partials         71       66       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@solonovamax
Copy link
Author

Do we need 100% code coverage, or no?

@solonovamax
Copy link
Author

@bgalek (you seem to be the main person merging prs)

@bgalek
Copy link
Collaborator

bgalek commented May 3, 2024

hi! coverage is not a target - but having a tests is ;) Please add at least one test of this feature to document the behaviour

@solonovamax
Copy link
Author

it's mainly just exposing a couple of getters tbh, not anything very interesting, so idk how I'd go about testing that without said tests being effectively useless lol

also, could you take a peek at my other pr? because, I'm looking to get some feedback/opinions on it

@solonovamax
Copy link
Author

@bgalek yo, unsure if you saw this or not bc it was a weekend, so I'm gonna bump it lol

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

Successfully merging this pull request may close these issues.

How to check if current version is a snapshot programatically
2 participants