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

fix: keep draft-iesg state on expiration. Update action holders. #8321

Merged
merged 6 commits into from
Dec 13, 2024

Conversation

rjsparks
Copy link
Member

Fixes #5560 and #8212

@rjsparks
Copy link
Member Author

Keeping at draft as #8212 fix isn't complete and to investigate if we can remediate docs recently moved to dead just because of expiry.

@rjsparks rjsparks marked this pull request as ready for review December 11, 2024 23:09
Copy link
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

One minor change suggested (getting the system Person by name instead of pk, though if you want to start a change in our practice that's fine).

More significantly, it looks to me like you might be trying to check that notification emails aren't being sent in a way that I don't think tests that. This might be my misunderstanding. If you are trying to check that, I think you need to test that the skip_community_list_notification flag is set on the event you save. We already have a test that proves the flag works as intended. However, getting the event instance might be a bit involved.

d.latest_event(StateDocEvent).desc,
"IESG state changed to <b>I-D Exists</b> from Dead",
)
self.assertEqual(len(outbox), 0)
Copy link
Member

Choose a reason for hiding this comment

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

If this is meant to test that community notifications aren't sent, additional work will be needed because the signal handler doesn't actually send messages when running tests. (I'm not that's what you're checking)



def repair_dead_on_expire():
by = Person.objects.get(pk=1) # a.k.a. "(System)"
Copy link
Member

Choose a reason for hiding this comment

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

We canonically use Person.objects.get(user__username="(System)"). Better to stick to that?

Copy link
Member Author

Choose a reason for hiding this comment

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

looks like it's mostly (name="(System)") rather than user__username?

Copy link
Member

Choose a reason for hiding this comment

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

Er, yes, name. Sorry, I don't know why I thought I saw that.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.73%. Comparing base (6b77807) to head (cb435b6).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8321   +/-   ##
=======================================
  Coverage   88.72%   88.73%           
=======================================
  Files         310      312    +2     
  Lines       40882    40910   +28     
=======================================
+ Hits        36273    36301   +28     
  Misses       4609     4609           

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

Copy link
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

Looks good.

An alternative to counting events and manipulating indexes would be to call mock_notify.reset_mock() before calling your method under test. That'll empty call_args and reset called to False. Purely optional though.

empty_outbox()
notified_during_factory_work = mock_notify.call_count
for call_args in mock_notify.call_args_list:
e = call_args.args[0]
Copy link
Member

Choose a reason for hiding this comment

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

Wow! I had missed that call_args now has args and kwargs properties! That is so much better than call_args[0][0].

@rjsparks rjsparks merged commit c747e97 into ietf-tools:main Dec 13, 2024
9 checks passed
@rjsparks rjsparks deleted the idexists branch December 13, 2024 20:33
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.

On draft-expiration, documents with IESG state shouldn't change IESG state.
2 participants