-
Notifications
You must be signed in to change notification settings - Fork 8
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
Expired link is deleted from database when expired #1466
Expired link is deleted from database when expired #1466
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #1466 +/- ##
==========================================
+ Coverage 90.11% 90.15% +0.03%
==========================================
Files 29 29
Lines 4401 4407 +6
==========================================
+ Hits 3966 3973 +7
+ Misses 435 434 -1
|
…d-from-database-when-link-is-clicked
…d-from-database-when-link-is-clicked
@i-oden You mean adding tests that check that the ProjectInviteKeys are removed right? |
…d-from-database-when-link-is-clicked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Few comments / suggestions
- Change the title of the PR so that it reflects the changes (expired invite deleted when new invite attempted or something like that)
- Fix / clarify a few things in the tests
- Add a test for the
SQLAlchemyError
. You don't need to add for theOperationalError
, it's more complicated and it will anyway produce the same message. Tip: Check thecodecov
report further up in this PR (see image below). The percentage within the<>
brackets should be 100% or as close to it as possible (if not 100 then explain why / discuss with us for example) for the files that are listed in the table. That means that 100% of your code changes are covered by tests.
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
@i-oden like this changes I push you mean? I dont know How to check for example for the ddserr.databaseerror as that was already part of the code I just move it around. |
What you've added now is a good start, but you'll need to change a bit and add a bit of code too. I can have a look tomorrow again and come with a suggestion! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions regarding the tests
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great and now the test coverage of your changes is 100% 👏🏻
Just a couple of very minor changes, just for consistency, then I'm ready to approve.
Co-authored-by: Ina Odén Österbo <[email protected]>
Co-authored-by: Ina Odén Österbo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
Once @valyo has also approved, you can merge it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works as expected. Just small corrections in the tests docstrings
Co-authored-by: Valentin Georgiev <[email protected]>
Co-authored-by: Valentin Georgiev <[email protected]>
Before submitting this PR
Description: When an invite is sent, the expiry time is set to exactly 7 days from now (incl the time). At midnight there is a cronjob which finds the expired invites in the Invites table and removes them. This means that there is a gap between the actual expiry and when the invite is deleted from the database. This PR fixes that. As well as adding some tests
Jira task / GitHub issue: https://scilifelab.atlassian.net/jira/software/projects/DDS/boards/13?isInsightsOpen=true&selectedIssue=DDS-1642
How to test: Add information on how someone could manually test this functionality. As detailed as possible.
Type of change: Check the relevant boxes in the section below
Add docstrings and comments to code, even if you personally think it's obvious.
What type of change(s) does the PR contain?
Checklist
master
branchActions / Scans
Run
black .
locally to execute formatting.Run
npx prettier --write .
locally to execute formatting.