-
Notifications
You must be signed in to change notification settings - Fork 832
Adding ability to enable / disable online evaluation rules #2728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ability to enable / disable online evaluation rules #2728
Conversation
There was a problem hiding this comment.
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 adds the ability to enable and disable online evaluation rules through a new boolean enabled
field. This allows users to pause rule execution without deleting the rules or setting sampling rates to zero.
- Added
enabled
field to all automation rule models and API classes throughout the stack - Added UI support with a toggle switch in the rules table and filtering capabilities
- Updated evaluation logic to skip disabled rules during trace processing
Reviewed Changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
Database migration | Adds enabled column to automation_rules table with default TRUE |
Frontend types | Adds boolean column type and != filter operator for enabled field |
Frontend components | Adds enabled column with toggle switch to rules tables |
Backend models | Updates all automation rule models to include enabled field |
Backend DAOs | Updates database queries to handle enabled field |
Backend services | Updates rule evaluation logic to check enabled status before sampling |
apps/opik-frontend/src/components/pages/TracesPage/RulesTab/RulesTab.tsx
Show resolved
Hide resolved
apps/opik-frontend/src/components/pages/OnlineEvaluationPage/OnlineEvaluationPage.tsx
Show resolved
Hide resolved
...ain/java/com/comet/opik/api/resources/v1/events/TraceThreadOnlineScoringSamplerListener.java
Show resolved
Hide resolved
798f5fe
to
3f27a00
Compare
SDK E2E Tests Results58 tests 57 ✅ 1m 51s ⏱️ For more details on these failures, see this check. Results for commit bb34eed. ♻️ This comment has been updated with latest results. |
Backend Tests Results 187 files 187 suites 19m 21s ⏱️ Results for commit f1dcd81. ♻️ This comment has been updated with latest results. |
0049ddc
to
256f812
Compare
...ain/java/com/comet/opik/api/resources/v1/events/TraceThreadOnlineScoringSamplerListener.java
Outdated
Show resolved
Hide resolved
...d/src/main/java/com/comet/opik/domain/evaluators/LlmAsJudgeAutomationRuleEvaluatorModel.java
Outdated
Show resolved
Hide resolved
...java/com/comet/opik/domain/evaluators/TraceThreadLlmAsJudgeAutomationRuleEvaluatorModel.java
Outdated
Show resolved
Hide resolved
...t/opik/domain/evaluators/TraceThreadUserDefinedMetricPythonAutomationRuleEvaluatorModel.java
Outdated
Show resolved
Hide resolved
...va/com/comet/opik/domain/evaluators/UserDefinedMetricPythonAutomationRuleEvaluatorModel.java
Outdated
Show resolved
Hide resolved
46870f1
to
7ad3953
Compare
...src/test/java/com/comet/opik/api/resources/v1/priv/AutomationRuleEvaluatorsResourceTest.java
Outdated
Show resolved
Hide resolved
.../main/resources/liquibase/db-app-state/migrations/000022_add_enabled_to_automation_rules.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from the code perspective from FE side. I left a few small comments but them are not blockers.
apps/opik-frontend/src/components/pages/OnlineEvaluationPage/OnlineEvaluationPage.tsx
Outdated
Show resolved
Hide resolved
apps/opik-frontend/src/components/pages/TracesPage/RulesTab/RulesTab.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generally in the right direction, but please address the open comments first.
Additionally, I'll send you the link for our PR guidelines. The Cursor automation is great, but we have the convention of self-reviewing PRs before submitting them to the team.
There are some gaps here that would speed up the review and merge process, if the contributor supervises first the PR.
apps/opik-backend/src/main/java/com/comet/opik/api/evaluators/AutomationRuleEvaluator.java
Outdated
Show resolved
Hide resolved
.../opik-backend/src/main/java/com/comet/opik/api/resources/v1/events/OnlineScoringSampler.java
Outdated
Show resolved
Hide resolved
...ain/java/com/comet/opik/api/resources/v1/events/TraceThreadOnlineScoringSamplerListener.java
Outdated
Show resolved
Hide resolved
.../main/resources/liquibase/db-app-state/migrations/000022_add_enabled_to_automation_rules.sql
Outdated
Show resolved
Hide resolved
.../main/resources/liquibase/db-app-state/migrations/000022_add_enabled_to_automation_rules.sql
Outdated
Show resolved
Hide resolved
...src/test/java/com/comet/opik/api/resources/v1/priv/AutomationRuleEvaluatorsResourceTest.java
Outdated
Show resolved
Hide resolved
bb34eed
to
43ecd12
Compare
43ecd12
to
a516a40
Compare
...pik-frontend/src/components/pages-shared/automations/AddEditRuleDialog/AddEditRuleDialog.tsx
Outdated
Show resolved
Hide resolved
...pik-frontend/src/components/pages-shared/automations/AddEditRuleDialog/AddEditRuleDialog.tsx
Outdated
Show resolved
Hide resolved
apps/opik-frontend/src/components/shared/DataTableHeaders/TypeHeader.tsx
Outdated
Show resolved
Hide resolved
f8ef216
to
a61e014
Compare
a61e014
to
f1dcd81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good from the FE side, thanks for handling comments!
Adding ability to enable & disable online evaluation rules