Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nouralmaa
Copy link
Contributor

@nouralmaa nouralmaa commented Aug 7, 2025

fixes #9142

@jennifer-richards
Copy link
Member

Thank you for cleaning up the PR!

def email_stream_state_changed_cfa(request, doc, cfa_duration=2):
(to, cc)= gather_address_lists('doc_stream_state_edited', doc=doc)

end_date= date_today(DEADLINE_TZINFO) + datetime.timedelta(days=14)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should probably be days=7*cfa_duration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks - committed

def email_stream_state_changed_wglc(request, doc, wglc_duration=2):
(to, cc)= gather_address_lists('doc_stream_state_edited', doc=doc)

end_date= date_today(DEADLINE_TZINFO) + datetime.timedelta(days=14)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should probably be days = 7 * wglc_duration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks - committed

Copy link
Member

@rjsparks rjsparks left a comment

Choose a reason for hiding this comment

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

A couple of quick observations - I haven't reviewed the changes to the tests yet.

cc=cc)

def email_stream_state_changed_cfa(request, doc, cfa_duration=2):
(to, cc)= gather_address_lists('doc_stream_state_edited', doc=doc)
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't reach the recipients requested in the #9142 - it likely needs its own mailtrigger (see https://datatracker.ietf.org/mailtrigger/name/doc_stream_state_edited/ and https://datatracker.ietf.org/mailtrigger/name/).
Adding those will require a migration - let us know if you're already familiar with django migrations - if not, we can add them.

Copy link
Contributor Author

@nouralmaa nouralmaa Aug 13, 2025

Choose a reason for hiding this comment

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

Added a new mailtrigger with the correct recipients, soz for not spotting that. The migration ran OK in my container - however since test settings disable migrations I re-edited tests_draft back to its original state to avoid migration-related errors. Let me know if you recommend testing or running the migration via another method.

Comment on lines 1765 to 1771
# ipr notifs on cfa wglc
if new_state.slug == "c-adopt":
email_stream_state_changed_cfa(request, doc)

if new_state.slug == "wg-lc":
email_stream_state_changed_wglc(request, doc)

Copy link
Member

Choose a reason for hiding this comment

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

This should be inside the if statement at L1752

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Committed, thanks

cc=cc)

def email_stream_state_changed_wglc(request, doc, wglc_duration=2):
(to, cc)= gather_address_lists('doc_stream_state_edited', doc=doc)
Copy link
Member

Choose a reason for hiding this comment

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

See the comment on L108 - this will also need a new mailtrigger.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Committed change with new mailtrigger

@rjsparks
Copy link
Member

Datatracker's test harness is custom and one of the things it does for performance reasons is to use a fixture and some factories (and occasionally a utility function for meeting test data that we're trying to deprecate). These new mailtriggers should get added to the fixture.

After you've run the migrations in your local database run this:

ietf/manage.py generate_name_fixture --stdout | jq --sort-keys 'sort_by(.model, .pk)' > ietf/name/fixtures/names.json

It might pick up some unrelated changes - don't worry if it does.
Then the new names will be available to the tests.

Thanks for sticking with this - we're very happy to have the help. But if this kind of arcana becomes too much, let us know and we can finish out the PR.

@nouralmaa
Copy link
Contributor Author

Datatracker's test harness is custom and one of the things it does for performance reasons is to use a fixture and some factories (and occasionally a utility function for meeting test data that we're trying to deprecate). These new mailtriggers should get added to the fixture.

After you've run the migrations in your local database run this:

ietf/manage.py generate_name_fixture --stdout | jq --sort-keys 'sort_by(.model, .pk)' > ietf/name/fixtures/names.json

It might pick up some unrelated changes - don't worry if it does. Then the new names will be available to the tests.

Thanks for sticking with this - we're very happy to have the help. But if this kind of arcana becomes too much, let us know and we can finish out the PR.

Have added the new fixture and tests for the CFA state, which should hopefully work alongside the existing stream state edited mailtrigger. WGLC isn't strictly tested but is in compatible format with the former. I tried to make everything as consistent as possible with the existing IETF repo. Feel free to finish out the PR with any additional edits. Thank you to everyone for the comments and guidance!

@rjsparks rjsparks changed the title feat(documents): add auto-generated IPR email notifications on WG Call for Adoption or WG Last Call feat: add auto-generated IPR email notifications on WG Call for Adoption or WG Last Call Aug 18, 2025
The two actions have the same recipients to start with, but that
may change over time. Mailtrigger names should describe "what
happened to trigger this email?". Changed the utility names to
match the actions.
Using a list name as the From will not work - the mail infrastructure
blocks such mail when it is submitted.
@rjsparks
Copy link
Member

I'm taking this PR and finishing it out. @nouralmaa, please don't add any new commits. I'll be pushing into this branch. (I'm discovering many things that need to be touched - there are multiple views dealing with the different workflows for draft adoption that need to be included).

@rjsparks
Copy link
Member

There's a bit more for me to do here - I'll move this further along soon.

  • The weeks-of-duration chosen in the forms isn't being passed to the mail function
  • Right now, this is WG specific, and it probably should be as it's about IPR rules, but it will currently send the email for groups that re not wg.
  • The duration runs into the deadline issue that exists elsewhere, and maybe this is where we bring in Anywhere-On-Earth.

@rjsparks
Copy link
Member

Leaving the AoE change to the global one that's coming for the datatracker

@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 88.73%. Comparing base (f5df667) to head (32afade).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9322      +/-   ##
==========================================
- Coverage   88.74%   88.73%   -0.01%     
==========================================
  Files         320      320              
  Lines       41674    41807     +133     
==========================================
+ Hits        36984    37098     +114     
- Misses       4690     4709      +19     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rjsparks rjsparks merged commit 566cf50 into ietf-tools:main Aug 19, 2025
10 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2025
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.

Full Handling of WG Call for Adoption and WGLC via the Datatracker

4 participants