Skip to content

feat(identity): scaffold identity service#1

Merged
rowan-stein merged 4 commits intomainfrom
noa/issue-68-pr
Mar 23, 2026
Merged

feat(identity): scaffold identity service#1
rowan-stein merged 4 commits intomainfrom
noa/issue-68-pr

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • scaffold Identity gRPC service layout, migrations, and Helm chart
  • implement identity store and server with identity type mapping
  • add e2e test suite and CI/release workflows

Testing

  • buf generate ../api --template buf.gen.yaml
  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go vet ./...
  • CGO_ENABLED=0 go build ./...
  • DOCKER_BUILDKIT=1 docker build -t identity-service-test --build-arg BUF_INPUT=https://github.com/agynio/api.git#branch=noa/issue-68 --build-arg BUF_PATH=proto/agynio/api/identity/v1 .

Issue

  • #68

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

  • buf generate ../api --template buf.gen.yaml
  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go vet ./...
  • CGO_ENABLED=0 go build ./...
  • DOCKER_BUILDKIT=1 docker build -t identity-service-test --build-arg BUF_INPUT=https://github.com/agynio/api.git#branch=noa/issue-68 --build-arg BUF_PATH=proto/agynio/api/identity/v1 .

Tests: 0 passed, 0 failed, 0 skipped (go test ./...)
Lint: go vet (no issues)

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary

  • buf generate ../api --template buf.gen.yaml
  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go vet ./...
  • CGO_ENABLED=0 go build ./...

Tests: 0 passed, 0 failed, 0 skipped (go test ./...)
Lint: go vet (no issues)

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • align identity type mapping to updated enum numeric values
  • update batch response usage to entries field

Test & Lint Summary

  • buf generate ../api --template buf.gen.yaml
  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go vet ./...
  • CGO_ENABLED=0 go build ./...

Tests: 0 passed, 0 failed, 0 skipped (go test ./...)
Lint: go vet (no issues)

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

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

Clean scaffold overall — the service structure, boundary/internal separation, error handling, and Helm setup are solid. Two items need addressing before merge:

  1. Magic numbers in converter — The proto↔DB int16 mapping uses raw literals in two separate switch statements. Extract named constants or a shared mapping table to prevent the two sides from drifting apart.
  2. Missing unit tests for converter — This is the core correctness contract. Add a converter_test.go with round-trip and error-case coverage so mapping regressions are caught at build time without a database.

Minor/nit items (redundant parseUUID guard, unnecessary ORDER BY, CI missing go vet, DATABASE_URL comment) are noted inline but non-blocking.

Comment thread internal/server/converter.go Outdated
Comment thread internal/server/converter.go
Comment thread internal/server/server.go
Comment thread internal/server/converter.go
Comment thread internal/store/store.go
Comment thread .github/workflows/ci.yml
Comment thread charts/identity/values.yaml
@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • centralize identity type DB/proto mapping with constants + shared table
  • add converter unit tests and simplify parseUUID
  • remove unnecessary ORDER BY, add go vet CI step, and clarify DATABASE_URL value

Test & Lint Summary

  • buf generate ../api --template buf.gen.yaml
  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go vet ./...
  • CGO_ENABLED=0 go build ./...

Tests: 1 passed, 0 failed, 0 skipped (go test ./...)
Lint: go vet (no issues)

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & Lint Summary (updated)

  • buf generate ../api --template buf.gen.yaml
  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go vet ./...
  • CGO_ENABLED=0 go build ./...

Tests: 4 passed, 0 failed, 0 skipped (go test ./...)
Lint: go vet (no issues)

@rowan-stein
Copy link
Copy Markdown
Collaborator

All 6 review comments addressed:

  1. Magic numbers → Centralized into named constants with a shared mapping table.
  2. Converter tests → Added converter_test.go with 4 unit tests.
  3. Error path → Fixed identityTypeToProto return on error.
  4. Redundant guard → Removed empty-string check in parseUUID.
  5. CI vet → Added go vet step to CI workflow.
  6. Nits → Removed ORDER BY from batch query; updated DATABASE_URL values.yaml comment.

CI is green (4 tests passing). Ready for re-review.

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

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

All 6 prior comments verified and resolved against the actual code:

  1. Magic numbers → Named constants + single identityTypeMappings slice drives both directions. Clean.
  2. Default returns UNSPECIFIED → Now returns zero value on error path.
  3. Redundant parseUUID guard → Removed; uuid.Parse handles all cases. fmt import cleaned up.
  4. Missing unit testsconverter_test.go added with round-trip, UNSPECIFIED rejection, and unknown-value tests. Good coverage.
  5. ORDER BY → Removed from batch query.
  6. CI go vet → Step added.
  7. DATABASE_URL comment → Comment added in values.yaml.

Looks good — clean service scaffold, solid boundary/internal separation, and the converter is now well-tested and maintainable. Ship it.

@rowan-stein rowan-stein merged commit 9de3f0e into main Mar 23, 2026
1 check passed
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.

3 participants