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

#4081 reviewers from past review rounds are now valid review assignment choices. #4101

Merged
merged 15 commits into from
Apr 24, 2024

Conversation

ajrbyers
Copy link
Member

This PR tweaks the logic by no longer excluding the past_reviewers when calling get_reviewer_candidates. They are instead filtered out at the end when setting reviewers in the context argument. This means that past_reviewers remain valid reviewers but don't display twice in the review list.

Closes #4081

@ajrbyers ajrbyers requested a review from mauromsl April 16, 2024 12:47
@ajrbyers ajrbyers assigned ajrbyers and mauromsl and unassigned ajrbyers Apr 16, 2024
@mauromsl mauromsl assigned ajrbyers and unassigned mauromsl Apr 19, 2024
@mauromsl mauromsl requested a review from joemull April 19, 2024 10:28
@mauromsl mauromsl assigned joemull and unassigned ajrbyers Apr 19, 2024
Copy link
Member

@joemull joemull left a comment

Choose a reason for hiding this comment

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

The logic fix is working but the display is still a bit confusing, because the table is missing a few cells on the empty row:

Screenshot from 2024-04-22 17-33-54

I got it to load properly by adding two tds:

diff --git a/src/templates/admin/review/add_review_assignment.html b/src/templates/admin/review/add_review_assignment.html
index 01652349..82d38cd4 100644
--- a/src/templates/admin/review/add_review_assignment.html
+++ b/src/templates/admin/review/add_review_assignment.html
@@ -75,6 +75,8 @@
                                 <td></td>
                                 <td></td>
                                 <td></td>
+                                <td></td>
+                                <td></td>
                             </tr>
                         {% endfor %}
                         </tbody>

image

But this still is still not quite accurate because the "empty" notice is displaying when the options are not empty. Can the set of reviewers be fixed a bit more comprehensively in the view using querysets and copied querysets if needed, so the template doesn't have to do so much logic? You could use queryset annotation to create the variables needed in the template that indicate whether the reviewer is suggested or past.

@joemull joemull assigned ajrbyers and unassigned joemull Apr 23, 2024
@ajrbyers ajrbyers requested a review from joemull April 23, 2024 15:27
@ajrbyers ajrbyers assigned joemull and unassigned ajrbyers Apr 23, 2024
@ajrbyers ajrbyers requested a review from mauromsl April 23, 2024 15:27
@ajrbyers
Copy link
Member Author

ajrbyers commented Apr 23, 2024

I've moved the setting of is_past_reviewer and is_suggested_reviewer over to optional annotations on the func that gets reviewer candidates.

I resolved the colspan issue by setting the colspan to 10, this ensures that if the table is 6, 7 or 8 cols wide the empty message will span all of the columns (this is supported cross browser so long as we don't set the table layout to fixed).

Both settings off:
Screenshot 2024-04-23 at 16 22 53

Past Reviewers on:
Screenshot 2024-04-23 at 16 20 04

Both settings on:
Screenshot 2024-04-23 at 16 21 53

Copy link
Member

@mauromsl mauromsl left a comment

Choose a reason for hiding this comment

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

Some questions/comments inline, but certainly much (c)leaner than it was!

src/review/views.py Outdated Show resolved Hide resolved
src/review/logic.py Outdated Show resolved Hide resolved
src/review/views.py Outdated Show resolved Hide resolved
src/review/logic.py Outdated Show resolved Hide resolved
src/review/logic.py Show resolved Hide resolved
src/templates/admin/review/add_review_assignment.html Outdated Show resolved Hide resolved
@ajrbyers ajrbyers requested a review from mauromsl April 24, 2024 08:46
@ajrbyers ajrbyers assigned mauromsl and unassigned joemull Apr 24, 2024
Copy link
Member

@mauromsl mauromsl left a comment

Choose a reason for hiding this comment

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

Thanks for this! Added one last comment I think would be good to make the logic even simpler and also reduce config bloat

src/review/logic.py Outdated Show resolved Hide resolved
@ajrbyers ajrbyers requested a review from mauromsl April 24, 2024 11:05
Copy link
Member

@mauromsl mauromsl left a comment

Choose a reason for hiding this comment

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

Just a comment with an intended typo, but otherwise good!

src/templates/admin/review/add_review_assignment.html Outdated Show resolved Hide resolved
@mauromsl mauromsl assigned joemull and unassigned mauromsl Apr 24, 2024
Copy link
Member

@joemull joemull left a comment

Choose a reason for hiding this comment

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

This is a thing of beauty! I tested it out and everything is working perfectly. The extra help text is nice too. The only thing I'd tweak are two comma splices:

...this process is silent, so they will not...

...will appear at the top of this list. They will show with...

src/templates/admin/review/add_review_assignment.html Outdated Show resolved Hide resolved
@joemull joemull assigned ajrbyers and unassigned joemull Apr 24, 2024
@ajrbyers ajrbyers requested review from mauromsl and joemull April 24, 2024 15:28
@ajrbyers ajrbyers assigned joemull and unassigned ajrbyers Apr 24, 2024
@joemull joemull merged commit 269a178 into master Apr 24, 2024
1 check failed
@joemull joemull deleted the 4081-bugfix branch April 24, 2024 15:57
@mauromsl mauromsl restored the 4081-bugfix branch May 14, 2024 19:00
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.

"Display List of Reviewers from Past Review Rounds" breaks reviewer adding
3 participants