Skip to content
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

Check Chromium revision pinning scripts into repo #4220

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

DanielRyanSmith
Copy link
Contributor

@DanielRyanSmith DanielRyanSmith commented Jan 29, 2025

This adds the source code for the GCP cloud functions that are run to automatically update the pinned Chromium revision in the WPT repository.

Subsequent changes will come with deployment and update instructions.

@past past closed this Feb 4, 2025
@past past reopened this Feb 4, 2025
@DanielRyanSmith DanielRyanSmith marked this pull request as ready for review February 5, 2025 00:01
Copy link
Collaborator

@jcscottiii jcscottiii left a comment

Choose a reason for hiding this comment

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

Thanks for adding these scripts. I added some comments to expand on how to deploy.

Also, you will find a comment on pinning our GitHub API version.

Other comments are nits or questions.

Let me know if you have any questions!

The purpose of this script is to check the WPT CI check suite to see if all
tests passed for the new revision, and to update the pinned revision if so.

The current PR used for running the check suites is at https://github.com/web-platform-tests/wpt/pull/50375
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add the command(s) to deploy these scripts in each section?

Also, do you know how to generate the GIT_CHECK_PR_STATUS_TOKEN stored in secret manager that is used in both of these scripts?

Also, do you know about the instructions for process_test_history?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Any instructions on how to create these PRs in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you add the command(s) to deploy these scripts in each section?

I've been doing it through the GCP UI, but I'll look up and add instructions for this.

Also, do you know how to generate the GIT_CHECK_PR_STATUS_TOKEN stored in secret manager that is used in both of these scripts?

These are instructions I need to add as well, but I was thinking this might be better suited to live in our rotation docs.

Also, do you know about the instructions for process_test_history?

The instructions file build_test_history.py is what describes this, but I now realize I've not coordinated the names correctly here. It should probably be that "build_test_history" should be renamed to "process_test_history" to match the Cloud Function name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any instructions on how to create these PRs in the future?

Do you mean creating new cloud functions in the future? Or making changes to these files?

scripts/README.md Outdated Show resolved Hide resolved
# Reopen the PR to run the CI tests.
s = requests.Session()
s.headers.update({"Authorization": f"token {get_token()}"})
url = f"https://api.github.com/repos/{REPO_OWNER}/{REPO_NAME}/pulls/{PR_NUMBER}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should either:

  1. Use the GitHub client python library
  2. Manually pin the X-GitHub-Api-Version header in each API call.

s.headers.update({
"Authorization": f"token {get_token()}"
})
url = f"https://api.github.com/repos/{REPO_OWNER}/{REPO_NAME}/commits/{get_sha()}/check-suites"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should either:

  1. Use the GitHub client python library
  2. Manually pin the X-GitHub-Api-Version header in each API call.

Right now, we are expecting the response to be a certain format. If the API version changes and the shape of the response changes, we will start to get KeyError. (for example when we go to check the conclusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I think I'll approach using #2 and make changes once I confirm everything functions as expected.

("Win_x64", "chrome-win.zip"),
("Win", "chrome-win.zip"),
("Linux_x64", "chrome-linux.zip"),
("Mac", "chrome-mac.zip")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Outside the scope of this: But I wonder how this will work when we want Android given Chrome on Android runs on Chromium CI. We probably still want some coverage. Might be worth bringing this up to Weizhong.

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'm not very familiar with the Chrome Android work, but is this shouldn't affect run for Chrome Android because it's considered a different product and does not use the pinned revision here (I might also be misunderstanding your comment 😅)

Comment on lines 21 to 23
PR_NUMBER = "50375"
REPO_OWNER = "web-platform-tests"
REPO_NAME = "wpt"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thoughts on making these environment variables? A user shouldn't really need to change the code just to update these variables. Instead, they could quickly deploy the app with updated variables. You could do more of these variables but this set would be a good start.

[1]

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 can definitely make these environment variable instead 🙂

Co-authored-by: James C Scott III <[email protected]>
@DanielRyanSmith
Copy link
Contributor Author

Thanks for taking such a good look at this James! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants