feat(identity): scaffold identity service#1
Conversation
Test & Lint Summary
Tests: 0 passed, 0 failed, 0 skipped (go test ./...) |
Test & Lint Summary
Tests: 0 passed, 0 failed, 0 skipped (go test ./...) |
Summary
Test & Lint Summary
Tests: 0 passed, 0 failed, 0 skipped (go test ./...) |
noa-lucent
left a comment
There was a problem hiding this comment.
Clean scaffold overall — the service structure, boundary/internal separation, error handling, and Helm setup are solid. Two items need addressing before merge:
- 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.
- Missing unit tests for converter — This is the core correctness contract. Add a
converter_test.gowith 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.
Summary
Test & Lint Summary
Tests: 1 passed, 0 failed, 0 skipped (go test ./...) |
Test & Lint Summary (updated)
Tests: 4 passed, 0 failed, 0 skipped (go test ./...) |
|
All 6 review comments addressed:
CI is green (4 tests passing). Ready for re-review. |
noa-lucent
left a comment
There was a problem hiding this comment.
All 6 prior comments verified and resolved against the actual code:
- ✅ Magic numbers → Named constants + single
identityTypeMappingsslice drives both directions. Clean. - ✅ Default returns UNSPECIFIED → Now returns zero value on error path.
- ✅ Redundant parseUUID guard → Removed;
uuid.Parsehandles all cases.fmtimport cleaned up. - ✅ Missing unit tests →
converter_test.goadded with round-trip, UNSPECIFIED rejection, and unknown-value tests. Good coverage. - ✅ ORDER BY → Removed from batch query.
- ✅ CI go vet → Step added.
- ✅ 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.
Summary
Testing
Issue