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,latestincluded.merge-partial-under-outageandunhealthy-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 405unsupported.absence-and-outage: tarball absence isfile_not_found, metadata absence ispackage_not_found, and an outage is distinguished from absence.authz-before-kind-dispatch, inaccess_test.go: an ungranted caller is masked before the repository kind is dispatched.- The npm stub gains
SetProbeandProbePath, with a test. docs/testing/e2e/npm.mdgets the seven rows, four## Usage datarows and the paragraph on the clauses no deployed run can reach;limitations.mdrecords 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
automatablerows, each declared by its test (virtual_test.go, andaccess_test.gofor the authz row).go run ./e2e/cmd/e2e-catalog generate -checkandcheck -quietpass (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 ofmerge-partial-under-outageandunhealthy-remote-from-cachepass 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)
- test(npm): npm virtual recipe and conformance h... (!3192 - merged) • David Fernandez • 19.5
- test(npm): npm virtual composition rows, part 2... (!3193 - merged) • David Fernandez • 19.5
- test(npm): npm virtual failure, access and cond... (!3194 - merged) • David Fernandez • 19.5
👈
Related to #900 (closed)