Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Allow parse_and_send to use access tokens #22019

Merged
merged 3 commits into from
Oct 29, 2020

Conversation

liyuqian
Copy link
Contributor

@liyuqian liyuqian commented Oct 21, 2020

Related issue: flutter/flutter#67579

This change depends on liyuqian/metrics_center@395a459

@google-cla google-cla bot added the cla: yes label Oct 21, 2020
@liyuqian liyuqian requested a review from godofredoc October 21, 2020 17:35
@liyuqian
Copy link
Contributor Author

@godofredoc : please let me know if this is sufficient for LUCI. Do you have a LUCI recipe that I can try this with?

@liyuqian liyuqian force-pushed the support_access_token branch from d5e6b24 to f86dc37 Compare October 26, 2020 20:36
if (env.containsKey(kTokenPath) && env.containsKey(kGcpProject)) {
return FlutterDestination.makeFromAccessToken(
env[kTokenPath],
env[kGcpProject],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Contributor Author

@liyuqian liyuqian Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, no as we default the project id to be flutter-cirrus if it's not provided.

However, to avoid any confusion, I felt it's better to set the token and GCP project id in one place because one might need to change the token when the project is changed (or vice versa). The recipe example you gave me also set the token and the project id in one place.

I'm Ok either way. If there's a difficulty in giving the GCP project id in the environment variables, or if you'd like to omit it, I can easily remove it from this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(The current PR does require env.containsKey(kGcpProject) to be true though. I can remove it so it's not needed.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I advanced a little bit but the authenticated client is rejecting the token: https://chromium-swarm.appspot.com/task?id=4f8147477ee94610

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I need to add LUCI's service account to flutter-cirrus project's access list. Do you have the id of that service account, or can you put a link to your recipe so maybe I can look it up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service account is "flutter-try-builder@chops-service-accounts.iam.gserviceaccount.com" I tried adding it yesterday but maybe I didn't granted it the correct permissions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's strange. "Cloud Datastore User" should be the correct role... Is there someway to verify that the generated token belongs to that service account (e.g. write a script that takes an access token and use some APIs to print out the id)?

Copy link
Contributor

@godofredoc godofredoc Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The easiest way will be to generate a token using gcloud auth application-default print-access-token and passing it directly to the tool to see if the tool is processing the token in the expected way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcloud auth application-default print-access-token seems to require a credentials json of the service account to print the access token? If so, I've already done a similar test by generating the token from the credentials and send it to the script: https://github.com/flutter/engine/pull/22019/files#diff-f2e2f624ef84bb33cc75f9c5a09e1c0f9371eb06d5b73ce94fd65ca6ee052b92R40

Copy link
Contributor

@godofredoc godofredoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liyuqian liyuqian added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Oct 28, 2020
@fluttergithubbot fluttergithubbot merged commit acece00 into flutter:master Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 30, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 30, 2020
GaryQian pushed a commit to flutter/flutter that referenced this pull request Oct 30, 2020
* 53d5d68 Add dart-lang/sdk's new package:clock dependency (flutter/engine#22142)

* c32e3d8 Roll Skia from 7737a5bd2510 to 5567a6091ceb (8 revisions) (flutter/engine#22146)

* 376045c Roll Fuchsia Linux SDK from XYN02FThN... to UKgKCjxSA... (flutter/engine#22147)

* 03395de Roll Fuchsia Mac SDK from GKPwGj1Ux... to xHjtLQPQ5... (flutter/engine#22151)

* 0c7e952 Manual Dart SDK roll 6e015bd9cddb to 9c6e76468ca4 (6 revisions (flutter/engine#22153)

* e5f168a Update constraint to latest integration test (flutter/engine#22169)

* e61e8c2 Smooth window resizing on macOS (flutter/engine#21525)

* acece00 Allow parse_and_send to use access tokens (flutter/engine#22019)

* 0270632 Includes roles for links, checkboxes, and radio buttons in semantics (flutter/engine#22061)

* 632354d Roll Fuchsia Linux SDK from UKgKCjxSA... to PY5hNI-wY... (flutter/engine#22175)

* 62d50af Add plumbing for command line arguments on Windows (flutter/engine#22094)

* 06b0910 Fix possible use of std::moved value in Rasterizer (flutter/engine#22125)

* 005dec4 [web] Clean up unused previousStyle logic (flutter/engine#22150)

* ca05bdc Roll Skia from 5567a6091ceb to f548a028ce70 (7 revisions) (flutter/engine#22155)

* 5b07ac4 Roll Fuchsia Mac SDK from xHjtLQPQ5... to ICK_JlnKJ... (flutter/engine#22188)

* d615a97 Roll Fuchsia Linux SDK from PY5hNI-wY... to Usec4YBzR... (flutter/engine#22197)

* 11ed711 Invalidate the cached SkParagraph font collection when a new font manager is installed (flutter/engine#22157)

* 07c780b [web] Assign default natural width/height for svgs that report 0,0 on firefox and ie11 (flutter/engine#22184)

* b54bb88 Migrate runZoned to runZonedGuarded (flutter/engine#22198)

* 247139a [web] Fix transform not invalidating path bounds causing debugValidate failure (flutter/engine#22172)

* e4dffc1 [web] Fix scroll wheel line delta on Firefox. (flutter/engine#21928)

* d6627c6 Reland [ios] Refactor IOSSurface factory and unify surface creation (flutter/engine#22016)

* ce1dd11 Standardize macro names for dartdoc macros (flutter/engine#22180)

* f81bc37 [profiling] Handle thread_info to account for killed threads (flutter/engine#22170)

* fd94c86 Fix for firefox custom clipping (flutter/engine#22182)

* 9ccf9f1 bring back build_test to ensure we validate licenses (flutter/engine#22201)

* 38f6665 Set strut font to Roboto if the given font hasn't been registered (flutter/engine#22129)

* caf32d5 Add a proc table version of embedder API (flutter/engine#21813)

* ed0f477 Use preTranslate when applying offset to matrix (flutter/engine#21648)

* b457e2d Refactor make_mock_engine into fl_test (flutter/engine#21585)

* 28497c8 Fix typos in FlValue docs (flutter/engine#21875)

* bb32446 Fix FlTextInputPlugin tear down (flutter/engine#22007)

* 7a7804b Add "input shield" to capture pointer input for reinjection (flutter/engine#22067)

* fe85f94 Update painting.dart (flutter/engine#22195)

* 99cc50d [ios] Surface factory holds the canonical reference to the external view embedder (flutter/engine#22206)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 30, 2020
@liyuqian liyuqian deleted the support_access_token branch November 11, 2020 23:13
chaselatta pushed a commit to chaselatta/engine that referenced this pull request Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants