Repository navigation
ci: remove the update-lolhtml workflow #43364
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
Open
robobun
wants to merge
2
commits into
main
Choose a base branch
from
robobun/fa01f76d/remove-update-lolhtml
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 was deleted.
Oops, something went wrong.
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,55 @@ | ||
| /** | ||
| * Each .github/workflows/update-<name>.yml asks GitHub for the latest release | ||
| * of a repository. It reads the `<NAME>_COMMIT` pin in | ||
| * scripts/build/deps/<name>.ts with sed, and opens a pull request that rewrites | ||
| * the pin, also with sed, to the commit of that release. That only works when: | ||
| * | ||
| * - The repository it asks is the one the dep is fetched from. update-lolhtml.yml | ||
| * broke this way. The dep moved to the oven-sh/lol-html fork, the workflow | ||
| * still asked cloudflare/lol-html, and each weekly run proposed an upstream | ||
| * commit that bun cannot build. A dep that is fetched from a fork has no | ||
| * update workflow. | ||
| * - Its sed patterns match the pin line. A renamed constant, or a comment at the | ||
| * end of the line, makes each weekly run fail, and nobody watches those runs. | ||
| */ | ||
| import { expect, test } from "bun:test"; | ||
| import { readFileSync } from "node:fs"; | ||
| import { join } from "node:path"; | ||
|
|
||
| const repoRoot = join(import.meta.dir, "..", "..", ".."); | ||
| const workflowsDir = join(repoRoot, ".github", "workflows"); | ||
|
|
||
| test("each update workflow agrees with its dep file", () => { | ||
| const checked: string[] = []; | ||
| for (const workflow of new Bun.Glob("update-*.yml").scanSync(workflowsDir)) { | ||
| const text = readFileSync(join(workflowsDir, workflow), "utf8"); | ||
| const depFile = text.match(/^\s*DEP_FILE=(scripts\/build\/deps\/[\w-]+\.ts)$/m)?.[1]; | ||
| if (!depFile) { | ||
| // update-sqlite3.yml and update-vendor.yml do not bump a pin in scripts/build/deps/. | ||
| expect({ workflow, readsADepFile: text.includes("scripts/build/deps/") }).toEqual({ | ||
| workflow, | ||
| readsADepFile: false, | ||
| }); | ||
| continue; | ||
| } | ||
| const dep = readFileSync(join(repoRoot, depFile), "utf8"); | ||
|
|
||
| const asks = new Set(Array.from(text.matchAll(/api\.github\.com\/repos\/([\w.-]+\/[\w.-]+)\//g), m => m[1])); | ||
| // The `s/<pattern>/` of each sed call: one reads the pin, one rewrites it. | ||
| const sedPatterns = Array.from(text.matchAll(/\bsed [^'\n]*'s\/([^/\n]+)\//g), m => m[1]); | ||
|
|
||
| expect({ | ||
| workflow, | ||
| asks: [...asks], | ||
| sedCalls: sedPatterns.length, | ||
| sedPatternsThatMissThePin: sedPatterns.filter(pattern => !new RegExp(pattern, "m").test(dep)), | ||
| }).toEqual({ | ||
| workflow, | ||
| asks: [dep.match(/^\s*repo: "([^"]+)",$/m)?.[1]], | ||
| sedCalls: 2, | ||
| sedPatternsThatMissThePin: [], | ||
| }); | ||
| checked.push(workflow); | ||
| } | ||
| expect(checked.length).toBeGreaterThan(0); | ||
| }); | ||
Oops, something went wrong.
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.