proto: add OrgUnitStatus enum and status/deleted fields#184
Conversation
Add OrgUnitStatus enum (Active=0, Deleted=1) for org-unit soft-delete support. Add status field to OrgUnitsListEntry and OrgUnitGetResp, and deleted timestamp field to OrgUnitGetResp. Closes go-core-stack#179
Walkthrough
OrgUnit soft-delete proto contract
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api/org-unit.proto`:
- Around line 119-120: The proto contract has new org unit fields that are not
yet reflected in the generated Go types or wired into responses. Regenerate the
protobuf artifacts so api/org-unit.pb.go includes the new field definitions and
serialization logic, then update the org unit response builders in
pkg/server/org-unit.go to populate the new status-related fields instead of
leaving the defaults. Make sure both the org unit getters/builders and any
response construction paths use the regenerated symbols so the soft-delete state
is actually emitted.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Prabhjot-Sethi
left a comment
There was a problem hiding this comment.
missing generated files, i have created a new pull request #185 with the changes, i will be closing this one
Summary
Adds proto definitions required for org-unit soft-delete (issue #179):
OrgUnitStatusenum —Active = 0,Deleted = 1(PascalCase, consistent with existingApiKeyDef.Statusconvention)OrgUnitsListEntry.status(field 6) — exposes status in list responses so internal callers can see deleted OUsOrgUnitGetResp.status(field 6) — exposes status in get responsesOrgUnitGetResp.deleted(field 7) —int64unix timestamp recording when the OU was soft-deleted (0if active)Design decisions
ApiKeyDef.Statuspatterndeletedonly onGetResp, not onListEntrymyaccount.protoWire compatibility
All new fields use previously unused field numbers (6, 7). Existing clients that don't know about these fields will simply ignore them (standard proto3 behaviour). No breaking changes.
Closes #179
Summary by CodeRabbit