[Monorail API Access] Chromium Issues

271 views
Skip to first unread message

nm6...@g.rit.edu

unread,
Oct 11, 2016, 11:32:32 PM10/11/16
to infra-dev
Hello,

My name is Nuthan Munaiah and I am a PhD student at the Rochester Institute of Technology, Rochester, NY, USA. I am currently working on a research project in which we are using Natural Language Processing (NLP) to analyze code reviews in the Chromium project. As part of this project, we need access to the bug information in the Chromium bug repository to properly categorize code reviews. After reading the Monorail API documentation (https://docs.google.com/document/d/1asuQNC5tAUvKDf9G9G3IxymuhDxnPCn_fSzX2wwcC6M/edit), I understand that you need information on our usage scenarios to allow us to use the API. Here is the information needed as per the documentation:

0. Requirements
===============

I need access to all details of Chromium issues/bugs.

1. Whitelist
============

I have created a Google Service Account that will be used when accessing the API. The specifics of the account are:

"client_email": "chromium...@appspot.gserviceaccount.com"
"client_id": "106604744474102536576"

2. Permission
=============

I need access to the *Chromium* project.

Please let us know if you need more information.

Thank you,
Nuthan Munaiah

Nodir Turakulov

unread,
Oct 11, 2016, 11:54:25 PM10/11/16
to Aaron Gable, infra-dev, nm6...@g.rit.edu
+agable

Aaron Gable

unread,
Oct 12, 2016, 1:52:32 PM10/12/16
to Nodir Turakulov, Aaron Gable, infra-dev, nm6...@g.rit.edu
Thanks, Nuthan!

Sorry for the extra work, but can you please file a bug with this same information? It's easier for us to keep track of who requested access (and when) that way.

Thanks!

P.S. Where did you find the link to that doc? I recently updated what I thought was the only version of the "API Getting Started" doc to ask folks to file bugs, but I missed that copy of the doc and would like to replace it with the correct one.

On Tue, Oct 11, 2016 at 8:54 PM Nodir Turakulov <no...@google.com> wrote:
+agable

nm6...@g.rit.edu

unread,
Oct 12, 2016, 2:23:48 PM10/12/16
to infra-dev, no...@google.com, aga...@chromium.org, nm6...@g.rit.edu
Thanks Aaron. I created a new issue (Issue ID 1841) on the Monorail Issue Tracking System.

Here is the sequence of links to get to documentation I cited:

1. Click *documentation* on https://apis-explorer.appspot.com/apis-explorer/?base=https://monorail-prod.appspot.com/_ah/api#p/monorail/v1/

2. Click *One-page getting started* on https://chromium.googlesource.com/infra/infra/+/master/appengine/monorail/doc/api.md

Aaron Gable

unread,
Oct 12, 2016, 2:44:46 PM10/12/16
to nm6...@g.rit.edu, infra-dev, no...@google.com, aga...@chromium.org
Perfect, thanks! I'll update that link to point at the updated getting started instructions.

Also, thanks for filing the bug. I'll get you whitelisted shortly.

Aaron

--
You received this message because you are subscribed to the Google Groups "infra-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+...@chromium.org.
To post to this group, send email to infr...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/8160cd38-6d6f-421b-95a0-c95f344cd28b%40chromium.org.

nm6...@g.rit.edu

unread,
Oct 21, 2016, 4:32:15 PM10/21/16
to infra-dev, nm6...@g.rit.edu, no...@google.com, aga...@chromium.org
Hi Aaron,

I seem to be having trouble accessing the Monorail API using the service account. I get an exception when I attempt to access the API. I have included the source code and the exception below.

I used the source code example from https://chromium.googlesource.com/infra/infra/+/master/appengine/monorail/doc/example.py as the base. Additionally, I read the documentation on using OAuth 2.0 from https://oauth2client.readthedocs.io/en/latest/source/oauth2client.service_account.html#oauth2client.service_account.ServiceAccountCredentials

Code

import apiclient

from httplib2 import Http
from oauth2client.service_account import ServiceAccountCredentials

DISCOVERY_URL = 'https://monorail-prod.appspot.com/_ah/api/discovery/v1/'\
'apis/{api}/{apiVersion}/rest'

if __name__ == '__main__':
scopes = ['https://www.googleapis.com/auth/userinfo.email']
credentials = ServiceAccountCredentials.from_json_keyfile_name(
'project-3e3c2d88d882.json', scopes
)
http = credentials.authorize(Http())
monorail = apiclient.discovery.build(
'monorail', 'v1', discoveryServiceUrl=DISCOVERY_URL, http=http
)
issues = monorail.issues().list(projectId='chromium').execute()
print(issues)

Exception

Traceback (most recent call last):
File "scratch.py", line 18, in <module>
issues = monorail.issues().list(projectId='chromium').execute()
File "<path>/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "<path>/googleapiclient/http.py", line 838, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 404 when requesting https://monorail-prod.appspot.com/_ah/api/monorail/v1/projects/chromium/issues?alt=json returned "The user does not exist: ['chromium...@appspot.gserviceaccount.com']">
Reply all
Reply to author
Forward
0 new messages