Automatic publishing not working

RESOLVED FIXED

Status

MozReview
General
P1
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: ted, Assigned: smacleod)

Tracking

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
I've gotten this reliably for every review I've pushed recently:

```
$ hg push review -c 59ef1903d9b8
pushing to ssh://reviewboard-hg.mozilla.org/gecko
searching for changes
remote: adding changesets                                                                             
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 1 changes to 5 files (+1 heads)
remote: Trying to insert into pushlog.
remote: Inserted into the pushlog db successfully.
submitting 1 changesets for review

changeset:  272100:59ef1903d9b8
summary:    bug 1182519 - Put mozconfigs for cross-mac builds in tree. r?mshal
review:     https://reviewboard.mozilla.org/r/13307 (draft)

review id:  bz://1182519/ted
review url: https://reviewboard.mozilla.org/r/13305 (draft)

publish this review request now (Yn)? 
remote: WARNING:root:There was an error while creating a cookie file: [Errno 13] Permission denied: '/.rbtools-cookies'
error publishing review request 13305: You are not logged in (HTTP 401, API Error 103)
(review requests not published; visit review url to attempt publishing there)
```
Likewise. I'm told the problem will be solved by bug 993233.
Also, a workaround is to explicitly put your BMO credentials in your .hgrc file, as described here: http://mozilla-version-control-tools.readthedocs.org/en/latest/mozreview/install.html#configuring-the-mercurial-extension.

Comment 3

2 years ago
Yes, this is a side effect of using cookies for auth. API tokens will eventually replace username/password and cookie auth in the client.

Updated

2 years ago
Assignee: nobody → gps
Priority: -- → P1

Comment 4

2 years ago
Let's look into upgrading rbtools and see if that fixes it.
Assignee: gps → smacleod
(Assignee)

Comment 5

2 years ago
Created attachment 8637267 [details]
MozReview Request: mozreview: start passing cookie authentication when auto publishing (Bug 1184079). r?gps

mozreview: start passing cookie authentication when auto publishing (Bug 1184079). r?gps

We were not using provided cookie credentials to authenticate with
Review Board when automatically publishing review requests on push. We
now use these credentials if they are provided.

Also, we use the RBClient context manager from reviewboardmods.pushhooks
to avoid issues with the RBTools cache and cookie files that we hit with
the RBTools version we are using. Once we are able to upgrade to a
newer version of RBTools we should be able to remove the hacks here as
well.
Attachment #8637267 - Flags: review?(gps)
(Assignee)

Comment 6

2 years ago
https://reviewboard.mozilla.org/r/13831/#review12417

::: hgext/reviewboard/hgrb/proto.py:449
(Diff revision 1)
> -    for k, v in o['other']:
> +        for k, v in o['other']:
> -        if k != 'reviewid':
> +            if k != 'reviewid':
> -            continue
> +                continue
>  
> -        rrid = urllib.unquote(v)
> +            rrid = urllib.unquote(v)
> -        try:
> +            try:
> -            rr = root.get_review_request(review_request_id=rrid)
> +                rr = root.get_review_request(review_request_id=rrid)
> -            draft = rr.get_draft()
> +                draft = rr.get_draft()
> -            draft.update(public=True)
> +                draft.update(public=True)
> -            lines.append('success %s' % rrid)
> +                lines.append('success %s' % rrid)
> -        except APIError as e:
> +            except APIError as e:
> -            lines.append('error %s %s' % (rrid, str(e)))
> +                lines.append('error %s %s' % (rrid, str(e)))

I love indentation markers :)

Comment 7

2 years ago
Comment on attachment 8637267 [details]
MozReview Request: mozreview: start passing cookie authentication when auto publishing (Bug 1184079). r?gps

https://reviewboard.mozilla.org/r/13831/#review12419

::: hgext/reviewboard/server.py:179
(Diff revision 1)
> +                           username=None, password=None, userid=None,
> +                           cookie=None) as client:

Do these arguments not default to None?
Attachment #8637267 - Flags: review?(gps) → review+
(Assignee)

Comment 8

2 years ago
https://reviewboard.mozilla.org/r/13831/#review12419

> Do these arguments not default to None?

They do not. I've fixed them so that they do though, and changed this call.
(Assignee)

Comment 9

2 years ago
Should be fixed after deploy of
https://hg.mozilla.org/hgcustom/version-control-tools/rev/7ed8fd035bbc
(Assignee)

Comment 10

2 years ago
This has been deployed for a few days and appears to be fixed - please reopen and provide the error message if this fails for you still.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED

Updated

2 years ago
Duplicate of this bug: 1181886
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.