feat: adds gorm level foreign key constraint to models in oapi spec#120
Conversation
Signed-off-by: Amit Singh <singhamitch@outlook.com>
|
Warning Review limit reached
More reviews will be available in 24 minutes and 59 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR introduces database schema relationships between Source, Claim, and Proof entities through OpenAPI schema definitions and GORM constraints. The changes are reflected in code generation, test infrastructure, and service tests, establishing foreign key relationships and data integrity constraints across the domain layer. ChangesDatabase Schema Relationships and Constraints
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 `@pkg/domain/claim/claim_service_test.go`:
- Around line 265-269: The current validity check on updatedClaims allows both
entries to be false and still pass; change the test to assert that the two
Validity values are opposite so exactly one is true and the other false by
replacing the conditional branches that inspect updatedClaims[0].Validity and
updatedClaims[1].Validity with a definite assertion that
updatedClaims[0].Validity != updatedClaims[1].Validity (and optionally also
assert that at least one is true) to ensure the test fails when both are false;
locate the logic that reads updatedClaims[...] and updates Validity in
claim_service_test.go and tighten the assertion accordingly.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3b42b1fd-616a-44d4-9b08-5d609517fcff
📒 Files selected for processing (6)
api/source-score.yamlpkg/api/server.gen.gopkg/domain/claim/claim_service_test.gopkg/domain/claim/claim_suite_test.gopkg/domain/proof/proof_suite_test.gopkg/domain/source/source_suite_test.go
ac4d1ca to
f40bf39
Compare
|
@semmet95 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Signed-off-by: Amit Singh <singhamitch@outlook.com>
f40bf39 to
b1b95bf
Compare
Summary by CodeRabbit
Refactor
Tests