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

feat: send_apikey_usage_emails_task() #7486

Merged

Conversation

jennifer-richards
Copy link
Member

Another that needs its PeriodicTasks created with ietf/manage.py periodic_tasks --create-default and enabled through the admin after deployment.

I've put the new task in ietf.person.tasks, though I've kept its test in place in ietf.ietfauth.tests rather than move it. It's not clear to me where this task really belongs, but I've gone with person because that's where the models live.

Some further refactoring is possible. For one, the test could be better split between testing the ietfauth views and specifically testing that this sends email for the correct events. Second, it's probably possible to cut down the number of queries as this first queries the keys, then one-by-one queries their events. I explored this a bit but it wasn't converging very well, and this is not a frequently-run task, so the potential payoff is probably minimal.

This will have some merge conflicts with #7485 but they should be trivial.

Copy link

codecov bot commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.93%. Comparing base (187c2c5) to head (5ab3a3f).
Report is 223 commits behind head on main.

Current head 5ab3a3f differs from pull request most recent head 594856d

Please upload reports for the commit 594856d to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7486      +/-   ##
==========================================
- Coverage   88.98%   88.93%   -0.06%     
==========================================
  Files         291      295       +4     
  Lines       40717    41216     +499     
==========================================
+ Hits        36233    36654     +421     
- Misses       4484     4562      +78     

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

rjsparks
rjsparks previously approved these changes May 30, 2024
@rjsparks rjsparks merged commit 2ccc230 into ietf-tools:main May 30, 2024
7 checks passed
@jennifer-richards jennifer-richards deleted the celery-send-apikey-usage-email branch May 30, 2024 15:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants