Closed Bug 1248592 Opened 5 years ago Closed 5 years ago

Add an API endpoint for disabling autoland

Categories

(MozReview Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dminor, Assigned: dminor)

Details

Attachments

(2 files)

To allow sheriffs to disable autoland, we should add an admin page to MozReview along with an associated permission which allows those settings to be edited.
(In reply to Dan Minor [:dminor] from comment #0)
> To allow sheriffs to disable autoland, we should add an admin page to
> MozReview along with an associated permission which allows those settings to
> be edited.

It would be much simpler to just add an API endpoint which can be hit to do this. Maybe we should start with that and then we could always build a front-end view for accessing this API later?
Product: Developer Services → MozReview
This no longer seems relevant now that we can push to review directly from
git. The corresponding autoland code was removed months ago. We can pull it
out from version control if for some reason we need to resurrect it.

Review commit: https://reviewboard.mozilla.org/r/37147/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/37147/
Attachment #8724765 - Flags: review?(smacleod)
Comment on attachment 8724765 [details]
MozReview Request: mozreview: remove import pullrequest code (bug 1248592) r?smacleod

https://reviewboard.mozilla.org/r/37147/#review34165
Attachment #8724765 - Flags: review?(smacleod) → review+
Comment on attachment 8724766 [details]
MozReview Request: mozreview: add API endpoint to enable/disable autoland (bug 1248592) r?smacleod

https://reviewboard.mozilla.org/r/37149/#review34167

::: pylib/mozreview/mozreview/autoland/resources.py:536
(Diff revision 1)
> +    @webapi_response_errors(DOES_NOT_EXIST, NOT_LOGGED_IN,

You never return a `NOT_LOGGED_IN` - are you seeing this coming from your resource? I'd have thought you'd need to decorate with `webapi_login_required` or something

::: pylib/mozreview/mozreview/autoland/resources.py:551
(Diff revision 1)
> +    @webapi_response_errors(DOES_NOT_EXIST, NOT_LOGGED_IN,

same with regards to `NOT_LOGGED_IN`

::: pylib/mozreview/mozreview/autoland/resources.py:567
(Diff revision 1)
> +

remove this blank line

::: pylib/mozreview/mozreview/autoland/resources.py:580
(Diff revision 1)
> +        logger.info('Setting autoland enable: repository %s: try: %s '
> +                    'landing: %s' % (kwargs[self.uri_object_key],
> +                    autolanding_to_try_enabled, autolanding_enabled))

should we stick the requesting user in here?

::: testing/vcttesting/mozreview.py:263
(Diff revision 1)
>          with futures.ThreadPoolExecutor(6) as e:

we maybe want to bump this to 7
Attachment #8724766 - Flags: review?(smacleod) → review+
Assignee: nobody → dminor
Status: NEW → ASSIGNED
https://reviewboard.mozilla.org/r/37149/#review34167

> You never return a `NOT_LOGGED_IN` - are you seeing this coming from your resource? I'd have thought you'd need to decorate with `webapi_login_required` or something

It was accidentally cargo-culted from another resource.
Comment on attachment 8724765 [details]
MozReview Request: mozreview: remove import pullrequest code (bug 1248592) r?smacleod

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/37147/diff/1-2/
Comment on attachment 8724766 [details]
MozReview Request: mozreview: add API endpoint to enable/disable autoland (bug 1248592) r?smacleod

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/37149/diff/1-2/
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Summary: Add an admin page for disabling autoland → Add an API endpoint for disabling autoland
You need to log in before you can comment on or make changes to this bug.