test(npm): npm virtual failure, access and conditional rows, part 3/3 (S31 plan: 19/19)

Summary

Part 3 of 3 of the S31 (npm-virtual) plan, step 19: the end-to-end harness and e2e catalog. This stack has 3 MRs, each targeting the previous one; review and merge them bottom-up. The spec is S31 (npm-virtual).

This part adds the failure, access and conditional rows:

  • dist-tags-merge: the first upstream's value wins a shared tag, latest included.
  • merge-partial-under-outage and unhealthy-remote-from-cache: a partial merge still answers 200 with a "sha256-<hex>" validator.
  • packument-conditional: matching-validator reads answer 304, and the validator moves when an input changes.
  • write-rejected: writes through a virtual repository answer 405 unsupported.
  • absence-and-outage: tarball absence is file_not_found, metadata absence is package_not_found, and an outage is distinguished from absence.
  • authz-before-kind-dispatch, in access_test.go: an ungranted caller is masked before the repository kind is dispatched.
  • The npm stub gains SetProbe and ProbePath, with a test.
  • docs/testing/e2e/npm.md gets the seven rows, four ## Usage data rows and the paragraph on the clauses no deployed run can reach; limitations.md records the stale-copy limits and the tests that cover them.

Plan and spec amendments

The plan's Status table records step 19 here, with the three MRs of this stack. The S31 spec is amended in this part, at review: its authorization paragraph and its acceptance criterion now state the refused-write answer by readability. A requester that cannot read the repository receives the masked 404; a principal that can read it but lacks the action receives 403, code: "forbidden"; neither receives the 405. The rule cites ADR-021 and the authorization middleware, and the public versus private split is dropped. Without it the text contradicts the authz-before-kind-dispatch row's 403 for a reader on a private repository.

Governing ADRs

None. The change adds tests and catalog documentation; it changes no runtime behavior.

Testing

  • E2e catalog: this part names the seven rows above as new automatable rows, each declared by its test (virtual_test.go, and access_test.go for the authz row). go run ./e2e/cmd/e2e-catalog generate -check and check -quiet pass (352 scenarios, 0 disagreements).
  • The e2e suite needs the full rig and does not run on a developer machine, so it is compile-checked (go vet -tags=e2e ./e2e/...) and linted (golangci-lint --build-tags=e2e, 0 issues); CI runs it.
  • Two halves are disclosed in the rows and in limitations.md: the cached-position halves of merge-partial-under-outage and unhealthy-remote-from-cache pass without a health gate because the cached copy is fresh.

docs/user/** is not affected: nothing here changes a customer-visible surface.

Size

About 740 reviewable LoC (709 added, 30 removed), of which virtual_test.go is about 410. The six rows share the helpers part 2 introduced, and each row's test, catalog row, pattern entry and scenario id must land together or lint:e2e-catalog-sync fails.

The npm copy of the unhealthy-marking helper duplicates the Maven and OCI ones; sharing it is tracked in #1556 (closed).

Stacked MRs (review/merge bottom-up)

Related to #900 (closed)

Edited by David Fernandez

Merge request reports

Loading
Loading