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

Add cron job to periodically purge #31

Merged
merged 3 commits into from
Aug 23, 2024
Merged

Add cron job to periodically purge #31

merged 3 commits into from
Aug 23, 2024

Conversation

glass-ships
Copy link
Member

Short description of the changes:

Add a monthly cron job to purge expired data

Long description of the changes:

  • Adds script which runs purge_expired_data command
  • Adds a cron job to run this script at 00:00 on the 1st of each month
    • writes output to /var/log/cron.log
  • Rename "deploy-config" to simply "deploy"
  • Move django app docker files into this folder
  • Add default auto field type to ensure longevity and suppress warnings
  • Add counter to track how many runs are deleted

Check list for the pull request

  • I have read the [CONTRIBUTING]
  • I have read the [CODE_OF_CONDUCT]
  • I have added tests for my changes
  • I have updated the documentation accordingly

Check list for the reviewer

  • I have read the [CONTRIBUTING]
  • I have verified the proposed changes
  • best software practices
    • all internal functions have an underbar, as is python standard
    • clearly named variables (better to be verbose in variable names)
    • code comments explaining the intent of code blocks
  • All the tests are passing
  • The documentation is up to date
  • code comments added when explaining intent

Manual test for the reviewer

References

@glass-ships glass-ships requested a review from backmari August 23, 2024 15:16
Copy link

codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.00%. Comparing base (7a4d038) to head (d7f665e).
Report is 4 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next      #31      +/-   ##
==========================================
+ Coverage   86.75%   90.00%   +3.24%     
==========================================
  Files          12       10       -2     
  Lines         317      310       -7     
==========================================
+ Hits          275      279       +4     
+ Misses         42       31      -11     

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

@glass-ships
Copy link
Member Author

codecov patch only failing because we don't have tests for migrations. (should we?)

Copy link
Collaborator

@backmari backmari left a comment

Choose a reason for hiding this comment

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

Looks great 👌
We should test the migration in the test env to make sure that the app works as before after the changed primary key field type.

@backmari
Copy link
Collaborator

backmari commented Aug 23, 2024

Maybe we can configure the code coverage to exclude migrations in the future

@glass-ships
Copy link
Member Author

Maybe we can configure the code coverage to exclude migrations in the future

oh that's a good idea, I'll look at how to exclude folders!

Copy link
Collaborator

@backmari backmari left a comment

Choose a reason for hiding this comment

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

Nice! Now the PR instead increases the code coverage 😁

@glass-ships glass-ships merged commit 231c97a into next Aug 23, 2024
4 checks passed
@glass-ships glass-ships deleted the cron-and-logging branch August 23, 2024 18:52
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