fix(preprod): Align relative_diff extract_value with frontend percentage convention#111682
Merged
Merged
Conversation
…age convention extract_value returned a ratio (0.05 for 5%) while the frontend stores percentage-scale values (5.0 for 5%), so the condition check was always false and relative_diff monitors never triggered. Multiply by 100 to match the frontend convention and align with VCS status checks. Refs LINEAR-EME-985 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mtopo27
commented
Mar 26, 2026
Contributor
Author
|
Frontend reference — this is where the percentage value is saved without dividing by 100:
comparison: isPercentage
? parseFloat(data.highThreshold) // user types "5", stores 5.0 (not 0.05)Backend reference — VCS status checks already use percentage-scale correctly:
percent_diff = (diff / base_value) * 100
return percent_diff > rule.valueThis fix aligns monitors with that same convention. |
NicoHinderling
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extract_valueforrelative_diffmonitors returned a ratio (e.g.0.05for a 5% increase), but the frontend stores percentage-scale values (e.g.5.0). The conditionoperator.gt(0.05, 5.0)was always false, so relative_diff monitors created through the UI never fired.This multiplies by 100 in
extract_valueso both sides use percentage-scale values, consistent with how VCS status checks already compute diffs. Tests updated to match.Feature is
released = Falseso no production impact.refs EME-985