Commit graph

156 commits

Author SHA1 Message Date
Paul Selkirk c718fedb6c
feat: Allow review rejections to be undone (#6312)
* feat: Allow reviewer to accept a review they're previously rejected

* feat: Add a reviewer who has previously rejected a review to the list of suggested reviewers.

This largely un-does d105f8b, at the request of at least one team secretary.

* fix: Went a little overboard on the previous commit

one_assignment still has to exclude reviewers who rejected the assignment,
or they could end up being the suggested reviewer.

* fix: Actually do the assignment

* fix: If there's an existing assignment, don't create a new one

* style: Restructure conditional for clarity

* test: Add test cases for accepting or assigning a review assignment after rejecting it
2023-09-27 08:57:34 -05:00
Tero Kivinen b24dd4427b
fix: Shows requested reviews for doc fixes (#6022)
* Fix: Shows requested reviews for doc

* Changed template includes to only give required variables to them.
2023-07-25 07:59:45 -07:00
Tero Kivinen 5a0ea56b38
fix: Remove automatically suggested document for document that is already has review request (fixes #3211) (#5425)
* Added check that if there is already review request for the document
in question, ignore the automatic suggestion for that document.
Fixes #3211.

* fix: dont block on open requests for a previous version. Add tests

---------

Co-authored-by: Nicolas Giard <github@ngpixel.com>
Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2023-07-23 10:02:40 -07:00
Jennifer Richards da8717f0e9
chore: Set chunk_size on QuerySet.iterator() 2023-05-19 13:10:06 -03:00
Jennifer Richards 7ae0576a44
style: Apply Black style to methods in review.utils 2023-05-19 13:08:47 -03:00
Jennifer Richards 47e2b0b027
fix: Prevent use of FK relation before review request is saved 2023-05-18 15:18:02 -03:00
Eric Vyncke 2a27a2bffc
feat: Can we provide a better review assignment email subject. #3760 (#5415)
* Specific email subject + requester/secretary in cc

* Send the deadline in the subject

* Use unicode rather than ASCII for reviewer's name

* More log info in the test

* Fix the closing parenthesis

* Fix the email test  when review is assigned

* chore: address review comment

---------

Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2023-05-17 12:23:20 -05:00
Jennifer Richards 27469c1264
fix: do not create ReviewRequestDocEvent when assigning a review req (#4913)
* fix: do not create ReviewRequestDocEvent when assigning a review req

* test: test docevent creation
2022-12-16 15:17:10 -06:00
Jennifer Richards cbc6d159a5
fix: convert LastCallDocEvent.expires to DEADLINE_TZINFO to get date 2022-10-25 10:03:18 -03:00
Jennifer Richards da70acfdff
Merge branch 'feat/tzaware' into jennifer/yet-more-tz-fixes
# Conflicts:
#	ietf/ietfauth/utils.py
#	ietf/meeting/tests_views.py
#	ietf/stats/tests.py
2022-10-17 16:39:45 -03:00
Jennifer Richards 7b1b7f5273
Merge branch 'feat/tzaware' into dev/tzaware-main-merge 2022-10-11 14:57:34 -03:00
Jennifer Richards cb9e576fb4
fix: return False from has_role() when role_names is the empty list (#4541)
* fix: return False from has_role() when role_names is the empty list

* chore: add comments clarifying the effect of Q()
2022-10-07 16:05:37 -05:00
Jennifer Richards a653582cf7
fix: timezone fixes from last few comparisons with tzaware-obe 2022-09-28 13:21:50 -03:00
Jennifer Richards 32054111df
fix: fix failing tests and eliminate naive datetime warnings (#4402)
* test: fix timestamp construction in several doc tests

* refactor: rename date2datetime to datetime_from_date and clarify code

* chore: helper to get tzinfo for PRODUCTION_TIMEZONE

* fix: fix timezone handling in make_last_call()

* test: fix datetime generation in doc.tests_charter

* refactor: remove PRODUCTION_TIMEZONE setting

Replaces the PRODUCTION_TIMEZONE setting with a constant,
DEADLINE_TZINFO, in ietf.utils.timezone.

* test: be more careful about timezone in tests_charter.py

* test: be more careful about timezone in doc/tests.py

* fix: fix timezone handling affecting doc.tests_draft

* fix: fix timezone handling affecting tests_irsg_ballot.py

* fix: fix timezone handling affecting tests_review.py

* fix: fix timezone handling affecting last ietf.doc tests

* fix: fix timezone handling affecting last ietf.group tests

* fix: fix timezone handling affecting ietf.iesg tests

* fix: handle timezones in get_8989_eligibility_querysets

* fix: handle timezones affecting ietfauth tests

* fix: return tz-aware datetime from utc_from_string

* fix: specify timezone for constants in ipr_rfc_number()

* fix: specify tz for ipr deadlines

* fix: handle timezones affecting liaisons tests

* fix: treat leap day in get_8989_eligibility_querysets()

Manual cherry-pick of 248d6474

* test: treat leap day properly in nomcom tests

* fix: fix timezone handling affecting nomcom tests

* test: fix timezone handling in review tests

* fix: fix timezone handling affecting secr.meetings tests

* fix: handle both pytz and zoneinfo timezones in ietf.utils.timezone

* fix: fix timezone handling affecting secr.proceedings tests

* refactor: use make_aware() helper in secr.meetings tests

* test: fix timezone handling in secr.telechat tests

* fix: fix timezone handling affecting stats tests

* fix: eliminate tz-naive helpers affecting sync email parsing

* fix: include timezone data when serializing DeletedEvent data

* fix: fix timezone handling affecting sync tests

* style: remove unused import
2022-09-01 13:07:28 -03:00
Jennifer Richards ebebdbed3e
refactor: replace datetime.now and datetime.today with timezone.now (#4211)
* refactor: replace datetime.now with timezone.now

* refactor: migrate model fields to use timezone.now as default

* refactor: replace datetime.today with timezone.now

datetime.datetime.today() is equivalent to datetime.datetime.now(); both
return a naive datetime with the current local time.

* refactor: rephrase datetime.now(tz) as timezone.now().astimezone(tz)

This is effectively the same, but is less likely to encourage accidental
use of naive datetimes.

* refactor: revert datetime.today() change to old migrations

* refactor: change a missed datetime.now to timezone.now

* chore: renumber timezone_now migration

* chore: renumber migrations
2022-08-25 13:45:16 -03:00
Robert Sparks b988850985
fix: avoid mutables as defaults. Compute date default arguments at runtime rather than loadtime. (#4144) 2022-07-06 14:39:36 -05:00
Jennifer Richards 6df0377fa1 Fix several review reminder problems.
Send secretary's review reminders to secretary instead of assignee. 
Send unconfirmed assignment reminders based on assignment age and CC secretaries. 
Correctly separate open review reminders by review team.

Fixes #3482. Fixes #3324. Commit ready for merge.
 - Legacy-Id: 19848
2022-01-14 19:14:06 +00:00
Jennifer Richards 92c9f856a4 Refactor reviewer queue policy handling of "skip" setting. Fixes #3038. Commit ready for merge.
- Legacy-Id: 18833
2021-02-16 19:31:50 +00:00
Henrik Levkowetz 2b68095b82 Merged in [17794] from mark@painless-security.com:
Add the 'msg' variable for interpolation on reviewer availability change emails, and reformat the add-a-period email.  Fixes #2891.
 - Legacy-Id: 17799
Note: SVN reference [17794] has been migrated to Git commit 96bc71f51f150cec7043aca60d0156d35847019b
2020-05-15 11:33:03 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz fcb6806d17 Merged in work from sasha@dashcare.nl on Review Queue Managemnt:
This abstracts queue management, making it possible to implement different
policies for each team. It provides two concrete policies:
RotateAlphabeticallyReviewerQueuePolicy, which rotates an alphabetically
ordered reviewer list with consideration for skip indications, and is the
default policy; and LeastRecentlyUsedReviewerQueuePolicy, a simple
least-recently-used policy.  Also see issues #2721 and #2656.
 - Legacy-Id: 17121
2019-12-04 23:02:52 +00:00
Henrik Levkowetz fc0060079a Merged in [17085] from sasha@dashcare.nl:
Fix #2278 - Notify secretary when a review request is closed.
The assigned reviewer was already notified, but secretaries were always
excluded.
 - Legacy-Id: 17108
Note: SVN reference [17085] has been migrated to Git commit 56003f66d8
2019-11-27 22:19:58 +00:00
Henrik Levkowetz 7ec09554bb Merged in [17069] from sasha@dashcare.nl:
Fix #2074, fix #2358 - Add history for assignments, requests and unavailability.
 - Legacy-Id: 17104
Note: SVN reference [17069] has been migrated to Git commit 65d84155b6
2019-11-26 16:09:43 +00:00
Sasha Romijn 10a7bee637 Merge reviewer-queue-management on top of 6.111.1.dev0
- Legacy-Id: 17094
2019-11-22 12:35:28 +00:00
Sasha Romijn 56003f66d8 Fix #2278 - Notify secretary when a review request is closed.
The assigned reviewer was already notified, but secretaries were always
excluded.

Commit ready for merge.
 - Legacy-Id: 17085
2019-11-21 11:03:21 +00:00
Henrik Levkowetz 424dcfb42d Some tweaks related to the changes related to #2830.
- Legacy-Id: 17076
2019-11-21 06:01:56 +00:00
Sasha Romijn 65d84155b6 Fix #2074, fix #2358 - Add history for assignments, requests and unavailability.
Commit ready for merge.
 - Legacy-Id: 17069
2019-11-20 11:29:14 +00:00
Robert Sparks 38e73b6f89 Change the default template for assigned review emails to name the assigned reviewer. Fixes #2830. Commit ready for merge.
- Legacy-Id: 17062
2019-11-19 21:27:23 +00:00
Sasha Romijn c36fcdc5a7 Update update_policy_state_for_assignment for new policies, fix tests,
fix some other minor things.
 - Legacy-Id: 17023
2019-11-13 14:39:42 +00:00
Sasha Romijn b5a31c3c6a Update some terminology and docstrings.
- Legacy-Id: 16983
2019-11-11 12:31:16 +00:00
Robert Sparks f740adcfc1 Look at the tree of replaces-relationships when determining if some reviewer has reviewed this (or perhaps an ancestor) of this document. Fixes #2821. Commit ready for merge.
- Legacy-Id: 16981
2019-11-07 23:02:19 +00:00
Sasha Romijn e518824a69 Initial refactoring of the current reviewer assignment code.
- Legacy-Id: 16961
2019-11-05 16:39:31 +00:00
Henrik Levkowetz 77a56473c3 Merged in [16933] from sasha@dashcare.nl:
Fix #2119 - Allow specifying review type for suggested reviews in LC and telechat
If a review is suggested on the 'manage unassigned reviews' page, and
the document is in both last call and telechat, the assign form now asks
for the type of review that should be assigned.
This commit also fixes two bugs in this process:
- Comparisons in some cases between strings and integers
  (group/views.py:1485/1487)
- Rejections when assigning suggested reviews, as they could be
  considered a newly opened request due to not having a pk
  (group/views.py:1508)
 - Legacy-Id: 16951
Note: SVN reference [16933] has been migrated to Git commit ee4bc0cb07
2019-10-31 17:31:21 +00:00
Sasha Romijn eab14ea1c5 Early work to extract reviewer policy from review/utils.py.
- Legacy-Id: 16950
2019-10-31 15:01:14 +00:00
Henrik Levkowetz a37bd907cc Merged in [16926] from rjsparks@nostrum.com:
Flipped a sense to put the grace period on the right side of 'today' when sending review overdue reminders to team secretaries. Fixes #2816.
 - Legacy-Id: 16940
Note: SVN reference [16926] has been migrated to Git commit 7560e116bf
2019-10-30 13:01:53 +00:00
Sasha Romijn ee4bc0cb07 Fix #2119 - Allow specifying review type for suggested reviews in LC and telechat
If a review is suggested on the "manage unassigned reviews" page, and
the document is in both last call and telechat, the assign form now asks
for the type of review that should be assigned.

This commit also fixes two bugs in this process:
- Comparisons in some cases between strings and integers
  (group/views.py:1485/1487)
- Rejections when assigning suggested reviews, as they could be
  considered a newly opened request due to not having a pk
  (group/views.py:1508)
  
Commit ready for merge.
 - Legacy-Id: 16933
2019-10-28 11:43:48 +00:00
Henrik Levkowetz 09c34fa131 Merged in [16921] from sasha@dashcare.nl:
Fix #2123 - Use a DBTemplate when a review assignment is mailed.
The message sent to a reviewer when a new review is assigned to them,
is now taken from a DBTemplate, allowing it to be customised
per team. This includes a migration to create a default template,
which looks the same as before.
 - Legacy-Id: 16928
Note: SVN reference [16921] has been migrated to Git commit 9df5839874
2019-10-26 15:16:18 +00:00
Robert Sparks 7560e116bf Flipped a sense to put the grace period on the right side of "today" when sending review overdue reminders to team secretaries. Fixes #2816. Commit ready for merge.
- Legacy-Id: 16926
2019-10-25 20:32:16 +00:00
Sasha Romijn 9df5839874 Fix #2123 - Use a DBTemplate when a review assignment is mailed.
The message sent to a reviewer when a new review is assigned to them,
is now taken from a DBTemplate, allowing it to be customised
per team. This includes a migration to create a default template,
which looks the same as before.

Commit ready for merge.
 - Legacy-Id: 16921
2019-10-23 16:06:44 +00:00
Henrik Levkowetz 9e21c011f6 Merged in [16854] from rjsparks@nostrum.com:
Remove some pre-ReviewAssignment refactor logic, and simplify what remains while still allowing a group secretary to not assign a row on the unassigned requests form after touching the control to assign a reviewer. Fixes #2812.
 - Legacy-Id: 16900
Note: SVN reference [16854] has been migrated to Git commit b158807134e2d26b3e013b6414b6fcbaa0e39f77
2019-10-22 12:43:56 +00:00
Henrik Levkowetz a66fa82b06 Fixed some review reminders issues.
- Legacy-Id: 16863
2019-10-15 16:46:12 +00:00
Henrik Levkowetz be641ac22a Merged in [16792] from sasha@dashcare.nl:
Fix #2475 - Send opt-in reminders for unconfirmed review assignments.
If enabled for a team, reminders will be sent every X days to reviewers
for review assignments they have not accepted or rejected.
 - Legacy-Id: 16846
Note: SVN reference [16792] has been migrated to Git commit 486b6daa29
2019-10-08 15:57:28 +00:00
Henrik Levkowetz 678f8a5787 Merged in [16765] from sasha@dashcare.nl:
Refs #2277 - Send daily reminders of overdue reviews to secretaries
 - Legacy-Id: 16839
Note: SVN reference [16765] has been migrated to Git commit cc64992204
2019-10-08 10:41:37 +00:00
Henrik Levkowetz 09e38dffa0 Merged in [16705] from sasha@dashcare.nl:
Fix #2337 - Send periodic reminders of open reviews every X days (opt-in)
The interleaved_migrations_test currently fails due to the various 
migrations that have been added for individual tickets/commits (unless
--permit-mixed-migrations is set). I think this is better fixed in a
later cleanup, as doing it now could cause confusion when merging
individual commits, and more migrations are likely to be added soon.
 - Legacy-Id: 16823
Note: SVN reference [16705] has been migrated to Git commit ec56a03ec6
2019-10-04 17:09:57 +00:00
Henrik Levkowetz 4c3e869d5c Merged in [16704] from sasha@dashcare.nl:
Fix #2231 - Send reminders before long UnavailabilityPeriods expire
A notification is sent to the team secretary and reviewer, if an
unavailability period lasting 30 days or more will end in 3 days.
 - Legacy-Id: 16822
Note: SVN reference [16704] has been migrated to Git commit 179c151f9e
2019-10-04 14:07:54 +00:00
Henrik Levkowetz 70380cb8ea Merged in [16672] from sasha@dashcare.nl:
Fix #2328 - Use mailtriggers to find destinations in review app
As the review app has several conditionals that don't fit
entirely well within mailtriggers, the templates use a bit
of extra context to figure out who exactly to include. This also
extends the tests for review, to check for correct recipients.
It also adds a tiny feature to mailtrigger to entirely exclude
certain addresses, as required by the review-generated mails.
 - Legacy-Id: 16793
Note: SVN reference [16672] has been migrated to Git commit 88b7b45b0e
2019-10-01 13:06:48 +00:00
Sasha Romijn 486b6daa29 Fix #2475 - Send opt-in reminders for unconfirmed review assignments.
If enabled for a team, reminders will be sent every X days to reviewers
for review assignments they have not accepted or rejected.

Commit ready for merge.
 - Legacy-Id: 16792
2019-10-01 13:01:19 +00:00
Henrik Levkowetz 10c8596664 Merged in [16667] from sasha@dashcare.nl:
Fix #2071 - Add optional comment field for close request.
 - Legacy-Id: 16786
Note: SVN reference [16667] has been migrated to Git commit 4669b0934b
2019-09-30 20:55:16 +00:00
Sasha Romijn cc64992204 Refs #2277 - Send daily reminders of overdue reviews to secretaries
Commit ready for merge.
 - Legacy-Id: 16765
2019-09-30 12:27:43 +00:00
Sasha Romijn ec56a03ec6 Fix #2337 - Send periodic reminders of open reviews every X days (opt-in)
The interleaved_migrations_test currently fails due to the various 
migrations that have been added for individual tickets/commits (unless
--permit-mixed-migrations is set). I think this is better fixed in a
later cleanup, as doing it now could cause confusion when merging
individual commits, and more migrations are likely to be added soon.

Commit ready for merge.
 - Legacy-Id: 16705
2019-09-05 15:02:56 +00:00