Disallow users from saying "Ship It!" to their own review requests.
Review Request #14198 — Created Oct. 11, 2024 and updated
We've always taken a pretty hands-off approach, preferring to encourage
conversation over policy. That said, one of the most requested bits of
policy is to make it so users can't mark their own review requests as
"Ship It". This is not only a reasonable policy ask (especially if
people are using approval workflows that can block pushes), but should
probably be the default.This change implements that. The visibility of the "Ship It" action and
checkbox in the review dialog are now conditional on this flag, and
reviews will refuse to publish (either via the UI or API).Because a big change like this may be controversial, I've added a toggle
for it in the admin settings, under a new page titled "Review Workflow".While adding tests for the action, I discovered that several of our
existing action tests were accidentally still testing the legacy
versions of the actions (imported via the old
reviewboard.reviews.default_actions
module). I've fixed it up so we
have separate tests for the legacy and modern versions of actions that
exist in the unified banner.
- Viewed a review request as both the owner and another user, and saw
that the visibility of the action and review dialog checkbox was
correct. - Toggled the setting in the admin and checked again, seeing that I
could restore previous behavior. - Ran unit tests.
Summary | ID |
---|---|
a8920586607ce182e28345cad8b7c0069daeb460 |
Description | From | Last Updated |
---|---|---|
continuation line missing indentation or outdented Column: 17 Error code: E122 |
reviewbot | |
Maybe better as JSONDict? |
maubin | |
This can be on one line. |
maubin | |
This can be on one line. |
maubin | |
Missing Version Added. |
chipx86 | |
Missing Version Added. |
chipx86 | |
Can we put the ) on the next line, so it's more akin to how we do {} and []? … |
chipx86 | |
Version Added. |
chipx86 | |
Should we have a trailing period? |
chipx86 | |
Missing Version Added. |
chipx86 | |
Can we add tests checking these conditions for this action? |
chipx86 | |
These can start on the return ( line, like the others. |
chipx86 | |
Single quote string here. |
chipx86 | |
Single quote string here and in the test below. |
chipx86 | |
Can we check against the specific error message as well? We should also compare the full rsp instead of just … |
chipx86 | |
line too long (84 > 79 characters) Column: 80 Error code: E501 |
reviewbot | |
continuation line unaligned for hanging indent Column: 33 Error code: E131 |
reviewbot | |
We seem to be setting one request and then creating a whole separate one for the context. Is this right? … |
chipx86 | |
We're fetching the user twice. Let's do it only once. |
chipx86 |
- Commits:
-
Summary ID e48bbd7267d500f1f887fba94c7175206262bccf ce192f063a2a7fdad383122f073119c038e04826 - Diff:
-
Revision 2 (+474 -60)
Checks run (2 succeeded)
- Commits:
-
Summary ID ce192f063a2a7fdad383122f073119c038e04826 a12cfc0820aaf92e1d6657c684756826e68fc7e3 - Diff:
-
Revision 3 (+468 -58)
Checks run (2 succeeded)
- Commits:
-
Summary ID a12cfc0820aaf92e1d6657c684756826e68fc7e3 cb8f7f5c526e3652773685f6abae8f84bc4cece1 - Branch:
-
release-7.xrelease-7.1.x
- Diff:
-
Revision 4 (+468 -58)
Checks run (2 succeeded)
- Commits:
-
Summary ID cb8f7f5c526e3652773685f6abae8f84bc4cece1 38761bb4829261a53be2d52d8584874b355e0db7 - Diff:
-
Revision 5 (+498 -58)
Checks run (2 succeeded)
- Description:
-
We've always taken a pretty hands-off approach, preferring to encourage
conversation over policy. That said, one of the most requested bits of policy is to make it so users can't mark their own review requests as "Ship It". This is not only a reasonable policy ask (especially if people are using approval workflows that can block pushes), but should probably be the default. This change implements that. The visibility of the "Ship It" action and
checkbox in the review dialog are now conditional on this flag, and reviews will refuse to publish (either via the UI or API). Because a big change like this may be controversial, I've added a toggle
for it in the admin settings, under a new page titled "Review Workflow". + + While adding tests for the action, I discovered that several of our
+ existing action tests were accidentally still testing the legacy + versions of the actions (imported via the old + reviewboard.reviews.default_actions
module). I've fixed it up so we+ have separate tests for the legacy and modern versions of actions that + exist in the unified banner. - Commits:
-
Summary ID 38761bb4829261a53be2d52d8584874b355e0db7 c5f6bf5545f12d7b84ca4d653c5ce899c80d07bf - Diff:
-
Revision 6 (+1130 -150)
- Commits:
-
Summary ID c5f6bf5545f12d7b84ca4d653c5ce899c80d07bf 1a3159ccb35b752b865b81b632e769d42beda40c - Diff:
-
Revision 7 (+1132 -150)
Checks run (2 succeeded)
-
-
-
We seem to be setting one request and then creating a whole separate one for the context. Is this right? If so, we should document why we're doing this.
If it's not right, and we want to
create_http_request
, that will take care of creating theResolverMatch
automatically. In fact, if we want these two separate requests, we could just let it do that and then assign the result intoself.request
to avoid duplicating the weirdResolverMatch
magic. -
- Commits:
-
Summary ID 1a3159ccb35b752b865b81b632e769d42beda40c a8920586607ce182e28345cad8b7c0069daeb460 - Diff:
-
Revision 8 (+1132 -166)