Skip to content

ref(ACI): Update evaluate_value return #92439

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

Merged
merged 11 commits into from
Jun 2, 2025

Conversation

ceorourke
Copy link
Member

@ceorourke ceorourke commented May 28, 2025

An offshoot of #88647 to update evaluate_value to handle when the handler returns a result that isn't a boolean as we will for anomaly detection.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 28, 2025
@ceorourke ceorourke marked this pull request as ready for review May 28, 2025 21:32
@ceorourke ceorourke requested review from a team as code owners May 28, 2025 21:32
@ceorourke ceorourke removed the request for review from a team May 28, 2025 21:33
Copy link

codecov bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #92439      +/-   ##
==========================================
- Coverage   87.89%   87.89%   -0.01%     
==========================================
  Files       10250    10250              
  Lines      587913   587931      +18     
  Branches    22828    22828              
==========================================
+ Hits       516774   516784      +10     
- Misses      70693    70701       +8     
  Partials      446      446              

Copy link
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

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

i don't think we should be introducing any anomaly detection code with the change to evaluate_value -- instead we can make a mock data condition that meets the criteria we want and returns an overriding result. this will allow us to change the result and create different assertions and not have to introduce the AD code.

DataConditionHandler,
DetectorPriorityLevel,
WorkflowEventData,
)


@condition_handler_registry.register(Condition.ANOMALY_DETECTION)
class AnomalyDetectionHandler(DataConditionHandler[WorkflowEventData]):
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 - side note -- i didn't realize we have a seer module already - thoughts on this condition living there? that way it can be along-side the AnomalyDetection* definitions as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I can move the file in the other PR 👍

Comment on lines 57 to 61
type=Condition.ANOMALY_DETECTION,
comparison={
"sensitivity": AnomalyDetectionSensitivity.MEDIUM,
"seasonality": AnomalyDetectionSeasonality.AUTO,
"threshold_type": AnomalyDetectionThresholdType.ABOVE_AND_BELOW,
Copy link
Contributor

Choose a reason for hiding this comment

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

it'd be nice to separate this info out so we can show the simplest working verisons of this condition, then in tests for the AnomalyDetectionConditionHandler we can evaluate this case. that will also help reduce the number of dependencies in the test and increase the speed of each test evaluation 🎉

@ceorourke ceorourke force-pushed the ceorourke/update-evaluation-result-return branch from 86e8e40 to 5a47707 Compare June 2, 2025 20:54
@ceorourke ceorourke force-pushed the ceorourke/update-evaluation-result-return branch from 1df4ea9 to 3d2e062 Compare June 2, 2025 20:57
Copy link
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

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

🔥 looks great, thanks for doing all that cleanup.

@ceorourke ceorourke enabled auto-merge (squash) June 2, 2025 22:08
@ceorourke ceorourke merged commit da7e1d0 into master Jun 2, 2025
60 checks passed
@ceorourke ceorourke deleted the ceorourke/update-evaluation-result-return branch June 2, 2025 22:15
andrewshie-sentry pushed a commit that referenced this pull request Jun 3, 2025
An offshoot of #88647 to update
`evaluate_value` to handle when the handler returns a result that isn't
a boolean as we will for anomaly detection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants