Last Comment Bug 1184079 - Automatic publishing not working
: Automatic publishing not working
Status: RESOLVED FIXED
:
Product: MozReview
Classification: Other
Component: General (show other bugs)
: unspecified
: Unspecified Unspecified
P1 normal
: ---
Assigned To: Steven MacLeod [:smacleod]
:
:
Mentors:
: 1181886 (view as bug list)
Depends on: 1177945
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-15 05:04 PDT by Ted Mielczarek [:ted.mielczarek]
Modified: 2016-02-21 20:31 PST (History)
4 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

MozReview Requests
Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:
Show discarded requests

Attachments
MozReview Request: mozreview: start passing cookie authentication when auto publishing (Bug 1184079). r?gps (40 bytes, text/x-review-board-request)
2015-07-22 08:56 PDT, Steven MacLeod [:smacleod]
gps: review+
Details | Review

Description User image Ted Mielczarek [:ted.mielczarek] 2015-07-15 05:04:07 PDT
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)
```
Comment 1 User image Botond Ballo [:botond] 2015-07-15 08:09:23 PDT
Likewise. I'm told the problem will be solved by bug 993233.
Comment 2 User image Botond Ballo [:botond] 2015-07-15 08:10:47 PDT
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 User image Gregory Szorc [:gps] (away until 2017-03-20) 2015-07-15 18:29:11 PDT
Yes, this is a side effect of using cookies for auth. API tokens will eventually replace username/password and cookie auth in the client.
Comment 4 User image Mark Côté [:mcote] 2015-07-16 10:20:52 PDT
Let's look into upgrading rbtools and see if that fixes it.
Comment 5 User image Steven MacLeod [:smacleod] 2015-07-22 08:56:52 PDT
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.
Comment 6 User image Steven MacLeod [:smacleod] 2015-07-22 08:57:30 PDT
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 User image Gregory Szorc [:gps] (away until 2017-03-20) 2015-07-22 09:02:24 PDT
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?
Comment 8 User image Steven MacLeod [:smacleod] 2015-07-22 10:06:34 PDT
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.
Comment 9 User image Steven MacLeod [:smacleod] 2015-07-22 10:08:58 PDT
Should be fixed after deploy of
https://hg.mozilla.org/hgcustom/version-control-tools/rev/7ed8fd035bbc
Comment 10 User image Steven MacLeod [:smacleod] 2015-07-27 09:05:24 PDT
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.
Comment 11 User image Mark Côté [:mcote] 2015-07-27 09:14:12 PDT
*** Bug 1181886 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.