Skip to content

feat(cli): auto-detect embedded private packages [RED-862] - #1438

Open
sorccu wants to merge 1 commit into
simo/red-855-embed-private-dep-tarballsfrom
simo/red-862-detect-embedded-packages
Open

feat(cli): auto-detect embedded private packages [RED-862]#1438
sorccu wants to merge 1 commit into
simo/red-855-embed-private-dep-tarballsfrom
simo/red-862-detect-embedded-packages

Conversation

@sorccu

@sorccu sorccu commented Aug 13, 2026

Copy link
Copy Markdown
Member

Linear: RED-862

Stacked on #1435 — targets simo/red-855-embed-private-dep-tarballs and should be rebased/retargeted onto main once that PR merges. Note the test workflow only triggers on PRs targeting main/next/*, so CI checks will not run here until the retarget; the full unit suite (2013 tests) passes locally on this commit.

Adds automatic detection of private packages to embed in Playwright code bundles, complementing the explicit checks.embeddedPackages list from RED-855. Detection runs during deploy/test/pw-test, is enabled by default (checks.detectEmbeddedPackages, per-run --no-detect-embedded-packages, env CHECKLY_DETECT_EMBEDDED_PACKAGES), and fails soft: any detection problem degrades to a warning, never a failed run, while explicit embeddedPackages entries keep their strict, fatal guarantees.

Privacy model

Private package names never leave the machine unless explicitly opted in:

  1. Zero-network proofs — a public recorded tarball URL, or a public effective registry, classifies a package without any traffic.
  2. Scope mapping@scope:registry pointing at a non-public registry ⇒ embed, no lookup (over-embedding is safe by the bundle contract).
  3. Registry interrogation — remaining undecided packages are checked against the customer's own registry via the Sonatype Nexus REST API, using the .npmrc credentials: hosted ⇒ embed. A per-group source-repo visibility guard and a zero-hosted-repos guard prevent permission-filtered listings from minting unsound "public" verdicts; same-origin recorded sources that aren't Nexus-shaped are decided conservatively (hosted ⇒ embed, silence ⇒ still undecided).
  4. Opt-in fallbackchecks.detectEmbeddedPackagesFallback: "public-registry" allows an integrity diff against public npm for whatever remains undecided. This transmits those names, so it is off by default (skip + warning). Transmitted names yield durable cached verdicts, so a name never needs transmitting twice — including when a lookup fails mid-run (partial results are persisted).

Caching

Two levels in the CLI cache (node_modules/.cache/checkly, per-user dir as fallback): a detection summary keyed by lockfile bytes + registry config + credentials + explicit specs, and per-entry immutable integrity-proof verdicts. Degraded runs (skipped packages or a broken .npmrc, e.g. an unset ${VAR}) are never summary-cached, so problems keep warning until fixed. Warm runs make zero network requests.

Validated end-to-end against a real dockerized Nexus Repository CE instance: REST-based verdicts correct with zero public-registry traffic, scope tier fully offline, warm runs request-free.

Known follow-ups (minor, from review)

  • No positive test pins the restAccessRemediable tags or the combined two-tier failure message.
  • An unresolvable scope mapping produces one fail-soft download warning per package (plus the config-problem warning) instead of a single aggregate.
  • A few small dedups (a thrice-spelled error predicate, the classifyEntries catch mirroring the tier decision below it).

🤖 Generated with Claude Code

@sorccu
sorccu force-pushed the simo/red-855-embed-private-dep-tarballs branch from 79eeeb3 to 20c3a23 Compare August 14, 2026 05:22
@sorccu
sorccu force-pushed the simo/red-862-detect-embedded-packages branch from 9dac2ed to 3118b06 Compare August 14, 2026 05:22
Automatically detect lockfile packages that Checkly runners cannot fetch
from the public npm registry and embed their tarballs into Playwright
code bundles, alongside the explicit checks.embeddedPackages list.
Enabled by default (checks.detectEmbeddedPackages, per-run
--no-detect-embedded-packages).

Private package names never leave the machine unless explicitly opted
in: detection uses zero-network public proofs, @scope:registry mappings,
and the project's own Sonatype Nexus REST API, with an opt-in
public-registry integrity diff (checks.detectEmbeddedPackagesFallback)
for anything left undecided. Results are cached (summary keyed by
lockfile + registry config + credentials + explicit specs, plus
immutable per-entry integrity-proof verdicts); degraded runs are never
summary-cached. All detection failures fail soft with warnings naming
the actual cause; explicit entries remain strictly fatal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sorccu
sorccu force-pushed the simo/red-862-detect-embedded-packages branch from 3118b06 to 70f9592 Compare August 14, 2026 06:55
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