Skip to content

ci: stop reaching into the private dcd repo for the mock-api - #124

Merged
finalerock44 merged 2 commits into
devfrom
ci/drop-private-mock-api-linkage
Aug 18, 2026
Merged

ci: stop reaching into the private dcd repo for the mock-api#124
finalerock44 merged 2 commits into
devfrom
ci/drop-private-mock-api-linkage

Conversation

@finalerock44

Copy link
Copy Markdown
Contributor

lint-and-test has failed on every same-repo PR since dcd#1036 deleted mock-api/ from the private devicecloud-dev/dcd repo this morning. CI checked that directory out over an SSH deploy key and ran pnpm install in it; the sparse-checkout now matches nothing, so the job dies at that step — before the linter — and takes #120, #122 and #123 down with it.

Rather than re-point at a mock, this removes the linkage. dcd-cli is PUBLIC and was holding DCD_SSH_DEPLOY_KEY, a credential granting read access to the private repo, and pulling the API's swagger.json onto the runner on every same-repo PR. Deleting the checkout drops both.

  • The Checkout dcd (mock-api) and Install Mock API dependencies steps are gone, along with the HAS_PRIVATE_ACCESS gate that existed only to keep them off fork and Dependabot PRs. Every PR now takes the same path, so forks stop being second-class.
  • CI runs pnpm test:unit — a new script that is the existing runner with --unit. test/unit/* is pure and needs no backend, so unit coverage is kept rather than dropped along with the integration suite.
  • scripts/test-runner.mjs no longer defaults MOCK_API_DIR to ../../dcd/mock-api. With no mock available it degrades to the unit suite and says so, instead of the bare ENOENT it throws today. Set MOCK_API_DIR and the integration specs run exactly as before.

DCD_SSH_DEPLOY_KEY can now be deleted from the repo's secrets — nothing reads it. That is a separate manual step, not something this commit can do.

Two things are genuinely lost, both worth stating plainly rather than discovering later:

  • test/integration/* no longer runs anywhere automatically.
  • With it goes the CLI<->swagger contract-drift check. Drift used to surface as a Prism 422 — that is how the googlePlay multipart break and the tempPath missing-example break were both caught. Nothing replaces it yet.

Verified locally: pnpm test:unit and a bare pnpm test both run the unit suite only and print the notice; 81 pass and the 7 flow-paths failures are Windows-only, asserting POSIX paths against win32 path. The same specs ran green on ubuntu in the last full CI run (job 94750122384, 2026-08-14), which is the platform CI uses. pnpm lint, pnpm typecheck, pnpm build and pnpm audit --audit-level moderate are all clean.

What & why

Type of change

  • fix — bug fix
  • feat — new feature
  • perf — performance improvement
  • refactor — code change that's neither a fix nor a feature
  • docs — documentation only
  • chore / ci / build / test — tooling, no user-facing change
  • Breaking change (title has ! or PR notes a BREAKING CHANGE:)

Checklist

  • PR title follows the Conventional Commits format (see comment above)
  • pnpm lint passes
  • pnpm typecheck passes
  • pnpm build passes
  • I have not bumped the version or edited CHANGELOG.md (release-please handles this)
  • I have signed the CLA (the bot will prompt on first contribution)
  • Docs / README.md / STYLE_GUIDE.md updated if behaviour or output changed

How to test

`lint-and-test` has failed on every same-repo PR since dcd#1036 deleted
`mock-api/` from the private devicecloud-dev/dcd repo this morning. CI checked
that directory out over an SSH deploy key and ran `pnpm install` in it; the
sparse-checkout now matches nothing, so the job dies at that step — before the
linter — and takes #120, #122 and #123 down with it.

Rather than re-point at a mock, this removes the linkage. dcd-cli is PUBLIC and
was holding `DCD_SSH_DEPLOY_KEY`, a credential granting read access to the
private repo, and pulling the API's `swagger.json` onto the runner on every
same-repo PR. Deleting the checkout drops both.

* The `Checkout dcd (mock-api)` and `Install Mock API dependencies` steps are
  gone, along with the `HAS_PRIVATE_ACCESS` gate that existed only to keep them
  off fork and Dependabot PRs. Every PR now takes the same path, so forks stop
  being second-class.
* CI runs `pnpm test:unit` — a new script that is the existing runner with
  `--unit`. `test/unit/*` is pure and needs no backend, so unit coverage is kept
  rather than dropped along with the integration suite.
* `scripts/test-runner.mjs` no longer defaults `MOCK_API_DIR` to
  `../../dcd/mock-api`. With no mock available it degrades to the unit suite and
  says so, instead of the bare ENOENT it throws today. Set `MOCK_API_DIR` and
  the integration specs run exactly as before.

`DCD_SSH_DEPLOY_KEY` can now be deleted from the repo's secrets — nothing reads
it. That is a separate manual step, not something this commit can do.

Two things are genuinely lost, both worth stating plainly rather than
discovering later:

* `test/integration/*` no longer runs anywhere automatically.
* With it goes the CLI<->swagger contract-drift check. Drift used to surface as
  a Prism 422 — that is how the `googlePlay` multipart break and the `tempPath`
  missing-example break were both caught. Nothing replaces it yet.

Verified locally: `pnpm test:unit` and a bare `pnpm test` both run the unit
suite only and print the notice; 81 pass and the 7 `flow-paths` failures are
Windows-only, asserting POSIX paths against win32 `path`. The same specs ran
green on ubuntu in the last full CI run (job 94750122384, 2026-08-14), which is
the platform CI uses. `pnpm lint`, `pnpm typecheck`, `pnpm build` and `pnpm
audit --audit-level moderate` are all clean.
@finalerock44 finalerock44 self-assigned this Aug 18, 2026
Comment thread CLAUDE.md
Follow-up to 5a713f6, which changed how CI treats the mock-api but only updated
CLAUDE.md's Commands section — leaving three descriptions of the machinery it
removed. Flagged on #124 for CLAUDE.md; CONTRIBUTING.md and README.md carried
the same claim and are the ones contributors actually read.

* CLAUDE.md's Contributing bullet said integration tests need the private
  devicecloud-dev/dcd mock-api via DCD_SSH_DEPLOY_KEY, that `pnpm test` is
  skipped on fork/Dependabot PRs, and that a maintainer runs the full suite
  before merge. None of that is true now: every PR runs identical steps and
  nothing runs the integration suite.
* CONTRIBUTING.md's "About the test suite" said the same, framed as forks being
  the special case. Rewritten around the actual split — test/unit/* everywhere,
  test/integration/* only with MOCK_API_DIR set — and the reason CI does not
  reach for a mock: this repo is public and holds no credentials for private
  infrastructure.
* Both command tables and README's quickstart now list `pnpm test:unit` and note
  it is what CI runs.

Each of the three states the consequence rather than burying it: a green PR says
nothing about the integration suite. CONTRIBUTING.md asks contributors touching
the API surface to flag it so a maintainer can exercise it before merge.

Docs only — no workflow or script changes.
@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@finalerock44
finalerock44 merged commit 2b89f3a into dev Aug 18, 2026
8 checks passed
@finalerock44
finalerock44 deleted the ci/drop-private-mock-api-linkage branch August 18, 2026 11:50
finalerock44 added a commit that referenced this pull request Aug 18, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant