Skip to content

feat: adds domainUrlNewsData field to source model#109

Merged
semmet95 merged 3 commits into
mainfrom
feat/src-domain-url
May 13, 2026
Merged

feat: adds domainUrlNewsData field to source model#109
semmet95 merged 3 commits into
mainfrom
feat/src-domain-url

Conversation

@semmet95
Copy link
Copy Markdown
Contributor

@semmet95 semmet95 commented May 13, 2026

Summary by CodeRabbit

  • New Features

    • Added a new Source field, domainUrlNewsData, exposed in the API and updatable; validation enforces non-empty, whitespace-free values.
  • Tests

    • Expanded acceptance, unit, and service tests covering creation, partial updates, and validation (empty or space-containing values rejected).
  • Chores

    • Updated .gitignore to ignore the .amazonq/ directory.

Review Change Stack

semmet95 added 2 commits May 12, 2026 22:46
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b83eb387-4e19-492d-8637-b4d3e0f45dbd

📥 Commits

Reviewing files that changed from the base of the PR and between 234938b and 8bac42b.

📒 Files selected for processing (6)
  • acceptance/source_test.go
  • api/source-score.yaml
  • pkg/api/server.gen.go
  • pkg/domain/source/source_repository.go
  • pkg/domain/source/source_repository_test.go
  • pkg/domain/source/source_service_test.go
✅ Files skipped from review due to trivial changes (1)
  • api/source-score.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • pkg/domain/source/source_repository.go
  • acceptance/source_test.go
  • pkg/domain/source/source_service_test.go
  • pkg/api/server.gen.go

📝 Walkthrough

Walkthrough

This 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 .amazonq/.

Changes

DomainUrlNewsData Field Addition

Layer / File(s) Summary
API Schema and Generated Models
api/source-score.yaml, pkg/api/server.gen.go
OpenAPI adds domainUrlNewsData (string) to SourceInput, SourcePatchInput, and Source with omitnil, nonempty, and nospace validation; generated Go structs include the field with appropriate JSON, binding, and validation tags.
Repository Persistence Logic
pkg/domain/source/source_repository.go
PostSource and PatchSourceByUriDigest now set source.DomainUrlNewsData from input when the input value is non-nil.
Repository and Service Unit Tests
pkg/domain/source/source_repository_test.go, pkg/domain/source/source_service_test.go
Repository patch test includes DomainUrlNewsData. Service tests assert happy-path persistence and add validation cases for empty (nonempty) and whitespace-containing (nospace) values, expecting apperrors.ErrInvalidSource.
Acceptance Tests and Misc
acceptance/source_test.go, .gitignore
Acceptance POST/PATCH happy-paths create/update DomainUrlNewsData and verify via GET. Acceptance validation tests confirm 400 responses with appropriate error messages for whitespace (POST) and empty string (PATCH). .gitignore now ignores .amazonq/.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped a field into the spec today,
From YAML down to structs and tests at play,
No spaces allowed, and empty strings decline,
Post, Patch, and GET all keep the value fine,
The rabbit nods—end-to-end, the change is made.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new domainUrlNewsData field to the Source model, which is reflected across API schemas, generated code, repository logic, and test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/src-domain-url

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@semmet95 semmet95 force-pushed the feat/src-domain-url branch from d7eb7e1 to b229181 Compare May 13, 2026 04:41
@semmet95 semmet95 force-pushed the feat/src-domain-url branch from b229181 to 234938b Compare May 13, 2026 05:04
@semmet95 semmet95 marked this pull request as ready for review May 13, 2026 05:06
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
pkg/domain/source/source_repository_test.go (1)

57-75: ⚡ Quick win

Assert patched DomainUrlNewsData in this test.

The test now patches DomainUrlNewsData but 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 win

Validate DomainUrlNewsData in patch happy-path assertions.

This test includes DomainUrlNewsData in 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

📥 Commits

Reviewing files that changed from the base of the PR and between a2ff074 and 234938b.

📒 Files selected for processing (7)
  • .gitignore
  • acceptance/source_test.go
  • api/source-score.yaml
  • pkg/api/server.gen.go
  • pkg/domain/source/source_repository.go
  • pkg/domain/source/source_repository_test.go
  • pkg/domain/source/source_service_test.go

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

Signed-off-by: Amit Singh <singhamitch@outlook.com>
@semmet95 semmet95 force-pushed the feat/src-domain-url branch from 234938b to 8bac42b Compare May 13, 2026 07:20
@semmet95 semmet95 merged commit 1f2ac0f into main May 13, 2026
5 checks passed
@semmet95 semmet95 deleted the feat/src-domain-url branch May 13, 2026 07:22
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