census: plan-domains-2a record-write layer
TestPlan9B8RecordWriteCensus already failed at af95f0c5 (linkedPolicies, routeDecls re-digested; runDomainsList's claims table moved to printDomainClaims). This layer re-pins those and route53 SetManaged's alias-first order; no record write added, moved or reclassified.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+68
−1
internal/provision/domains_plan_2a_census_test.go+67 −0internal/provision/plan9_b8_census_test.go+1 −1
CI cancelled — superseded by a newer push — run details
diff --git a/internal/provision/domains_plan_2a_census_test.go b/internal/provision/domains_plan_2a_census_test.go| new file mode 100644 |
| index 000000000..529888fcc |
| --- /dev/null |
| +++ b/internal/provision/domains_plan_2a_census_test.go |
| @@ -0,0 +1,67 @@ |
| +package provision |
| + |
| +// Record-write census entries for domain registration Plan 2a (branch |
| +// plan-domains-2a), layered on namedUnitsParamWriteCensusInventory. No |
| +// deployment-bucket record write is added, moved or reclassified; each |
| +// entry keeps its class and kinds. |
| +// - var linkedPolicies (internal/console/linkedpolicy.go) and var |
| +// routeDecls (internal/console/routedecls.go): re-digested. Plan 2a's |
| +// account Domains routes (the domains page, a domain's page, the |
| +// account buy steps, saved contacts, the purchase card and its poll, |
| +// the point doors) are new declarations and linked-policy rows. Their |
| +// lit:instances and lit:sidecars sites are the existing route patterns, |
| +// unchanged. |
| +// - Host.SetManaged (internal/zonehost/route53zones/route53.go): |
| +// re-digested. It now orders the batch's deletes alias first |
| +// (aliasesFirst). key:recordKey is the DNS record-set identity type, |
| +// not a provision record key. |
| +// - runDomainsList -> printDomainClaims (domains_cli.go): the claims table |
| +// moved out of runDomainsList into printDomainClaims unchanged; its |
| +// lit:instances site is the CATCHALL column's display word "instances", |
| +// not a record key or prefix. runDomainsList no longer has a site. |
| +func domainsPlan2aWriteCensusInventory() []censusEntry { |
| + entries := append([]censusEntry(nil), namedUnitsParamWriteCensusInventory()...) |
| + repins := []censusEntry{ |
| + {"internal/console/linkedpolicy.go", "var linkedPolicies", "key-site", "lit:instances,lit:sidecars", "8c3c1cf73b59d098d4e65736c061ec801b32a23db780e0f8f5511cdb34e8fb1e"}, |
| + {"internal/console/routedecls.go", "var routeDecls", "key-site", "lit:instances,lit:sidecars", "fcd347c716852012286e2ec08eb7706305099cf7b4aa0ef3abe3dd89ebb29045"}, |
| + {"internal/zonehost/route53zones/route53.go", "Host.SetManaged", "key-site", "key:recordKey", "2f3ccff278d00edb3a544c0f9585cd5179a905076692ff5d8b38b9f9d3543198"}, |
| + } |
| + for _, r := range repins { |
| + found := false |
| + for i, e := range entries { |
| + if e.File == r.File && e.Unit == r.Unit { |
| + if e.Class != r.Class || e.Kinds != r.Kinds { |
| + panic("domains-plan-2a re-pin changes the class or kinds of " + r.File + ":" + r.Unit) |
| + } |
| + entries[i], found = r, true |
| + } |
| + } |
| + if !found { |
| + panic("domains-plan-2a re-pin of an unlisted unit " + r.File + ":" + r.Unit) |
| + } |
| + } |
| + removed := map[string]bool{"domains_cli.go:runDomainsList": true} |
| + kept := entries[:0] |
| + for _, e := range entries { |
| + if removed[e.File+":"+e.Unit] { |
| + delete(removed, e.File+":"+e.Unit) |
| + continue |
| + } |
| + kept = append(kept, e) |
| + } |
| + if len(removed) != 0 { |
| + panic("domains-plan-2a removal of an unlisted unit") |
| + } |
| + added := []censusEntry{ |
| + // The claims table runDomainsList printed, moved; "instances" is the CATCHALL column's word. |
| + {"domains_cli.go", "printDomainClaims", "key-site", "lit:instances", "dd19f0d579a5121450af11e0bafd694cd803906542139c5a6f15156958fc5d9a"}, |
| + } |
| + for _, a := range added { |
| + for _, e := range kept { |
| + if e.File == a.File && e.Unit == a.Unit { |
| + panic("domains-plan-2a addition of a listed unit " + a.File + ":" + a.Unit) |
| + } |
| + } |
| + } |
| + return append(kept, added...) |
| +} |
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go| index 32fd6ea61..1801caa1d 100644 |
| --- a/internal/provision/plan9_b8_census_test.go |
| +++ b/internal/provision/plan9_b8_census_test.go |
| @@ -366,7 +366,7 @@ func TestPlan9B8RecordWriteCensus(t *testing.T) { |
| if len(got) < 100 { |
| t.Fatalf("census found only %d units under %s; the walk is broken", len(got), root) |
| } |
| - inventory := namedUnitsParamWriteCensusInventory() |
| + inventory := domainsPlan2aWriteCensusInventory() |
| problems := append(censusDiff(inventory, got), censusPolicy(inventory)...) |
| if len(problems) > 0 { |
| t.Fatalf("record-write census rejected %d site(s); update the explicit inventory only after reviewing the source:\n %s", len(problems), strings.Join(problems, "\n ")) |