You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(config): service-label guard skips ServiceType constants not in typed-literal form #1722
TestEveryServiceTypeHasAFrontendLabel (internal/config/service_labels_frontend_test.go, added in #1710) collects the pinned library's service slugs by parsing common for constants written as Name ServiceType = "literal". A constant in any other form is skipped without failing the test:
conversion form: X = ServiceType("x")
an untyped value inside a typed const group
A slug added that way in a future library bump would get no frontend label, and the guard would still pass.
Expected
The guard also collects:
a *ast.CallExpr whose Fun is the ServiceType ident and whose only argument is a string literal;
any const spec in a group that inherits the ServiceType type.
Alternatively, it fails when it finds a ServiceType-typed constant whose value it cannot read, so a new form is reported instead of skipped.
Notes
Every current ServiceType constant uses the explicit typed form, so nothing is missed today.
Activity