Skip to content

Improve Handling of Cutoff Dates via CLI#49

Merged
johannesduesing merged 6 commits into
developfrom
feature/cutoff-dates
Mar 6, 2026
Merged

Improve Handling of Cutoff Dates via CLI#49
johannesduesing merged 6 commits into
developfrom
feature/cutoff-dates

Conversation

@johannesduesing

@johannesduesing johannesduesing commented Jan 12, 2026

Copy link
Copy Markdown
Member

As reported in #48, we were missing proper documentation for the usage of the time-based artifact filtering via --since-until. For MARIN 1.0.0, we require both cutoff dates to be specified as UNIX timestamps in milliseconds. While this is what Maven Central provides, it is neither a common format nor very intiutive to users. Therefore, this PR:

  • Changes the accepted format for cutoff dates provided via the --since-until CLI argument. Dates can now be given as either UNIX timestamps in seconds, or as dates in the YYYY-MM-DD format. For the latter format, the beginning of a time range (i.e., the since value) will be interpreted as the beginning of the specified date (time 00:00), while the range end date (i.e., the until value) will be interpreted as end of day (time 23:59). Specifying --since-until 2025-12-01:2025-12-02 will thus include all artifacts release on either December 1st or December 2nd, 2025.
  • Updates README to actually include an example usage of --since-until showcasing the new formats.
  • Updates ArtifactAnalysisConfigBuilder to include a convenience method that accepts a ZonedDateTime instead of plain long values for cutoff dates.

Note that YYYY-MM-DD dates are converted into timestamps based on the user's default time zone Dates are converted into timestamps using the GMT timezone - to fine-tune cutoff dates, UNIX time stamps should be used.

Closes #48.

@johannesduesing johannesduesing self-assigned this Jan 12, 2026
@johannesduesing johannesduesing added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 12, 2026

@jachiaram jachiaram left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, though the test is failing due to no maven-metadata file being found for the library analysis. For a library to be analyzed, does it need the maven-metadata file to get all versions?

@jachiaram

Copy link
Copy Markdown
Collaborator

Or a better question is for the given skip take configuration, if a library can't be processed should it still be counted as a part of the take?

@jachiaram jachiaram self-requested a review January 22, 2026 17:31
@johannesduesing

Copy link
Copy Markdown
Member Author

It took me some time, but i'm finally coming back to this PR 😅 I did a few things to address test failures:

  • Used the onVersionListError hook in tests to also count libraries where metadata.xml does not exist - it's to be expected for older libraries, and is not an error condition, so in my mind it should count as part of the "take"
  • It seems the Maven Central Index has been altered - At least the first few hundert GAV triples are not the same anymore compared to when we wrote some of our tests. This means we cannot realy on the index order for our unit tests - some of them were failing because of this exact issue. I changed all test that relied on index order (some specific GAV being at some specific position in the index) to use an input list of explicit GAVs that we have control over.

This should fix our test issues. I'm just now seeing a build failure, but its due to some GitHub Internal Server Error when uploading the dependency tree and should be unrelated - i'll do some research and re-trigger the CI run.

@johannesduesing johannesduesing merged commit 385e977 into develop Mar 6, 2026
1 of 2 checks passed
@johannesduesing johannesduesing deleted the feature/cutoff-dates branch March 6, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correct usage of the since/until argument

2 participants