@ai-ecoverse/slicc-shared-web 2.4.5 → 2.6.0
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/README.md +11 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -68,16 +68,18 @@ The caller cancels superseded runs on pull requests only, so a push to `main` ne
|
|
|
68
68
|
|
|
69
69
|
**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 `deploy` command with every secret the caller passes as an environment variable, except the pipeline's own `AWS_BEARER_TOKEN_BEDROCK`, `SLICC_ISSUES_TOKEN` and `github_token`. The command writes `url=<staging URL>` to `$GITHUB_OUTPUT`; the tests and the reviewers get it as `STAGING_URL`. With `deploy-secrets`, a newline- or space-separated list of secret names, only those of them are exported.
|
|
70
70
|
|
|
71
|
-
**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 split the files matching `test-glob` across `shards` jobs by their timings, with [split-tests-by-timings](https://github.com/marketplace/actions/split-tests-by-timings). The timings are the JUnit reports of the latest completed run of the same workflow; without one, the split is by count. 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>`. `integration` passes only when every shard did,
|
|
71
|
+
**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 split the files matching `test-glob` across `shards` jobs by their timings, with [split-tests-by-timings](https://github.com/marketplace/actions/split-tests-by-timings). The timings are the JUnit reports of the latest completed run of the same workflow; without one, the split is by count. 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>`. `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 it prints `integration: PASS <n> tests (<k> skipped) in <m> JUnit reports` 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`.
|
|
72
72
|
|
|
73
73
|
**Reviewer** runs twice, once with [claude-code-action](https://github.com/anthropics/claude-code-action) and once with [codex-action](https://github.com/openai/codex-action), on the same prompt, whether the tests passed or not. Both run on Amazon Bedrock with the org secret `AWS_BEARER_TOKEN_BEDROCK`, in the region of the org variable `CERT_AWS_REGION` (`us-west-2` without it). Claude uses the model in `CERT_BEDROCK_MODEL` (`global.anthropic.claude-opus-5-5` without it), as the cert reviews do. Codex uses its built-in `amazon-bedrock-runtime` provider (codex-action waits for its OpenAI proxy's `<run id>.json` in `codex-home` whenever it has a prompt, so the job writes a placeholder one) and the model in `CODEX_BEDROCK_MODEL` (`global.openai.gpt-6.1-sol` without it). Models that Bedrock serves only through inference profiles, as Sol 6.1 is, need the runtime provider and the profile's `global.` id; the `amazon-bedrock` provider's endpoint doesn't list them. The job token can only read. Each reviewer gets:
|
|
74
74
|
|
|
75
75
|
- the pull request's head as the working directory and its base in `$RUNNER_TEMP/base`, each after `npm ci` (claude-code-action needs the working directory to be a checkout, and a base nested inside it would break the head's Biome config);
|
|
76
76
|
- `review/integration/`, every shard's artifact;
|
|
77
77
|
- `review/context/`, from the `context` job: the pull request with its comments, reviews and diff, the repo's issues and recent pull requests;
|
|
78
|
-
- `review/browsers.json`: four headed Chrome instances on one machine (on Xvfb display `:99` when the runner has no `DISPLAY`, since headless Chrome behaves slightly differently), `head` and `base` each linked through the extension and through slicc-cli, on CDP ports 9301 to 9304. For each one the job runs `review-browser` (by default `npm run --if-present review:browser`) in that side's tree with `SLICC_REVIEW_SIDE` (`head` or `base`), `SLICC_REVIEW_LINK` (`extension` or `cli`) and `SLICC_REVIEW_CDP`, so the repo loads its own build into that browser;
|
|
78
|
+
- `review/browsers.json`: four headed Chrome instances on one machine (on Xvfb display `:99` when the runner has no `DISPLAY`, since headless Chrome behaves slightly differently), `head` and `base` each linked through the extension and through slicc-cli, on CDP ports 9301 to 9304. For each one the job runs `review-browser` (by default `npm run --if-present review:browser`) in that side's tree with `SLICC_REVIEW_SIDE` (`head` or `base`), `SLICC_REVIEW_LINK` (`extension` or `cli`) and `SLICC_REVIEW_CDP`, so the repo loads its own build into that browser. Every one of them also runs the [harness extension](#harness-extension) (loaded with `--load-extension`), so the review sees pages the way a user with a content-script extension does;
|
|
79
79
|
- `review-prompt`, appended to the shared prompt.
|
|
80
80
|
|
|
81
|
+
A reviewer can attach screenshots: it saves PNGs to `review/shots/` and references them in the summary, a comment or an issue as ``. `post` uploads them to R2 (the bucket in `R2_BUCKET`, `slicc-pr-screenshots` by default, under `<repo>/pr-<n>/<commit>/<reviewer>/`) with `CLOUDFLARE_API_TOKEN`, which only `post` gets, and rewrites each reference to its public URL (`R2_PUBLIC_BASE_URL`); without the token, a reference becomes a link to the run, whose `findings-<reviewer>` artifact holds the files.
|
|
82
|
+
|
|
81
83
|
Each reviewer answers with `findings.json`, held to one JSON schema:
|
|
82
84
|
|
|
83
85
|
```json
|
|
@@ -91,7 +93,7 @@ Each reviewer answers with `findings.json`, held to one JSON schema:
|
|
|
91
93
|
|
|
92
94
|
**Post** is the only job that writes to GitHub. Per reviewer it sets the commit status `review / claude` or `review / codex` (`success` for `approved`, `failure` for `denied`, `error` without findings), keeps one comment with its latest verdict and summary on the pull request (edited on each run), posts each comment on its line (or, for a line outside the diff, as a pull request comment naming it) unless the same comment is already there, and opens each issue unless one with the same title is already open. An issue in another repo of the same org needs `SLICC_ISSUES_TOKEN`, a token that can open issues there; one outside the org is logged and skipped.
|
|
93
95
|
|
|
94
|
-
**Release** runs `semantic-release` after lint, without any test: what reached `main` went through the merge queue. GitHub sometimes rejects a push right after the tag push with a bare `(failed)`, most often semantic-release's push of `refs/notes/semantic-release-vX.Y.Z`, so the step puts a small `git` wrapper first on `PATH`: it retries `git push` and `git fetch` up to five times, 5, 10, 15 and 20 seconds apart, and runs every other git command once, as well as semantic-release's `git fetch --unshallow`, which fails on the job's full clone by design before semantic-release falls back to a plain fetch. When the push still fails, semantic-release fails before it publishes. With `release-environment`, the job runs in that GitHub environment, and `after-release` is a command run after semantic-release when it released, that is when a new `v*` tag points at the commit, with that version as `RELEASE_VERSION` (a production deploy, say). It gets the job's OIDC token and no secrets.
|
|
96
|
+
**Release** runs `semantic-release` after lint, on a push to `main` only, without any test: what reached `main` went through the merge queue. GitHub sometimes rejects a push right after the tag push with a bare `(failed)`, most often semantic-release's push of `refs/notes/semantic-release-vX.Y.Z`, so the step puts a small `git` wrapper first on `PATH`: it retries `git push` and `git fetch` up to five times, 5, 10, 15 and 20 seconds apart, and runs every other git command once, as well as semantic-release's `git fetch --unshallow`, which fails on the job's full clone by design before semantic-release falls back to a plain fetch. When the push still fails, semantic-release fails before it publishes. With `release-environment`, the job runs in that GitHub environment, and `after-release` is a command run after semantic-release when it released, that is when a new `v*` tag points at the commit, with that version as `RELEASE_VERSION` (a production deploy, say). It gets the job's OIDC token and no secrets.
|
|
95
97
|
|
|
96
98
|
**Review** is the check that stands for the reviews. On a pull request that gets a review it passes when both reviewers' `findings.json` say `approved`; when the repo can't read `AWS_BEARER_TOKEN_BEDROCK`, the reviewers don't start and it fails, naming the secret. On one that doesn't (a Renovate pull request outside `review-renovate`) it passes when `integration` did. In the merge queue it always passes, since the pull request was reviewed already. Require it next to `ci / integration`, as `ci / review`.
|
|
97
99
|
|
|
@@ -114,7 +116,7 @@ The commands in `lint`, `test`, `deploy`, `review-browser` and `after-release` r
|
|
|
114
116
|
|---|---|---|
|
|
115
117
|
| `node-version` | `24` | |
|
|
116
118
|
| `runs-on` | `cloud-run-job` | every job but `release`, which runs on `ubuntu-latest` because npm's trusted publishing takes OIDC tokens only from GitHub-hosted runners; a fork's pull request runs on `ubuntu-latest` too, so fork code never reaches the pool |
|
|
117
|
-
| `timeout-minutes` | `20` | `lint`, `deploy`, each shard and `release`; a review gets
|
|
119
|
+
| `timeout-minutes` | `20` | `lint`, `deploy`, each shard and `release`; a review gets `review-timeout-minutes` |
|
|
118
120
|
| `lint` | `npm run lint` | |
|
|
119
121
|
| `chrome` | stable | a Chrome for Testing version for `slicc-cdp install-browser` |
|
|
120
122
|
| `test` | `npm test` | runs on Xvfb display `:99` when the runner has no `DISPLAY`; Xvfb is installed where the runner has root or sudo, and the step fails naming the runner when it has neither Xvfb nor root |
|
|
@@ -124,7 +126,11 @@ The commands in `lint`, `test`, `deploy`, `review-browser` and `after-release` r
|
|
|
124
126
|
| `deploy-secrets` | all | newline- or space-separated secret names (any case) that `deploy` gets |
|
|
125
127
|
| `review-browser` | `npm run --if-present review:browser` | |
|
|
126
128
|
| `review-prompt` | none | |
|
|
129
|
+
| `review-timeout-minutes` | `60` | how long each reviewer may take |
|
|
130
|
+
| `review-screenshots` | `30` | the most screenshots a reviewer may attach |
|
|
127
131
|
| `review-renovate` | none | globs of Renovate group slugs whose pull requests get a review |
|
|
132
|
+
| `node-options` | none | node flags added to the test step's `NODE_OPTIONS`, such as `--max-old-space-size=8192` |
|
|
133
|
+
| `require-tests` | `true` | `integration` fails when no test ran |
|
|
128
134
|
| `release-environment` | none | the GitHub environment the release job runs in |
|
|
129
135
|
| `after-release` | none | a command run after semantic-release, with `RELEASE_VERSION` |
|
|
130
136
|
|
|
@@ -132,6 +138,7 @@ The commands in `lint`, `test`, `deploy`, `review-browser` and `after-release` r
|
|
|
132
138
|
|---|---|
|
|
133
139
|
| `AWS_BEARER_TOKEN_BEDROCK` (org secret) | both reviewers |
|
|
134
140
|
| `SLICC_ISSUES_TOKEN` | issues in other repos |
|
|
141
|
+
| `CLOUDFLARE_API_TOKEN` | `post`, for reviewers' screenshots in R2 |
|
|
135
142
|
| anything else | `deploy`, as environment variables |
|
|
136
143
|
|
|
137
144
|
Pull requests from forks are not supported: GitHub gives them no secrets, so the reviewers can't run and `ci / review` stays red. A maintainer opens the change again from a branch in the repo.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-shared-web",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
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",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"release": "semantic-release"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@ai-ecoverse/slicc-browsers": "1.15.
|
|
68
|
-
"@ai-ecoverse/slicc-cdp": "1.30.
|
|
67
|
+
"@ai-ecoverse/slicc-browsers": "1.15.1",
|
|
68
|
+
"@ai-ecoverse/slicc-cdp": "1.30.23",
|
|
69
69
|
"@biomejs/biome": "2.5.15",
|
|
70
70
|
"lefthook": "2.2.2",
|
|
71
71
|
"monocart-coverage-reports": "2.13.2",
|