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 2 commits 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 missing coverage. Please review.

Project coverage is 63.69%. Comparing base (099f892) to head (3bf9da5).

Files with missing lines 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     63.74%   63.69%   -0.06%     
  Complexity      442      442              
============================================
  Files            82       82              
  Lines          1633     1636       +3     
  Branches        161      161              
============================================
+ Hits           1041     1042       +1     
- Misses          523      525       +2     
  Partials         69       69              

☔ 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
Member

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

@bgalek bgalek enabled auto-merge (squash) October 14, 2024 18:12
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