Skip to content

test(config): service-label guard skips ServiceType constants not in typed-literal form #1722

Open

Description

@cristim

Summary

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions