Skip to content

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

Merged
rjsparks merged 6 commits into
ietf-tools:mainfrom
rjsparks:idexists
Dec 13, 2024
Merged

fix: keep draft-iesg state on expiration. Update action holders.#8321
rjsparks merged 6 commits into
ietf-tools:mainfrom
rjsparks:idexists

Conversation

@rjsparks

Copy link
Copy Markdown
Member

Fixes #5560 and #8212

@rjsparks

Copy link
Copy Markdown
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

@jennifer-richards jennifer-richards left a comment

Copy link
Copy Markdown
Member

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.

Comment thread ietf/doc/tests_draft.py Outdated
d.latest_event(StateDocEvent).desc,
"IESG state changed to <b>I-D Exists</b> from Dead",
)
self.assertEqual(len(outbox), 0)

Copy link
Copy Markdown
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)

Comment thread ietf/doc/expire.py Outdated


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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@codecov

codecov Bot commented Dec 12, 2024

Copy link
Copy Markdown

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.

@jennifer-richards jennifer-richards left a comment

Copy link
Copy Markdown
Member

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.

Comment thread ietf/doc/tests_draft.py
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
Copy Markdown
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
@rjsparks
rjsparks deleted the idexists branch December 13, 2024 20:33
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 17, 2024
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.

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

2 participants