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: API to list role-holder addresses #7291

Merged
merged 11 commits into from
Apr 5, 2024

Conversation

jennifer-richards
Copy link
Member

@jennifer-richards jennifer-richards commented Apr 4, 2024

Adds API endpoint needed to decouple the makewhitelist script from the datatracker.

The code is refactored compared to the old list-role-holder-emails script (final version here), but I confirmed that at least for a recent dev database, the refactored and original code agree.

Also: I've reused the ietf.api.views.email_aliases API token here because it's what the rest of the API calls used by the postconfirm scripts use. I'm a little uneasy about the now misleading name, but have kept it for operational simplicity. I'd be open to either renaming the token or using a dedicated token for this endpoint.

@rjsparks
Copy link
Member

rjsparks commented Apr 4, 2024

I think we should use a separate api token named for this view. We may have additional clients of the APIs in the future, and we should be able to make the decision to limit one of the other of these endpoints from those additional clients.

@rjsparks
Copy link
Member

rjsparks commented Apr 4, 2024

The functionality looks fine. The list of groups to scrape from should get leadership review (I expect we will add groups and group types to it), but that does not have to happen now.

@jennifer-richards
Copy link
Member Author

I think I'm done now. In addition to straightening out the API token reuse, I realized I'd deviated from the pattern used for the last few API endpoints. I've refactored to do the Group-specific work in ietf.group.utils.role_holder_emails() and put the API-specific interface in ietf.api.views.role_holder_addresses().

May not be perfect, but it's at least consistent.

rjsparks
rjsparks previously approved these changes Apr 4, 2024
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.83%. Comparing base (187c2c5) to head (d2f81a3).
Report is 92 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7291      +/-   ##
==========================================
- Coverage   88.98%   88.83%   -0.15%     
==========================================
  Files         291      291              
  Lines       40717    40881     +164     
==========================================
+ Hits        36233    36318      +85     
- Misses       4484     4563      +79     

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

@rjsparks rjsparks merged commit 6b4a806 into ietf-tools:main Apr 5, 2024
9 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 9, 2024
@jennifer-richards jennifer-richards deleted the list-role-api branch April 10, 2024 16:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants