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

tests(devtools): dynamically fetch chromium version #12232

Merged
merged 2 commits into from
Mar 16, 2021
Merged

Conversation

brendankenny
Copy link
Member

Use the github API to fetch the latest commit message from the Chromium mirror.

There's not really any way to get commit info from a remote git repo without cloning, and the Github API seems more likely to be stable long-term than any feed on googlesource.com.

We may have to update the branch name to main in the github API url when the chromium/src migration occurs: https://groups.google.com/a/chromium.org/g/infra-announce/c/-uMWoep7RNA

@brendankenny brendankenny requested a review from a team as a code owner March 11, 2021 02:10
@brendankenny brendankenny requested review from connorjclark and removed request for a team March 11, 2021 02:10
@google-cla google-cla bot added the cla: yes label Mar 11, 2021
const commitMessage = JSON.parse(latestCommit).commit.message;
const commitPosition = /Cr-Commit-Position: refs\/heads\/master@\{#([0-9]+)\}/.exec(commitMessage)[1];

return commitPosition;
Copy link
Member Author

Choose a reason for hiding this comment

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

we could do something like return commitPosition - commitPosition % 1000; or something if we still want this to only update periodically

Copy link
Member Author

Choose a reason for hiding this comment

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

we could do something like return commitPosition - commitPosition % 1000; or something if we still want this to only update periodically

This seems unnecessary for now unless anyone really thinks they want it. This is often a few seconds even with a download and unzip

Copy link
Collaborator

@connorjclark connorjclark Mar 12, 2021

Choose a reason for hiding this comment

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

This is often a few seconds ...

Not if you're on bad wifi like I currently am :)

what's the ~time delta for 1000 revisions?

Copy link
Member

Choose a reason for hiding this comment

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

what's the ~time delta for 1000 revisions?

there's about 420 revisions per weekday.

🕶️

@@ -18,6 +18,7 @@ const MAX_CONTENT_SHELLS = 10;
const PLATFORM = getPlatform();
const LH_ROOT = `${__dirname}/../..`;
const CACHE_PATH = path.resolve(LH_ROOT, '.tmp', 'chromium-web-tests', 'content-shells');
const COMMIT_POSITION_UPDATE_PERIOD = 420;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

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

Successfully merging this pull request may close these issues.

4 participants