Skip to content

fix: CLI storage lifecycle set returns INTERNAL error#493

Merged
poyrazK merged 1 commit intomainfrom
fix/storage-lifecycle-internal-error
May 7, 2026
Merged

fix: CLI storage lifecycle set returns INTERNAL error#493
poyrazK merged 1 commit intomainfrom
fix/storage-lifecycle-internal-error

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented May 7, 2026

Summary

Root Cause

The domain.LifecycleRule struct had TenantID added (commit 79134609) but the database schema and repository INSERT were never updated, causing INTERNAL errors when creating lifecycle rules.

Test plan

  • go test -v ./internal/repositories/postgres/... -run Lifecycle passes
  • go build ./cmd/cloud/... succeeds

The domain.LifecycleRule struct had TenantID added but the database
schema and repository were never updated, causing INTERNAL errors
when creating lifecycle rules. This adds:

- Migration 109: adds tenant_id column to lifecycle_rules table
- Repository: updates Create, Get, List, Delete, GetEnabledRules
  queries to include tenant_id
- Tests: update mocks to match new query signatures
Copilot AI review requested due to automatic review settings May 7, 2026 18:47
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 40 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9faae5b-4a88-4d66-99a6-c78771790d94

📥 Commits

Reviewing files that changed from the base of the PR and between 5faabcc and 260b1c1.

📒 Files selected for processing (4)
  • internal/repositories/postgres/lifecycle_repo.go
  • internal/repositories/postgres/lifecycle_repo_unit_test.go
  • internal/repositories/postgres/migrations/109_lifecycle_rules_tenant_id.down.sql
  • internal/repositories/postgres/migrations/109_lifecycle_rules_tenant_id.up.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/storage-lifecycle-internal-error

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Owner Author

@poyrazK poyrazK left a comment

Choose a reason for hiding this comment

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

It's okay to merge

@poyrazK poyrazK merged commit f276f24 into main May 7, 2026
26 of 27 checks passed
@poyrazK poyrazK review requested due to automatic review settings May 7, 2026 19:10
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.

1 participant