Skip to content

Commit ebf4b03

Browse files
authored
chore: promote the #124 docs into 5.3.1 (#125)
Promote from dev to stable, carrying the documentation half of #124 that the 5.3.1 promotions dropped. `ci: stop reaching into the private dcd repo for the mock-api` (#124) touched six files on dev. The promote PR (#123) carried four of them — `cli-ci.yml`, `scripts/test-runner.mjs`, the `test:unit` script in `package.json`, and eight of the ten changed `CLAUDE.md` lines — and dropped `CONTRIBUTING.md` and `README.md` entirely. Production therefore ships the new CI shape while its docs still describe the old one: * `CONTRIBUTING.md` told contributors `pnpm test` boots a mock API, and that integration tests are "automatically skipped" on fork PRs only. Neither is true: CI runs no integration tests on any PR, and there is no default mock. It also omitted `pnpm test:unit` from the pre-push checklist, though it is now a required check. * `README.md`'s dev-scripts block still showed `pnpm test # build + boot mock API + integration/unit tests`. * `CLAUDE.md`'s Contributing section still described the `DCD_SSH_DEPLOY_KEY` mock-api checkout, which no longer exists. `README.md` is the one with reach beyond this repo: npm always includes it in the tarball regardless of the `files` field, so the stale snippet would render on the npmjs.com page for 5.3.1. Docs only — no source, workflow, script or lockfile change. The three files are now byte-identical to `dev`, leaving release plumbing (both manifests, `CHANGELOG.md`, `package.json` version) as the only remaining divergence, which is release-please's to own. `Release-As: 5.3.1` keeps the pending release PR (#120) on 5.3.1 rather than rolling it to 5.3.2. Release-As: 5.3.1
1 parent 19ca6bf commit ebf4b03

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Full guide in `CONTRIBUTING.md`; the operationally important parts (the ones tha
6161
- ⚠️ **A `!` (or `BREAKING CHANGE:` footer) bumps the MAJOR — do not use it casually.** The configs set `bump-minor-pre-major: true`, but that only applies **below 1.0.0**; we are on 5.x, so it is inert and a breaking marker means exactly what semver says. A `refactor(cloud)!:` PR title once produced a `6.0.0-beta.1` release PR for what was only a flag rename in an unconsumed beta. Because PRs are squash-merged, **the PR title IS the commit** — the `!` lands even if no branch commit carried it.
6262
- **Never hand-edit `package.json` version, `CHANGELOG.md`, or the `.release-please-manifest*.json` files** — release-please owns all of them. `src/types/generated/schema.types.ts` is likewise generated (openapi-typescript).
6363
- A first-time contributor must sign the CLA (the CLA Assistant bot comments on the first PR); the CLA check must be green to merge.
64-
- **CI (`.github/workflows/cli-ci.yml`) runs on every PR** including forks: gitleaks secret scan, `pnpm lint`, `pnpm typecheck`, `pnpm build`, `pnpm audit --audit-level moderate`. The **integration tests need the private `devicecloud-dev/dcd` mock-api** (cloned via the `DCD_SSH_DEPLOY_KEY` secret), and GitHub withholds secrets from fork and Dependabot PRs — so `pnpm test` is **skipped there** and a maintainer runs the full suite before merge. gitleaks also runs as a pre-commit hook (allowlist in `.gitleaks.toml`); without the binary installed the hook self-skips and CI is the backstop.
64+
- **CI (`.github/workflows/cli-ci.yml`) runs the same steps on every PR** — fork, Dependabot and same-repo alike, with no privileged path: gitleaks secret scan, `pnpm lint`, `pnpm typecheck`, `pnpm test:unit`, `pnpm build`, `pnpm audit --audit-level moderate`. **`test/integration/*` is not run by CI at all** (see the Commands section: this public repo no longer reaches into the private `devicecloud-dev/dcd` repo for a mock API), so a green PR says nothing about the integration suite — run it locally with `MOCK_API_DIR` set if a change touches the API surface. gitleaks also runs as a pre-commit hook (allowlist in `.gitleaks.toml`); without the binary installed the hook self-skips and CI is the backstop.
6565

6666
## Releases
6767

CONTRIBUTING.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,29 @@ Useful scripts:
3737
| `pnpm lint` | ESLint over `src/` and `test/` |
3838
| `pnpm typecheck` | Strict `tsc --noEmit` over `src/` and `test/` |
3939
| `pnpm build` | Compile to `dist/` |
40-
| `pnpm test` | Build + boot the mock API + run integration/unit tests |
40+
| `pnpm test:unit` | Run the unit suite — no backend needed. **This is what CI runs.** |
41+
| `pnpm test` | The same, plus the integration suite if `MOCK_API_DIR` points at a mock API |
4142

42-
**Before pushing, make sure `pnpm lint`, `pnpm typecheck`, and `pnpm build`
43-
pass.** These run for every PR (including from forks) and are required to merge.
43+
**Before pushing, make sure `pnpm lint`, `pnpm typecheck`, `pnpm test:unit`, and
44+
`pnpm build` pass.** These run for every PR and are required to merge.
4445

4546
### About the test suite
4647

47-
`pnpm test` boots a **mock API that lives in a private repository**, so the full
48-
integration suite only runs on branches inside this repo. **On pull requests from
49-
forks the integration tests are automatically skipped** — you'll see a CI notice
50-
saying so. That's expected: lint, typecheck, and build still run and gate your
51-
PR, and a maintainer runs the full suite before merge. You don't need backend
52-
access to contribute.
48+
Tests split in two. `test/unit/*` is pure — no network, no backend — and runs
49+
everywhere, in CI and locally.
50+
51+
`test/integration/*` drives the built CLI against a Prism mock of the dcd API on
52+
port 3001. **CI does not run it**, on any PR, from a fork or otherwise: this repo
53+
is public and deliberately holds no credentials for, and makes no requests to,
54+
our private infrastructure. There is no default mock API — set
55+
`MOCK_API_DIR=/path/to/mock-api` (a package exposing a `start:auth` script on
56+
port 3001) and `pnpm test` picks the integration suite up. Without it the runner
57+
prints a notice and runs the unit suite alone.
58+
59+
So every contributor, maintainers included, gets the same CI signal, and you
60+
don't need backend access to contribute. The flip side is worth knowing: a green
61+
PR says nothing about the integration suite, so if your change touches the API
62+
surface, say so in the PR and a maintainer will exercise it before merge.
5363

5464
### Secret scanning
5565

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ $ pnpm install # install deps, build, set up git hooks
7878
$ pnpm dcd <args> # run the CLI from source
7979
$ pnpm lint # ESLint
8080
$ pnpm typecheck # strict tsc, no emit
81-
$ pnpm test # build + boot mock API + integration/unit tests
81+
$ pnpm test:unit # unit tests, no backend needed — what CI runs
82+
$ pnpm test # the above, plus integration tests if MOCK_API_DIR is set
8283
```
8384

8485
### Secret scanning

0 commit comments

Comments
 (0)