Repository navigation
OSAC-1532: Update cli references to use tenant, update tenant table/display - #781
Conversation
Assisted-by: Claude Code
… user data Assisted-by: Claude Code Update migration hash
|
@DakCrowder: This pull request references OSAC-1532 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Warning Review limit reached
More reviews will be available in 4 minutes and 8 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR renames user JSON data from ChangesTenant rename across storage and contracts
Estimated review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (10 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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
internal/servers/private_users_server_test.go (1)
38-65: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert
Tenanton the create response.This test now sends
Spec.Tenant, but it never verifies that the private create path returns/persists it. If the rename is dropped anywhere below the request boundary, this still passes.Suggested assertion
Expect(response.Object.Id).ToNot(BeEmpty()) Expect(response.Object.Metadata.Name).To(Equal("test-user")) Expect(response.Object.Spec.Username).To(Equal("testuser")) + Expect(response.Object.Spec.Tenant).To(Equal("org-123"))🤖 Prompt for 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. In `@internal/servers/private_users_server_test.go` around lines 38 - 65, The private user create test in privateServer.Create currently verifies the returned object fields but not Spec.Tenant, so it can miss a dropped tenant mapping. Update the Create request assertion block to check that the response object’s Spec.Tenant matches the input tenant, alongside the existing checks for Metadata.Name and Spec.Username, using the privateServer.Create and response.Object symbols to locate the test.internal/servers/users_server_test.go (1)
40-67: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert
Tenantin the public create test too.The request now populates
Spec.Tenant, but the test still only checks unrelated fields. Add a response assertion so the public server coverage actually proves the rename survives the create flow.Suggested assertion
Expect(response.Object.Id).ToNot(BeEmpty()) Expect(response.Object.Metadata.Name).To(Equal("test-user")) Expect(response.Object.Spec.Username).To(Equal("testuser")) + Expect(response.Object.Spec.Tenant).To(Equal("org-123"))🤖 Prompt for 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. In `@internal/servers/users_server_test.go` around lines 40 - 67, The public create test in UsersServer currently sets Spec.Tenant but never verifies it in the returned object, so update the Create flow assertions to check the response preserves that field. Add an assertion alongside the existing response checks in the UsersServer public create test to confirm response.Object.Spec.Tenant equals the expected tenant value, using the Create response from publicServer.Create.
🤖 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
`@internal/database/migrations/65_rename_organization_to_tenant_in_user_data_test.go`:
- Around line 50-95: Add a new fixture to the migration test table in
65_rename_organization_to_tenant_in_user_data_test.go that includes both
spec.organization and spec.tenant in the same user payload. Update the
expectations to assert the migration preserves the existing spec.tenant value
while removing the legacy organization key, and place it alongside the other
cases in the test entries for the migration behavior.
In
`@internal/database/migrations/65_rename_organization_to_tenant_in_user_data.up.sql`:
- Around line 17-23: The migration update in the users data rewrite is
overwriting an existing spec.tenant when spec.organization is still present;
adjust the jsonb_set logic so the legacy spec.organization key is removed but
spec.tenant is only populated when it does not already exist. Use the update
statement in the migration to preserve existing tenant values and only map
organization into tenant for rows that lack spec.tenant.
---
Outside diff comments:
In `@internal/servers/private_users_server_test.go`:
- Around line 38-65: The private user create test in privateServer.Create
currently verifies the returned object fields but not Spec.Tenant, so it can
miss a dropped tenant mapping. Update the Create request assertion block to
check that the response object’s Spec.Tenant matches the input tenant, alongside
the existing checks for Metadata.Name and Spec.Username, using the
privateServer.Create and response.Object symbols to locate the test.
In `@internal/servers/users_server_test.go`:
- Around line 40-67: The public create test in UsersServer currently sets
Spec.Tenant but never verifies it in the returned object, so update the Create
flow assertions to check the response preserves that field. Add an assertion
alongside the existing response checks in the UsersServer public create test to
confirm response.Object.Spec.Tenant equals the expected tenant value, using the
Create response from publicServer.Create.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: b0af2672-07fb-4b25-909f-2270dfa978c6
⛔ Files ignored due to path filters (4)
internal/api/osac/private/v1/user_type.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/user_type_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/user_type.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/user_type_protoopaque.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (10)
internal/database/migrations.sha256internal/database/migrations/65_rename_organization_to_tenant_in_user_data.up.sqlinternal/database/migrations/65_rename_organization_to_tenant_in_user_data_test.gointernal/rendering/tables/osac.private.v1.Tenant.yamlinternal/rendering/tables/osac.private.v1.User.yamlinternal/rendering/tables/osac.public.v1.Tenant.yamlinternal/servers/private_users_server_test.gointernal/servers/users_server_test.goproto/private/osac/private/v1/user_type.protoproto/public/osac/public/v1/user_type.proto
|
/hold |
Assisted-by: Claude Code OSAC-1532: Update db migration hash
eebf991 to
1c59d57
Compare
|
/unhold |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DakCrowder, jhernand The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary by CodeRabbit
New Features
Bug Fixes
organizationtotenantin stored data.Documentation