Closed Bug 1184079 Opened 9 years ago Closed 9 years ago

Automatic publishing not working

Categories

(MozReview Graveyard :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ted, Assigned: smacleod)

References

Details

Attachments

(1 file)

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.
Yes, this is a side effect of using cookies for auth. API tokens will eventually replace username/password and cookie auth in the client.
Assignee: nobody → gps
Priority: -- → P1
Let's look into upgrading rbtools and see if that fixes it.
Assignee: gps → smacleod
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)
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 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+
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.
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
Closed: 9 years ago
Resolution: --- → FIXED
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: