axion-release-plugin icon indicating copy to clipboard operation
axion-release-plugin copied to clipboard

Add means to check if version is a snapshot programatically.

Open solonovamax opened this issue 1 year ago • 6 comments

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.

solonovamax avatar May 03 '24 01:05 solonovamax

Codecov Report

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

Project coverage is 61.87%. Comparing base (489aa88) to head (036727e). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ch/build/axion/release/domain/VersionConfig.groovy 0.00% 1 Missing :warning:
...ech/build/axion/release/domain/VersionService.java 75.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #749      +/-   ##
============================================
- Coverage     61.92%   61.87%   -0.06%     
  Complexity      442      442              
============================================
  Files            83       83              
  Lines          1681     1684       +3     
  Branches        161      161              
============================================
+ Hits           1041     1042       +1     
- Misses          571      573       +2     
  Partials         69       69              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 03 '24 10:05 codecov[bot]

Do we need 100% code coverage, or no?

solonovamax avatar May 03 '24 15:05 solonovamax

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

solonovamax avatar May 03 '24 16:05 solonovamax

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

bgalek avatar May 03 '24 16:05 bgalek

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 avatar May 04 '24 00:05 solonovamax

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

solonovamax avatar May 07 '24 17:05 solonovamax