Follow-up from "test(managementapi): cover the container upstream reads and associate part 12/15 (S17 Phase 6 plan: 42/42)"
The following discussions from !2857 (merged) should be addressed:
-
@vespian_gl started a discussion:
non-blocking: This comment says "The update writes before its one read", but the handler reads first.
handleUpdateUpstreamcallsrepositionedUpstreamReadablebeforearm.store.Reposition, and that helper callsarm.store.Upstreamsfirst. ThensettledUpstreamreads the list again. So the update reads, writes, and reads again. S17 requires this order: "ThePOSTandPATCHevaluate the check before they write".As a result, a gate that the update skipped shows in
rig.store.Lists(), which the case asserts on the line above. TheRepositions()assertion does no harm, but the reason the comment gives for it is false. A reader who trusts the comment can accept a later change that moves the check afterReposition. That change breaks the S17 rule that a503applies nothing. Guardrail 17 inAGENTS.mdrequires a comment to describe the code as the change leaves it.The comment should go, or it should match the code. For example: "The update reads the association before it moves it, so Lists already catches a skipped gate; Repositions pins that no move reached the store either."
This is a bot message
🤖 — /mergeable -
@vespian_gl started a discussion:
non-blocking: Two assertions in this file check less than their messages say.
- This
require.Equalon201says "the mix must be admitted". ButfakeVirtualUpstreams.Associateaccepts any upstream, andhandleAssociateUpstreamhas no format or family gate beforearm.store.Associate. So this status cannot fail on admission, and a store change that refuses thedocker/ocimix does not fail here.TestContainerVirtualUpstreamStore_Associate_AdmitsTheDockerOciMixBothWaysin the datastore suite tests the admission. This test pins that the associate renders the upstream's stored format. - In
TestContainerUpstreams_List_VerdictFailure_FailsClosed, theunavailablerow (line 284) sets nowantLog. So theassert.Containsat line 315 becomesContains(logs, "")on that row, which is always true. Its message says that the500log line names the lengths, but that row is a503.
The first message should say what the test checks: the associate renders the upstream's stored format. The log assertion should run only when
tc.wantLog != "", or the503row can get its own expected fragment if that path writes one.This is a bot message
🤖 — /mergeable - This
-
@vespian_gl started a discussion:
non-blocking: This test sends the same requests over the same state as the
the sibling container formatrow at line 399.Under the
ociarm, that row stores adockervirtual repository and sends all five routes under/oci. Under thedockerarm, this test also stores adockervirtual repository and sends all five routes under/oci. The same pair holds for the other arm. The doc comment says this test reads "the same rule ... from the route rather than the row", but no handler change fails one test and passes the other.This test adds a seeded association row, a
Dissociates()assertion, andassertNoAuditEventsOnSink. It does not assertLists()or theCodeNotFoundenvelope, which the table does. So a reader sees two directions of coverage where there is one, and the copy with fewer checks is the one that claims to add a direction.One of the two should go. You can remove the sibling row from the table and add
Lists()and the envelope check here. Or you can remove this test and move itsDissociates()and audit assertions into the table. If you keep both, the doc comment should not claim a separate direction.This is a bot message
🤖 — /mergeable -
@vespian_gl started a discussion:
non-blocking: Part 11 already defines
containerArm{segment, format},containerArms(), andcontainerArmRow(t, suffix, position, kind, format)incontainer_upstream_arms_test.go.This file adds
containerUpstreamArm,containerUpstreamArms(), andcontainerUpstreamRowwith the same signature. It also addscontainerUpstreamTestID, a copy ofnpmUpstreamTestIDwith a different prefix, andcontainerUpstreamRoute, which has the same fields asnpmUpstreamRoute. The Maven suite reuses the npm route type:mavenUpstreamRoutesreturns[]npmUpstreamRoute. Also, the rig'sarmfield (line 82) is set at line 126 and nothing reads it.Nothing fails today. But with two arm tables for the same two segments in one package, a change to one table does not reach the other suite, and that suite stops testing the new arm without failing.
The container suites should share one arm table. You can add the sibling fields to part 11's
containerArmand build the rows withcontainerArmRow.containerUpstreamRoutescan return[]npmUpstreamRoute, as the Maven suite does. The unreadarmfield should go, or a test should use it.This is a bot message
🤖 — /mergeable