@ai-ecoverse/slicc-shared-web 2.19.0 → 2.19.1

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.
Files changed (2) hide show
  1. package/README.md +2 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -71,7 +71,7 @@ The caller cancels superseded runs on pull requests only, so a push to `main` ne
71
71
 
72
72
  **Lint** fails the run, and nothing after it starts.
73
73
 
74
- **Deploy** runs on pull requests only, never in the merge queue, with `id-token: write` for an OIDC-authenticated deploy. The merge queue's tests therefore run without `STAGING_URL`: a test that needs it skips when it's empty. It runs the pull request's own code, so it gets no secret unless `deploy-secrets` names it: a newline- or space-separated list of secret names, which the step exports as environment variables. The pipeline's own `AWS_BEARER_TOKEN_BEDROCK`, `SLICC_ISSUES_TOKEN`, `CLOUDFLARE_API_TOKEN` and `github_token` are never exported. The command writes `url=<staging URL>` to `$GITHUB_OUTPUT`; the tests and the reviewers get it as `STAGING_URL`.
74
+ **Deploy** runs on pull requests only, never in the merge queue, with `id-token: write` for an OIDC-authenticated deploy. The merge queue's tests therefore run without `STAGING_URL`: a test that needs it skips when it's empty. It runs the pull request's own code, so it gets no secret unless `deploy-secrets` names it: a newline- or space-separated list of secret names, which the step exports as environment variables. The pipeline's own `AWS_BEARER_TOKEN_BEDROCK`, `SLICC_ISSUES_TOKEN`, `CLOUDFLARE_API_TOKEN` and `github_token` are never exported. The command writes `url=<staging URL>` to `$GITHUB_OUTPUT`; the tests and the reviewers get it as `STAGING_URL`. The environment url is published as scheme, host and path, without query string or fragment.
75
75
 
76
76
  **Integration tests** install Chrome for Testing with `slicc-cdp install-browser` (with `--with-deps` where the runner has root or passwordless sudo) (`--version` from the `chrome` input, stable without it), then each runs its share of the files matching `test-glob`. `lint` plans the split once for all `shards`, so the shards can't disagree: it weighs each file by the most it took in the last ten completed runs of the same workflow that uploaded `timings` (merge queue runs first, then pull request runs, none from a fork), since a file that downloads a lot can take several times its median when the network is slow. Files whose most is over twice their median go first, longest first, each to the shard with the fewest of them (then the least time), so the files that are slow together in a slow run don't pile up on one shard; then every other file goes to the shard with the least time so far, longest first; a file without a timing counts as the average, and without any timings every file counts the same. `integration` uploads each run's `junit/**/*.times` and `junit/**/*.xml` as one `timings` artifact, so `lint` downloads one artifact per earlier run through the REST API with the job token (about a dozen requests a run, of the repo's 1,000 an hour); until a run has one, it reads the `junit-*` artifacts of the newest run that has them. Its log names the predicted seconds of each shard, how many files had timings, from which runs, and which files took over twice their median. A file's time is its own wall time where `shard.cjs` recorded one: it preloads `harness/file-time.cjs` into each test file's own process, which writes the file's wall time to `junit/<shard>-<pid>.times` when it exits, so tests registered through a shared helper still count for the file that ran them. Otherwise it is the sum of the JUnit times of the tests that name the file, and Node names the file that calls `test()`. Each shard runs the repo's own `test` command unchanged: `harness/shard.cjs`, preloaded through `NODE_OPTIONS`, makes the outermost `node --test` run only the shard's files that its own patterns match, writes `junit/<shard>.xml` next to the usual spec output, and then takes itself out of the environment, so a `node --test` that a test starts runs as it would without it. Files a `node --test` call would run that are not in `test-glob` (unit tests, say, whether in the same call or another) run on shard 0 only, so nothing is dropped; when `test-glob` matches nothing, shard 0 runs the command unchanged and the others run nothing. Each call keeps its own JUnit report (`junit/<shard>-<pid>.xml` for all but the last). Each shard uploads `coverage/`, `artifacts/` and `junit/` as `integration-<shard>`. Before its tests, each shard restores the harness's download cache, `node_modules/.cache/slicc-harness/cdn` (after `npm ci`, which would remove it), from the newest cache whose key starts with `slicc-harness-cdn-<OS>-<hash of every package-lock.json and pnpm-lock.yaml>`, else `slicc-harness-cdn-<OS>-`, so a lockfile change still starts warm. The harness's `download()` lists each npm tarball and exact-version jsdelivr file it served in the file `SLICC_TEST_DOWNLOADS` names, which the shard sets to `junit/<shard>.downloads` (an older `@ai-ecoverse/slicc-shared-web` lists nothing, so its cache stays empty). Shards only restore: a cache saved on a pull request or in the merge queue would be scoped to that ref, so no later run could use it. On a push to `main`, `downloads` reads those lists from the newest successful merge queue run (else pull request run, never a fork's), restores the cache, fetches what's missing (only tarballs from `registry.npmjs.org` and exact-version files from `cdn.jsdelivr.net`), deletes what no shard listed, and saves it under the key plus a hash of the list, only when the list changed. The cache never holds packuments, attestations or other files that can change, so a restored cache can't serve stale metadata; those are fetched fresh as before. `integration` passes only when every shard did and their JUnit reports add up to at least one test that ran, not skipped, and no failure or error (the placeholder an empty shard runs doesn't count), and every file matching `test-glob` was handed to `node --test` on exactly one shard (`shard.cjs` lists the files it hands over next to its JUnit report, as `junit/<shard>-<pid>.files`, since a test registered through a helper is attributed to the helper); a file that ran on no shard or on two is named as an error, and it prints `integration: PASS <n> tests (<k> skipped) in <m> JUnit reports, <f> of <f> test-glob files on exactly one shard` or `integration: FAIL <why>`; a repo without node tests sets `require-tests: false`. Setting `NODE_OPTIONS` in `test` would replace the pipeline's own, which carry the shard preload and the JUnit reporter, so extra node flags (a bigger heap, say) go in `node-options`. `integration` is therefore the one check to require for the tests, under the caller's job name (`ci / integration`). A suite whose last step reads every test's artifacts, as this repo's `verify.mjs` does, sets `shards: 1`.
77
77
 
@@ -131,7 +131,7 @@ Every pull request does, except one labelled `private-fix` (below) and Renovate'
131
131
 
132
132
  A repo whose own GitHub App pushes onto Renovate's branches (a refresh commit, say) names it in `renovate-bots`, by login, one per line or comma-separated, with or without `[bot]`: `homescoop-renovate-refresh`. A push by a listed bot onto a `renovate/` branch of a pull request `renovate[bot]` opened counts as Renovate's own, so it skips review exactly like Renovate's pushes unless the group matches `review-renovate`, and both reviewers accept the bot as the actor when the group does get a review. A push by it anywhere else gets a review as usual. List only a bot the repo controls. An entry that isn't a plain login (letters, digits and hyphens), `*` or any other wildcard included, fails `lint`.
133
133
 
134
- A pull request labelled exactly `private-fix`, a label that marks fixes kept private until release, gets no bot review when the label is on it as the run starts, in the event or as `lint` reads it through the API with the job token. `context`, `reviewer` and `post` are skipped, so no comment, findings artifact or model output appears, and `review` passes when `integration` did, with the one line `bot review skipped: private-fix; reviewed privately`. When `lint` can't read the labels after three attempts, it fails rather than start a review. Open such a pull request with `gh pr create --label private-fix`: a run that started before the label was added still reviews and comments. Anyone who can label pull requests can turn the bot review off this way, so a repo that uses the label requires a human approval in its branch protection.
134
+ A pull request labelled exactly `private-fix`, a label that marks fixes kept private until release, gets no bot review when the label is on it as the run starts, in the event or as `lint` reads it through the API with the job token. `context`, `reviewer` and `post` are skipped, so no comment, findings artifact or model output appears, and `review` passes when `integration` did, with the one line `bot review skipped: private-fix; reviewed privately`. When `lint` can't read the labels after three attempts, it fails rather than start a review. Open such a pull request with `gh pr create --label private-fix`: a run that started before the label was added still reviews and comments. Anyone who can label pull requests can turn the bot review off this way, so a repo that uses the label requires a human approval in its branch protection. slicc-cli, slicc-cdp and slicc-bios don't: there, only accounts that can already merge or edit the workflows can add labels, so the label gives nobody new power, and a required human approval would block every agent merge, since agents act as one of those accounts and GitHub doesn't let an account approve its own pull request.
135
135
 
136
136
  The commands in `lint`, `test`, `deploy`, `review-browser` and `after-release` run with `bash -eo pipefail -c`, so a multi-line command stops at its first failing line, a failure inside a pipe included.
137
137
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-shared-web",
3
- "version": "2.19.0",
3
+ "version": "2.19.1",
4
4
  "description": "Shared Renovate, Biome, TypeScript, lefthook and GitHub Actions configuration, plus the CDP integration-test harness, for SLICC's web repos",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -76,7 +76,7 @@
76
76
  },
77
77
  "devDependencies": {
78
78
  "@ai-ecoverse/slicc-browsers": "1.43.0",
79
- "@ai-ecoverse/slicc-cdp": "2.2.5",
79
+ "@ai-ecoverse/slicc-cdp": "2.2.7",
80
80
  "@biomejs/biome": "2.6.8",
81
81
  "lefthook": "2.2.2",
82
82
  "monocart-coverage-reports": "3.2.1",