Skip to content

test(catalog): refresh the pinned catalog snapshot - #419

Closed
onel wants to merge 1 commit into
devfrom
test/catalog-fixture-refresh
Closed

test(catalog): refresh the pinned catalog snapshot#419
onel wants to merge 1 commit into
devfrom
test/catalog-fixture-refresh

Conversation

@onel

@onel onel commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

testdata/snapshot.json is a pinned copy of the published catalog, and TestNoUnmodeledFields checks it key by key so a field the catalog serves can never be one this box silently drops. That only works while the copy is close to what is actually served, and it had drifted.

The shape did not change; the apps did. Top-level keys are identical, no app key disappeared, and the guard passes.

One key is new to the file: external_costs. wireApp has modelled it since it landed (wire.go:112), but no published app declared one until now, so the pinned fixture never exercised it. It does now, which is the part of this refresh that actually buys coverage rather than just currency.

That also dated the comment on TestExternalCostsSurviveTheDigest, which stated no published app declares a cost. Reworded rather than removed: the test still constructs its own snapshot, so the byte-fidelity and field-ordering proof does not depend on which apps happen to be published — it is just no longer the only thing covering the field.

go test ./internal/catalog/...   ok
gofmt -l internal/catalog/       clean

No production code changes.

Updates testdata/snapshot.json to a current copy of the published
catalog. The wire guard checks that every field the catalog serves is
one this box models, and this snapshot is what it checks against, so it
is worth keeping close to what is actually served.

The apps in the snapshot changed; the shape did not. The top-level keys
are identical and no app key disappeared. One key is new to the file:
external_costs, which wireApp already models but which no published app
declared until now, so the guard had never actually exercised it. It
does now.

That also dates the comment on TestExternalCostsSurviveTheDigest, which
said no published app declares a cost. Reworded: the test still builds
its own snapshot, so the proof does not depend on which apps happen to
be published, but it is no longer the only thing that covers the field.
@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or non-blocking defects identified.

The changes are limited to a refreshed test fixture and an explanatory comment, and the fixture remains aligned with the digest-covered catalog wire model.

Important Files Changed

Filename Overview
internal/catalog/testdata/snapshot.json Refreshes the catalog fixture and adds real-world coverage of the modeled external_costs wire field without introducing an identified schema or integrity defect.
internal/catalog/wire_test.go Updates documentation around the existing constructed external-cost digest test; test behavior is unchanged.

Reviews (1): Last reviewed commit: "test(catalog): refresh the pinned catalo..." | Re-trigger Greptile

@onel onel closed this Aug 17, 2026
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