DescriptionRietveld schedules builds on buildbucket
Rietveld deprecated UI now schedules builds through buildbucket instead of
/edit_flags endpoint. It uses Google API JavaScript Client (gapi) to
authenticate the user to Google APIs and call buildbucke.put() on their behalf.
API authentication happens the first time the user tries to schedule builds: a
popup windows opens asking for user's consent to share their email address with
Rietveld. Then the access token is saved to cookies. This consent screen happens
because API authentication and GAE authentication are separate.
If user logs out and logs in with a different rietveld account, API will be
authenticated with a different user by sending "login_hint" query string
parameter during authentication.
BuildBucket buckets have own ACLs. Users in chromium-project-tryjob-access
group [1] have SCHEDULER role on master.tryserver.chromium.* buckets.
The client id used to call APIs must be put into the "OwnClientId" entity
with key "web". It is created on the first attempt to load any page. The client id is
included in the rendered in base.html template. Then script.js uses it to call
authenticate to APIs. If client id is not set, nothing will blow up, but users
won't be able to schedule builds.
script.js now has global "rietveld" variable and keeps global state there. The
rationale is to avoid polluting global namespace.
Two dependencies added:
* Google API JavaScript API
* ES6 Promise polyfill
Instructions for deployment:
* Create a new client id in Permissions page of the Developer Console
* Whitelist the client id at
https://chrome-infra-auth.appspot.com/auth/oauth_config
* Upload a new version
* Load any page
* Go to Developers Console, find an existing OwnClientId entity and set
its client_id property
* Verify that build scheduling works
[1]: https://chrome-infra-auth.appspot.com/auth/groups#project-chromium-tryjob-access
R=jrobbins@chromium.org
CC=esprehn@chromium.org, sheyang@chromium.org
BUG=461620
COMMIT=false (CQ-BuildBucket will be verified first. Then M_scheduleBuild will be updated if needed)
Patch Set 1 : #
Total comments: 8
Messages
Total messages: 31 (6 generated)
|