@decohere/ci-tools 0.0.1-dev.125 → 0.0.1-dev.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/bench/bench.mjs +2 -2
- package/src/bench/history.mjs +3 -3
- package/src/bench/nightly.mjs +1 -1
- package/src/bench/regression-issue.mjs +1 -1
- package/src/lib/github-issue.mjs +1 -1
- package/src/pages/bench-page.mjs +2 -2
- package/tests/github/npm-bootstrap.test.mjs +1 -1
- package/tests/lib/github-issue.test.mjs +1 -1
package/package.json
CHANGED
package/src/bench/bench.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* bench.mjs — run the benchmark suites and compare against the last saved run
|
|
4
|
+
* bench.mjs — run the benchmark suites and compare against the last saved run.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
7
|
* pnpm bench — run every suite and compare, do not save
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
} from "./history.mjs";
|
|
42
42
|
|
|
43
43
|
const WORKSPACE_ROOT = process.cwd();
|
|
44
|
-
// BENCH_HISTORY_FILE lets the nightly job save each comparison round to its own file
|
|
44
|
+
// BENCH_HISTORY_FILE lets the nightly job save each comparison round to its own file.
|
|
45
45
|
const HISTORY_FILE =
|
|
46
46
|
process.env.BENCH_HISTORY_FILE ??
|
|
47
47
|
join(WORKSPACE_ROOT, "projects/ci-tools/dist/ci/bench/bench-history.json");
|
package/src/bench/history.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Benchmark history: the results of each `pnpm bench` run, kept per machine so runs are only
|
|
3
|
-
* compared like for like
|
|
3
|
+
* compared like for like. Pure functions over plain data; bench.mjs does the I/O.
|
|
4
4
|
*
|
|
5
5
|
* Shape (version 2):
|
|
6
6
|
* { version: 2, contexts: { [contextId]: { context, runs: [{ date, sha, results }] } } }
|
|
@@ -118,7 +118,7 @@ export function previousRun(history, id) {
|
|
|
118
118
|
return history.contexts[id]?.runs[0];
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
/** Machine types with no run for this long are dropped: CI runner types come and go
|
|
121
|
+
/** Machine types with no run for this long are dropped: CI runner types come and go. */
|
|
122
122
|
export const STALE_AFTER_DAYS = 30;
|
|
123
123
|
|
|
124
124
|
/** The history without machine types whose newest run is older than `days` before `now`. */
|
|
@@ -205,7 +205,7 @@ export function formatComparison(rows) {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
|
-
* When a benchmark counts as slower
|
|
208
|
+
* When a benchmark counts as slower: the nightly job benchmarks tonight's commit (head)
|
|
209
209
|
* and the one the previous nightly measured (base) on the same runner, alternating head, base,
|
|
210
210
|
* head, base. A benchmark regressed when head's median beats base's by more than `threshold`
|
|
211
211
|
* in every round, so one noisy round files nothing.
|
package/src/bench/nightly.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* nightly.mjs — the nightly benchmark run
|
|
4
|
+
* nightly.mjs — the nightly benchmark run. Benchmarks tonight's commit (head) and the
|
|
5
5
|
* commit the previous nightly measured (base) on this runner, alternating head, base, head,
|
|
6
6
|
* base, so the comparison never mixes CPU models. Then:
|
|
7
7
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The GitHub issue for a benchmark that got slower
|
|
2
|
+
* The GitHub issue for a benchmark that got slower: one open issue per benchmark,
|
|
3
3
|
* found again by its exact title and updated in place while the regression lasts.
|
|
4
4
|
*/
|
|
5
5
|
|
package/src/lib/github-issue.mjs
CHANGED
|
@@ -47,7 +47,7 @@ export function upsertIssue(options, run = gh) {
|
|
|
47
47
|
"--limit",
|
|
48
48
|
"200",
|
|
49
49
|
"--search",
|
|
50
|
-
// Quoted: GitHub's search can't match a title like `security(ci): …` unquoted
|
|
50
|
+
// Quoted: GitHub's search can't match a title like `security(ci): …` unquoted.
|
|
51
51
|
// The exact-title match in pickIssue still decides.
|
|
52
52
|
`"${title.replaceAll('"', "")}" in:title`,
|
|
53
53
|
"--json",
|
package/src/pages/bench-page.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The benchmark page on Pages
|
|
2
|
+
* The benchmark page on Pages: a trend chart per benchmark and a table of the latest
|
|
3
3
|
* results, from the version 2 history (../bench/history.mjs). Static HTML and inline SVG, so the
|
|
4
4
|
* page needs no script and no third-party chart library.
|
|
5
5
|
*/
|
|
@@ -51,7 +51,7 @@ function machineName(context) {
|
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Contexts with a run within STALE_AFTER_DAYS of the newest run anywhere, most recently run first:
|
|
54
|
-
* CI runner types come and go, and one that stopped appearing would otherwise keep a line
|
|
54
|
+
* CI runner types come and go, and one that stopped appearing would otherwise keep a line.
|
|
55
55
|
*/
|
|
56
56
|
function activeContexts(history) {
|
|
57
57
|
const newest = Math.max(
|
|
@@ -86,7 +86,7 @@ describe("npm-bootstrap", () => {
|
|
|
86
86
|
expect(registry.calls).toEqual(["whoami", "trust list @decohere/scribe-console --json"]);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
/**
|
|
89
|
+
/** `npm trust` rejects `--otp`: the code goes through the environment. */
|
|
90
90
|
it("never passes the code as an argument, and lets npm ask when none is given", async () => {
|
|
91
91
|
seedWorkspace();
|
|
92
92
|
const withCode = fakeNpm({ published: ["@decohere/scribe"] });
|
|
@@ -28,7 +28,7 @@ describe("github-issue", () => {
|
|
|
28
28
|
expect(pickIssue([], TITLE)).toBeNull();
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
//
|
|
31
|
+
// GitHub's search can't match `security(ci): …` unquoted, so the lookup found nothing
|
|
32
32
|
// and a new issue was opened on every run.
|
|
33
33
|
it("searches for the title as a quoted phrase", () => {
|
|
34
34
|
const { run, calls } = fakeGh([]);
|