Skip to content

Making domain entities richer - #14

Merged
serroba merged 1 commit into
mainfrom
dev
Jan 2, 2026
Merged

Making domain entities richer#14
serroba merged 1 commit into
mainfrom
dev

Conversation

@serroba

@serroba serroba commented Jan 2, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 2, 2026 19:54
@codecov

codecov Bot commented Jan 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cd913f8) to head (9bb56cc).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #14   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         5    -1     
  Lines          176       169    -7     
=========================================
- Hits           176       169    -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@serroba
serroba merged commit 4b1e466 into main Jan 2, 2026
7 checks passed
@serroba
serroba deleted the dev branch January 2, 2026 19:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the feature flag evaluation logic by moving it from separate evaluator functions into domain entity methods, making the entities more self-contained and behavior-rich. This is a classic Domain-Driven Design improvement where entities gain responsibility for their own business logic.

Key changes:

  • Moved evaluation logic from evaluator.go into methods on Flag, Rule, Condition, and EvalContext types
  • Removed the RuleMatcher abstraction, simplifying the Service implementation
  • Added comprehensive unit tests for the new domain entity methods

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/flags/types.go Added Evaluate(), Matches(), GetAttr(), and containsValue() methods to domain entities, encapsulating evaluation logic within the types themselves
internal/flags/types_test.go Added comprehensive unit tests for all new domain entity methods, covering all operators and edge cases
internal/flags/evaluator.go Removed file - evaluation logic moved to domain entities
internal/flags/evaluator_test.go Removed file - tests migrated to types_test.go with equivalent coverage
internal/flags/service.go Simplified by removing RuleMatcher abstraction and delegating evaluation to Flag.Evaluate()
internal/flags/service_test.go Removed TestService_WithCustomMatcher test as the custom matcher functionality is no longer supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants