Non-existent branches need to be properly handled

RESOLVED FIXED

Status

Release Engineering
General
RESOLVED FIXED
6 years ago
a year ago

People

(Reporter: mjessome, Assigned: mjessome)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 617927 [details] [diff] [review]
Fix branch handling v1

When autoland is flagged for a branch that does not exist, the permissions API (which checks permissions on hg repos) will return None. We want to use this as an indication that it is an invalid branch, and fail out with an appropriate comment back to the user.

This also takes care of some small mistakes that were made with "branch" variable usage.
Attachment #617927 - Flags: review?(rail)
Comment on attachment 617927 [details] [diff] [review]
Fix branch handling v1

Waiting for v2...
Attachment #617927 - Flags: review?(rail)
(Assignee)

Comment 2

6 years ago
Created attachment 617958 [details] [diff] [review]
Fix branch handling v2

Version 2, using an Exception rather than a common return value.
Attachment #617927 - Attachment is obsolete: true
Attachment #617958 - Flags: review?(rail)
Comment on attachment 617958 [details] [diff] [review]
Fix branch handling v2

Review of attachment 617958 [details] [diff] [review]:
-----------------------------------------------------------------

::: autoland_queue.py
@@ +690,5 @@
> +    try:
> +        branch_perms = ldap.get_branch_permissions(branch.name)
> +    except ldap_utils.BranchDoesNotExist:
> +        post_comment("Autoland Failure:\n"
> +                     "Cannot land to branch %s."

A nit: add \n here.
Attachment #617958 - Flags: review?(rail) → review+
(Assignee)

Updated

6 years ago
Attachment #617958 - Flags: checked-in+
(Assignee)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [autoland]
Product: mozilla.org → Release Engineering
Component: Tools → General
Product: Release Engineering → Release Engineering
You need to log in before you can comment on or make changes to this bug.