Skip to content

Define DbRetentionJob(Jdbi, DbRetentionConfig)#2549

Merged
wslulciuc merged 6 commits into
mainfrom
feature/follow-up-db-retention
Jul 24, 2023
Merged

Define DbRetentionJob(Jdbi, DbRetentionConfig)#2549
wslulciuc merged 6 commits into
mainfrom
feature/follow-up-db-retention

Conversation

@wslulciuc

@wslulciuc wslulciuc commented Jul 24, 2023

Copy link
Copy Markdown
Member

Problem

Validate DbRetentionConfig properties internally within class. That is, when instantiating a new DbRetentionConfig object, the caller should expect all config values to be valid, contain a reasonable default (if not set), and be immutable. The caller should not be expected to validate the properties externally from the class.

Solution

Add @Positive to DbRetentionConfig instance variables with accompanying test suite.

Checklist

  • You've signed-off your work
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • You've included a one-line summary of your change for the CHANGELOG.md (Depending on the change, this may not be necessary).
  • You've versioned your .sql database schema migration according to Flyway's naming convention (if relevant)
  • You've included a header in any source code files (if relevant)

Signed-off-by: wslulciuc <willy@datakin.com>
Signed-off-by: wslulciuc <willy@datakin.com>
Signed-off-by: wslulciuc <willy@datakin.com>
Signed-off-by: wslulciuc <willy@datakin.com>
@boring-cyborg boring-cyborg Bot added the api API layer changes label Jul 24, 2023
Signed-off-by: wslulciuc <willy@datakin.com>
@wslulciuc wslulciuc requested a review from phixMe July 24, 2023 14:30
Signed-off-by: wslulciuc <willy@datakin.com>
@codecov

codecov Bot commented Jul 24, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2549 (1cfeb9e) into main (a515c91) will increase coverage by 0.15%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main    #2549      +/-   ##
============================================
+ Coverage     83.15%   83.30%   +0.15%     
  Complexity     1286     1286              
============================================
  Files           244      243       -1     
  Lines          5942     5931      -11     
  Branches        282      279       -3     
============================================
  Hits           4941     4941              
+ Misses          854      843      -11     
  Partials        147      147              
Impacted Files Coverage Δ
api/src/main/java/marquez/MarquezApp.java 69.04% <0.00%> (+3.13%) ⬆️
api/src/main/java/marquez/jobs/DbRetentionJob.java 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@phixMe phixMe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice validation, Thanks for this.

@wslulciuc wslulciuc merged commit 3aa0b5b into main Jul 24, 2023
@wslulciuc wslulciuc deleted the feature/follow-up-db-retention branch July 24, 2023 18:01
jonathanpmoraes referenced this pull request in nubank/NuMarquez Feb 6, 2025
* Define `DbRetentionJob(Jdbi, DbRetentionConfig)`

Signed-off-by: wslulciuc <willy@datakin.com>

* Define `DbRetentionJob(Jdbi, DbRetentionConfig)`

Signed-off-by: wslulciuc <willy@datakin.com>

* continued: Define `DbRetentionJob(Jdbi, DbRetentionConfig)`

Signed-off-by: wslulciuc <willy@datakin.com>

* continued: Resolve merge conflicts

Signed-off-by: wslulciuc <willy@datakin.com>

* Add oss license header

Signed-off-by: wslulciuc <willy@datakin.com>

---------

Signed-off-by: wslulciuc <willy@datakin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants