-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
[build] update CDP from daily pin browser workflow #17872
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
7bc0df1
[build] run full Ruby tests on major browser PRs and regenerate CDP i…
titusfortner 7ed3314
[build] log update_browsers decisions and guard chrome-major parsing
titusfortner c794ab9
[build] verify CDP regeneration produced the pinned Chrome major's dir
titusfortner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| #!/usr/bin/env bash | ||
| # Refresh pinned browsers/drivers; when a new stable Chrome major has no checked-in DevTools | ||
| # version, regenerate CDP so the two never drift. Writes the job "output" as space-separated tags | ||
| # the PR reports: "major" on a Chrome/Firefox major bump (CI then runs the full Ruby matrix) and | ||
| # "cdp" when DevTools was regenerated. | ||
| # | ||
| # set -e is load-bearing: if update_cdp fails the job fails before "output" is written, so | ||
| # create-pr is skipped and a Chrome bump can never land ahead of its CDP. | ||
| set -euo pipefail | ||
|
|
||
| old="$RUNNER_TEMP/repositories-old.bzl" | ||
| git show HEAD:common/repositories.bzl > "$old" | ||
|
|
||
| bazel run //scripts:pinned_browsers | ||
|
|
||
| # Sorted-unique major versions of one family in a repositories.bzl; $1 = file, $2 = ERE matching | ||
| # "<download-url marker><major digits>". | ||
| majors_for() { grep -oE "$2" "$1" | grep -oE '[0-9]+$' | sort -un; } | ||
|
|
||
| # Only Chrome and Firefox majors warrant the full matrix: they ship ~monthly and are the likeliest | ||
| # to break the bindings. Edge tracks Chromium; driver-only and build/patch bumps do not count. Each | ||
| # ERE matches the marker preceding the major in the download URLs pinned in repositories.bzl. | ||
| declare -A families=( | ||
| [chrome]='chrome-for-testing-public/[0-9]+' | ||
| [firefox]='(firefox/releases/|Firefox%20)[0-9]+' | ||
| ) | ||
|
|
||
| # New stable Chrome is the lowest pinned major (beta runs ahead). Tolerate a no-match (|| true) so a | ||
| # marker/format change in repositories.bzl fails with a clear message, not a bare pipefail exit. | ||
| chrome_majors=$(majors_for common/repositories.bzl "${families[chrome]}") || true | ||
| chrome=${chrome_majors%%$'\n'*} | ||
| if [ -z "$chrome" ]; then | ||
| echo "::error::Could not parse a stable Chrome major from common/repositories.bzl (pattern: ${families[chrome]})" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "Stable Chrome major: v${chrome}" | ||
|
|
||
| # Regenerate CDP when the stable Chrome major has no checked-in devtools dir. | ||
| regen_cdp=false | ||
| if [ -d "common/devtools/chromium/v${chrome}" ]; then | ||
| echo "DevTools for Chrome v${chrome} already present; skipping CDP regeneration" | ||
| else | ||
| echo "No DevTools for Chrome v${chrome}; regenerating CDP" | ||
|
qodo-code-review[bot] marked this conversation as resolved.
|
||
| bazel run //scripts:update_cdp -- --chrome_channel=Stable | ||
| # update_cdp resolves the Stable channel itself; verify it produced this major's dir so a Stable | ||
| # release mid-run can't leave us pinning Chrome ahead of its DevTools (blocks the PR if it did). | ||
| if [ ! -d "common/devtools/chromium/v${chrome}" ]; then | ||
| echo "::error::CDP regeneration did not produce common/devtools/chromium/v${chrome}; refusing to pin Chrome ahead of its DevTools" >&2 | ||
| exit 1 | ||
| fi | ||
| regen_cdp=true | ||
| fi | ||
|
|
||
| major=false | ||
| for pattern in "${families[@]}"; do | ||
| if [ "$(majors_for "$old" "$pattern")" != "$(majors_for common/repositories.bzl "$pattern")" ]; then | ||
| major=true | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| output="" | ||
| [ "$major" = true ] && output="major" | ||
| [ "$regen_cdp" = true ] && output="${output:+$output }cdp" | ||
| echo "Update tags: ${output:-none}" | ||
| echo "output=$output" >> "$GITHUB_OUTPUT" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.