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

DD-1586 Added truncate-notifications with commandline input parsing #6

Merged
merged 27 commits into from
Sep 10, 2024

Conversation

PaulBoon
Copy link
Contributor

@PaulBoon PaulBoon commented Aug 27, 2024

Fixes DD-1586

Description of changes

Implement dataverse truncate-notifications {--user <uid>|--all-users } <number-of-records-to-keep>

How to test

Deploy the role on a fresh lifesciences dev box:

start-preprovisioned-box.py -s dev_lifesciences
deploy.py -m dd-dataverse-cli dev_lifesciences

Ssh into the box and run some commands and check the result.
Example:

[vagrant@lifesciences ~]$ dataverse truncate-notifications --user 123 100
123: OK. Deleted 0 record(s) for user with id 123
[vagrant@lifesciences ~]$ dataverse truncate-notifications --all-users 20
Number of users found for notification truncation: 0
[vagrant@lifesciences ~]$ dataverse truncate-notifications --user 3 2
3: OK. Deleted 1 record(s) for user with id 3
[vagrant@lifesciences ~]$ dataverse truncate-notifications --all-users 2
Number of users found for notification truncation: 2
1: OK. Deleted 3 record(s) for user with id 1
8: OK. Deleted 1 record(s) for user with id 8

Related PRs

(Add links)

Notify

@DANS-KNAW/core-systems

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 32.74336% with 76 lines in your changes missing coverage. Please review.

Project coverage is 32.42%. Comparing base (75cd94d) to head (0dbee67).
Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
.../main/java/nl/knaw/dans/dvcli/action/Database.java 2.27% 43 Missing ⚠️
.../knaw/dans/dvcli/command/NotificationTruncate.java 70.58% 13 Missing and 2 partials ⚠️
...w/dans/dvcli/config/DdDataverseDatabaseConfig.java 0.00% 9 Missing ⚠️
...c/main/java/nl/knaw/dans/dvcli/DdDataverseCli.java 0.00% 6 Missing ⚠️
...l/knaw/dans/dvcli/config/DdDataverseCliConfig.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master       #6       +/-   ##
=============================================
+ Coverage          0   32.42%   +32.42%     
- Complexity        0       50       +50     
=============================================
  Files             0       30       +30     
  Lines             0      404      +404     
  Branches          0       14       +14     
=============================================
+ Hits              0      131      +131     
- Misses            0      267      +267     
- Partials          0        6        +6     

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

@PaulBoon PaulBoon marked this pull request as ready for review September 4, 2024 13:11
@PaulBoon PaulBoon requested a review from a team as a code owner September 4, 2024 13:11
@PaulBoon PaulBoon changed the title Added truncate-notifications with commandline input parsing DD-1586 Added truncate-notifications with commandline input parsing Sep 5, 2024
@PaulBoon PaulBoon requested a review from jo-pol September 5, 2024 11:12
Copy link
Contributor

@jo-pol jo-pol left a comment

Choose a reason for hiding this comment

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

LGTM though I did not check the SQL queries in detail.

@PaulBoon PaulBoon merged commit ac000e3 into DANS-KNAW:master Sep 10, 2024
4 checks passed
@PaulBoon PaulBoon deleted the DD-1586-TruncateNotifications branch September 10, 2024 12:13
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.

2 participants