-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[results-processor] Provide GitHub token for api.github.com #4025
[results-processor] Provide GitHub token for api.github.com #4025
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my first time really digging into the processor code.
LGTM with some nits.
@@ -112,6 +112,14 @@ def known_extension(path): | |||
return e | |||
return None | |||
|
|||
def _secret(self, token_name): | |||
key = self.datastore.key('Token', token_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all paths that trigger this code are guarded by _internal_only. Which ensures that '/api/results/process'
is only called by the task queue. So we are good. But any other code starts to use this in the future, we probably want to have some more control over reading this secret when hitting '/api/results/process'
. Or at least some more logging to tell help.
The other thing that helps: We are only doing GET requests with the token, so the damage is limited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figuring out how to pass that through to the processor (which doesn't inherently rely on Flask/main/etc. today) seems kinda difficult. We can certainly add logging, though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a follow up issue for this? We can address that part later.
Something around logging which uploader is accessing the secret.
After you add the issue and the lint errors, feel free to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #4044
48512b3
to
f2b7494
Compare
Sometimes (e.g., from GitHub Actions), we might get passed a URL to process which on api.github.com, which requires a token to access. Thus, we should pull down our GitHub token and add that as a header.
f2b7494
to
ff7d947
Compare
I haven't had the time to investigate, but it looks like the web_components_test CI job is just constantly failing now? |
Filed #4046 for this; I'm just going to land this despite the failing check because it's pre-existing. |
https://staging.wpt.fyi/status seems to show everything getting stuck as WPTFYI_PROCESSING, though not showing up as empty any more. But probably time to go back to #4020 to analyse what's going on? |
Sometimes (e.g., from GitHub Actions), we might get passed a URL to process which on api.github.com, which requires a token to access. Thus, we should pull down our GitHub token and add that as a header.
See also #4020, which this hopefully fixes.