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 breach data model and sync command #13782

Closed
wants to merge 1 commit into from
Closed

Conversation

robhudson
Copy link
Member

Fixes #13611, #13612

One-line summary

Add breach Django model and syncing management command.

Issue / Bugzilla link

#13611
#13612

Testing

To test locally:

  1. (Optional) Pull down a fresh dev db. If you want to repeat this testing after having done these steps once, this will reset your database back to current "dev" state. This (or a make preflight) would also be advised to do when you're done testing this branch.

     `./bin/run-db-download.py --force`
    
  2. Run the migration to create the breaches database table.

     `./manage.py migrate products`
    
  3. Run the management command to sync the breaches, overriding the STATIC_URL environment variable since we need this to set the correct breach logo URLs. Normally this will run on our deployments on an interval and wouldn't be needed locally, but until this is merged we need to simulate a sync run as if we're on dev.

    This requires gcloud to be set up so we can upload to GCS. Make sure you're auth'd.

     `gcloud auth application-default login`
    

    Then run the sync:

     `STATIC_URL=https://www-dev.allizom.org/media/ ./manage.py sync_breaches`
    

@robhudson robhudson added the WIP 🚧 Pull request is still work in progress label Oct 12, 2023
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (2a87ea6) 76.58% compared to head (ec37e43) 76.33%.
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13782      +/-   ##
==========================================
- Coverage   76.58%   76.33%   -0.25%     
==========================================
  Files         145      146       +1     
  Lines        7960     8071     +111     
==========================================
+ Hits         6096     6161      +65     
- Misses       1864     1910      +46     
Files Coverage Δ
bedrock/settings/base.py 95.07% <100.00%> (+0.01%) ⬆️
bedrock/products/models.py 58.18% <58.18%> (ø)

... and 1 file with indirect coverage changes

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

@robhudson
Copy link
Member Author

Closing 😢

@robhudson robhudson closed this Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP 🚧 Pull request is still work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create breach data model
1 participant