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 expiration field to DataRun model #25

Merged
merged 31 commits into from
Aug 13, 2024
Merged

Add expiration field to DataRun model #25

merged 31 commits into from
Aug 13, 2024

Conversation

glass-ships
Copy link
Member

@glass-ships glass-ships commented Aug 5, 2024

Short description of the changes:

Add expiration_date field to DataRun model in order to flag for occasional deletion after some amount of time (3 years by default, can adjust later)

Long description of the changes:

  • Add expiration_date field to DataRun
  • Add purge_expired_data admin command
  • Add a migration for model update
  • Add logic to handle expiration_date (as a python datetime) in upload_plot_data and upload_user_data endpoints
    • also gets passed/handled by get_or_create_run() helper function, as well as store_user/plot_data
  • Added a get_all_runs endpoint for utility, which includes expiration_date and expired (bool) fields
  • Add tests for new functionality
  • Add documentation for updating data models and migrating database

Additionally:

  • Update existing test for clarity in reading
  • Add dependabot.yml to check for updates to actions
  • Updates test workflow with changes to github's docker version
  • Add useful entries to .gitignore
  • Add a check for appropriate docker compose command in Makefile
  • Add a make clean target
  • Some minor formatting changes

Check list for the pull request

  • I have read the [CONTRIBUTING]
  • I have read the [CODE_OF_CONDUCT] (N/A)
  • 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

EWM Story 4887

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 88.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 86.75%. Comparing base (3dec7ee) to head (5e67172).
Report is 4 commits behind head on next.

Files Patch % Lines
...r/plots/migrations/0002_datarun_expiration_date.py 0.00% 5 Missing ⚠️
src/live_data_server/live_data_server/settings.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next      #25      +/-   ##
==========================================
- Coverage   86.87%   86.75%   -0.13%     
==========================================
  Files          10       12       +2     
  Lines         282      317      +35     
==========================================
+ Hits          245      275      +30     
- Misses         37       42       +5     

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

@glass-ships glass-ships requested a review from backmari August 9, 2024 14:20
@glass-ships glass-ships marked this pull request as ready for review August 9, 2024 14:20
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.

Can you please change the relative imports back to absolute, mostly for clarity and consistency?

README.md Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
docs/developer/config_for_local_use.rst Outdated Show resolved Hide resolved
src/live_data_server/plots/views.py Outdated Show resolved Hide resolved
src/live_data_server/plots/views.py Outdated Show resolved Hide resolved
src/live_data_server/plots/models.py Outdated Show resolved Hide resolved
src/live_data_server/plots/views.py Outdated Show resolved Hide resolved
src/live_data_server/plots/views.py Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@glass-ships glass-ships merged commit 25a1c73 into next Aug 13, 2024
4 checks passed
@glass-ships glass-ships deleted the expiration-field branch August 13, 2024 18:34
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