feat: adds domainUrlNewsData field to source model#109
Conversation
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR adds DomainUrlNewsData to the Source API schema and generated models, persists it in PostSource and PatchSourceByUriDigest when provided, and extends unit and acceptance tests to cover happy-paths and validation (nonempty, nospace). Also adds a .gitignore entry for ChangesDomainUrlNewsData Field Addition
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
d7eb7e1 to
b229181
Compare
b229181 to
234938b
Compare
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pkg/domain/source/source_repository_test.go (1)
57-75: ⚡ Quick winAssert patched
DomainUrlNewsDatain this test.The test now patches
DomainUrlNewsDatabut never verifies it persisted, so this path can regress undetected.Proposed test assertion
Expect(source.Name).To(BeEquivalentTo(*sourceInput.Name)) Expect(source.Summary).To(BeEquivalentTo(*sourceInput.Summary)) Expect(source.Tags).To(BeEquivalentTo(*sourceInput.Tags)) + Expect(source.DomainUrlNewsData).To(BeEquivalentTo(*sourceInput.DomainUrlNewsData)) Expect(source.Uri).To(BeEquivalentTo(sampleSourceInput1.Uri)) Expect(source.UriDigest).To(BeEquivalentTo(uriDigest1))🤖 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/domain/source/source_repository_test.go` around lines 57 - 75, The test patches DomainUrlNewsData but doesn't assert it persisted; update the test after calling sourceRepo.GetSourceByUriDigest to assert the returned source.DomainUrlNewsData equals the patched value (i.e., Expect(source.DomainUrlNewsData).To(BeEquivalentTo(*sourceInput.DomainUrlNewsData))). This ensures the PatchSourceByUriDigest and GetSourceByUriDigest code paths for DomainUrlNewsData are covered.pkg/domain/source/source_service_test.go (1)
59-88: ⚡ Quick winValidate
DomainUrlNewsDatain patch happy-path assertions.This test includes
DomainUrlNewsDatain patch input but does not assert it on the fetched source.Proposed assertion addition
Expect(source.Name).To(BeEquivalentTo(*sourceInput.Name)) Expect(source.Summary).To(BeEquivalentTo(*sourceInput.Summary)) Expect(source.Tags).To(BeEquivalentTo(*sourceInput.Tags)) + Expect(source.DomainUrlNewsData).To(BeEquivalentTo(*sourceInput.DomainUrlNewsData)) Expect(source.Uri).To(BeEquivalentTo(sampleSourceInput1.Uri)) Expect(source.UriDigest).To(BeEquivalentTo(uriDigest1))🤖 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/domain/source/source_service_test.go` around lines 59 - 88, The test builds a patch input that includes DomainUrlNewsData but never asserts it; update the happy-path assertions after calling sourceSvc.GetSourceByUriDigest to verify the field is persisted by adding an Expect comparing the returned source's DomainUrlNewsData to the input value (e.g. Expect(source.DomainUrlNewsData).To(BeEquivalentTo(*sourceInput.DomainUrlNewsData)) or to the expected string), and also add any corresponding check on the fake repo call (like inspecting srcInput.DomainUrlNewsData from fakeSourceRepo.PostSourceArgsForCall(0)) so the PatchSourceByUriDigest and GetSourceByUriDigest flows are both validated.
🤖 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.
Nitpick comments:
In `@pkg/domain/source/source_repository_test.go`:
- Around line 57-75: The test patches DomainUrlNewsData but doesn't assert it
persisted; update the test after calling sourceRepo.GetSourceByUriDigest to
assert the returned source.DomainUrlNewsData equals the patched value (i.e.,
Expect(source.DomainUrlNewsData).To(BeEquivalentTo(*sourceInput.DomainUrlNewsData))).
This ensures the PatchSourceByUriDigest and GetSourceByUriDigest code paths for
DomainUrlNewsData are covered.
In `@pkg/domain/source/source_service_test.go`:
- Around line 59-88: The test builds a patch input that includes
DomainUrlNewsData but never asserts it; update the happy-path assertions after
calling sourceSvc.GetSourceByUriDigest to verify the field is persisted by
adding an Expect comparing the returned source's DomainUrlNewsData to the input
value (e.g.
Expect(source.DomainUrlNewsData).To(BeEquivalentTo(*sourceInput.DomainUrlNewsData))
or to the expected string), and also add any corresponding check on the fake
repo call (like inspecting srcInput.DomainUrlNewsData from
fakeSourceRepo.PostSourceArgsForCall(0)) so the PatchSourceByUriDigest and
GetSourceByUriDigest flows are both validated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1c786858-6533-4277-afbc-d8d9036e99c4
📒 Files selected for processing (7)
.gitignoreacceptance/source_test.goapi/source-score.yamlpkg/api/server.gen.gopkg/domain/source/source_repository.gopkg/domain/source/source_repository_test.gopkg/domain/source/source_service_test.go
Signed-off-by: Amit Singh <singhamitch@outlook.com>
234938b to
8bac42b
Compare
Summary by CodeRabbit
New Features
Tests
Chores