-
Notifications
You must be signed in to change notification settings - Fork 9
feat: auto-roll chromium deps SHA in build-images when files change #161
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
base: main
Are you sure you want to change the base?
feat: auto-roll chromium deps SHA in build-images when files change #161
Conversation
Add automation to create PRs for updating the CHROMIUM_SRC_SHA in electron/build-images when the monitored Chromium files (build/install-build-deps.sh, build/install-build-deps.py) change between the current pinned SHA and Chromium HEAD. This runs both as a cron job and automatically when Chromium PRs are merged in electron/electron, but only creates PRs when there's an actual difference in the monitored files.
Add comprehensive tests for the didChromiumFilesChange function: - Returns false when no files changed between SHAs - Returns true when first/second/both files changed - Returns false when content only differs in whitespace - Handles empty file list and single file cases - Tests getChromiumHeadSha and getChromiumFileContent utilities
jkleinsc
left a comment
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.
@claude use fetch instead of writing your own get method
Simplify chromium-gitiles.ts by using Node.js native fetch API instead of manually implementing HTTP requests with the https module.
| d(`Found existing PR: #${pr.number} opened by ${pr.user.login}`); | ||
|
|
||
| // Check to see if automatic roll has been temporarily disabled | ||
| const hasPauseLabel = pr.labels.some((label) => label.name === 'roller/pause'); |
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.
note: at some point we should really pull 'roller/pause' out into src/constants.ts since multiple files now have it duplicated.
| const { owner, repo } = REPOS.buildImages; | ||
|
|
||
| const diffLink = | ||
| `https://chromium.googlesource.com/chromium/src/+log/` + |
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.
| `https://chromium.googlesource.com/chromium/src/+log/` + | |
| 'https://chromium.googlesource.com/chromium/src/+log/' + |
suggestion(non-blocking): this could be single quotes rather than backticks since there's no substitution in this part which is just being concatenated.
| ); | ||
|
|
||
| const match = content.match(CHROMIUM_SHA_REGEX); | ||
| if (!match || !match[1]) { |
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.
| if (!match || !match[1]) { | |
| if (!match?.[1]) { |
suggestion(non-blocking): modern syntax is nice
Add automation to create PRs for updating the CHROMIUM_SRC_SHA in electron/build-images when the monitored Chromium files (build/install-build-deps.sh, build/install-build-deps.py) change between the current pinned SHA and Chromium HEAD.
This runs both as a cron job and automatically when Chromium PRs are merged in electron/electron, but only creates PRs when there's an actual difference in the monitored files.