HYPERFLEET-1468 - feat: Add the resources tenancy column and GIN index - #335
HYPERFLEET-1468 - feat: Add the resources tenancy column and GIN index#335mliptak0 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Risk Score: 2 —
|
| Signal | Detail | Points |
|---|---|---|
| PR size | 40 lines | +0 |
| Sensitive paths | none | +0 |
| Test coverage | No _test.go files in diff | +2 |
Computed by hyperfleet-risk-scorer
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Warning Review ran into problems🔥 ProblemsRepository analysis: Couldn't refresh 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 `@pkg/db/migrations/202608111200_add_resource_tenancy.go`:
- Around line 30-32: Remove the ALTER TABLE resources DROP COLUMN IF EXISTS
tenancy operation from the migration rollback function. Keep the rollback
backward-compatible without deleting stored tenancy data, and leave any
destructive cleanup to a separate audited procedure.
🪄 Autofix
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: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 2878d285-1545-4b51-a706-c975f044f75c
📒 Files selected for processing (4)
docs/database.mdpkg/api/resource.gopkg/db/migrations/202608111200_add_resource_tenancy.gopkg/db/migrations/migration_structs.go
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift-hyperfleet/architecture(manual)openshift-hyperfleet/hyperfleet-api(manual)openshift-hyperfleet/hyperfleet-sentinel(manual)openshift-hyperfleet/hyperfleet-adapter(manual)openshift-hyperfleet/hyperfleet-broker(manual)
| return tx.Exec( | ||
| "ALTER TABLE resources DROP COLUMN IF EXISTS tenancy;", | ||
| ).Error |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Do not drop resources.tenancy in the automatic rollback.
DROP COLUMN permanently deletes all stored tenancy JSONB values. This conflicts with docs/database.md (Line 64-66), which states that migrations never drop columns or tables. Remove the destructive column drop from the production rollback. Use a separate, audited procedure if data destruction is ever required.
As per path instructions, migrations must be backward compatible and must not create data-loss scenarios.
🤖 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 `@pkg/db/migrations/202608111200_add_resource_tenancy.go` around lines 30 - 32,
Remove the ALTER TABLE resources DROP COLUMN IF EXISTS tenancy operation from
the migration rollback function. Keep the rollback backward-compatible without
deleting stored tenancy data, and leave any destructive cleanup to a separate
audited procedure.
Source: Path instructions
Summary
Test Plan
make test-allpassesmake lintpassesmake test-helm(if applicable)