Skip to content

chore(milpacs): deprecate GetUserViaKeycloakId rpc + keycloak_id fields (#97)#104

Merged
SyniRon merged 1 commit into
developfrom
worktree-issue-97
May 29, 2026
Merged

chore(milpacs): deprecate GetUserViaKeycloakId rpc + keycloak_id fields (#97)#104
SyniRon merged 1 commit into
developfrom
worktree-issue-97

Conversation

@SyniRon
Copy link
Copy Markdown
Collaborator

@SyniRon SyniRon commented May 29, 2026

Closes #97. Phase 1/2. Deprecation only. No behavior change. Removal = #100.

Diff

  • option deprecated = true; on GetUserViaKeycloakId rpc + deprecated: true in openapiv2_operation -> swagger UI struck-through.
  • [deprecated = true] on keycloak_id in KeycloakIdRequest, Profile, LiteProfile -> propagates to .pb.go getters as // Deprecated: comments. Go consumers get IDE/lint warnings.
  • enable_field_deprecation=true in buf.gen.yaml -> keycloakId path param renders deprecated: true in swagger.
  • Regenerated artifacts committed (pb.go, grpc.pb.go, swagger.json).

Tests added

  • proto/deprecation_test.go — descriptor contract via protoreflect. Pins rpc + 3 field deprecation flags. Survives codegen churn.
  • openapi/openapi_test.go — pins swagger op + path-param deprecated markers.
  • Existing TestGetUserViaKeycloakId_* unchanged + still pass.

AC deviation

  • AC wanted "deprecated": true on Profile.keycloak_id / LiteProfile.keycloak_id schema props in swagger.json. Not possible under Swagger 2.0 — deprecated on schema props is OpenAPI 3.0 only. protoc-gen-openapiv2's openapiSchemaObject Go type has no field for it.
  • Field deprecation still visible to:
    • Go consumers (cavbot2 et al) via // Deprecated: getter comments.
    • Other-language gRPC clients via descriptor flag.
  • Gap = REST-only consumer reading keycloakId from GetProfile response. Narrow given cavbot2 cutover (fix(milpacs): route errors to NotFound vs Internal #83) already done + Add request analytics — endpoint volume, latency, error rates, top consumers #92 traffic-gating before Phase 2.

CI gate local

  • make generate deterministic (re-run = no diff)
  • go mod tidy clean
  • go build ./... clean
  • make lint (buf lint + buf breaking vs develop) clean
  • go test ./... all pass

🤖 Generated with Claude Code

…ds (#97)

Phase 1 of 2 — adds deprecation surface only, no behavior change.

- `option deprecated = true;` on the RPC; `deprecated: true` in the
  openapiv2_operation so swagger UI flags the endpoint.
- `[deprecated = true]` on `keycloak_id` in `KeycloakIdRequest`, `Profile`,
  `LiteProfile`. Propagates to .pb.go getters as `// Deprecated:` comments.
- Enable protoc-gen-openapiv2 `enable_field_deprecation=true` so the
  `keycloakId` path parameter renders deprecated in swagger.
- Pin the contract: descriptor-level deprecation test in proto/, swagger
  surface test in openapi/. Existing TestGetUserViaKeycloakId_* unchanged.

Schema-property `deprecated` is OpenAPI 3.0 only — Swagger 2.0 has no slot
for it, so the doc-side signal lives on the op + path param. Removal is
tracked in #100.
Copy link
Copy Markdown
Collaborator Author

@SyniRon SyniRon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg

@SyniRon SyniRon merged commit 85a3926 into develop May 29, 2026
2 checks passed
@SyniRon SyniRon deleted the worktree-issue-97 branch May 29, 2026 03:39
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.

Deprecate MilpacService.GetUserViaKeycloakId in proto (Phase 1 of 2)

1 participant