Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: condition value match null#9448

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
uddhavdave merged 1 commit intobranch-v0.20.0fromud/fix-conditions-pipeline
Dec 2, 2025

Conversation

@uddhavdave
Copy link
Contributor

@uddhavdaveuddhavdave commentedDec 2, 2025
edited
Loading

fixes#9443

greptile-apps[bot] reacted with thumbs up emoji
@github-actions
Copy link
Contributor

Failed to generate code suggestions for PR

@github-actionsgithub-actionsbot added the ☢️ BugSomething isn't working labelDec 2, 2025
@greptile-apps
Copy link
Contributor

Greptile Overview

Greptile Summary

Adds support for matching null values in alert conditions and trims quotes from condition values during string comparisons.

Key Changes:

  • String comparison now trims surrounding quotes from the condition value using.trim_matches('"'), allowing conditions like"null" to match correctly
  • NewValue::Null arm handles JSON null values by checking if operator isEqualTo and condition value is the string"null"

Issues Found:

  • Critical ambiguity: Both the string literal"null" and actual JSONnull values will match the conditioncolumn = "null", making it impossible to distinguish between them
  • TheNotEqualTo operator only returns false for null handling (by falling through to default), but this might be confusing - worth documenting this behavior

Confidence Score: 3/5

  • Functional fix with logical ambiguity that could cause unexpected behavior in production
  • The PR successfully adds null value matching capability, but introduces semantic ambiguity where string "null" and JSON null values cannot be distinguished. This could lead to false positives in alerts when data contains the literal string "null". The changes are focused and minimal, but the logic issue is significant enough to require attention before merging.
  • src/service/alerts/mod.rs requires careful testing to verify null matching behavior and ensure the ambiguity between string "null" and JSON null is acceptable for the use case

Important Files Changed

File Analysis

FilenameScoreOverview
src/service/alerts/mod.rs3/5Added null value matching support and quote trimming for string comparisons. Has ambiguity issue where string "null" and JSON null both match the same condition.

Sequence Diagram

sequenceDiagram    participant Alert as Alert System    participant Condition as Condition.evaluate()    participant Row as JSON Row Data        Alert->>Condition: evaluate(row)    Condition->>Row: get(column)        alt Column exists        Row-->>Condition: Some(value)                alt value is String            Condition->>Condition: trim quotes from condition value            Condition->>Condition: compare string values            Condition-->>Alert: boolean result        else value is Number            Condition->>Condition: parse/convert to f64            Condition->>Condition: compare numeric values            Condition-->>Alert: boolean result        else value is Bool            Condition->>Condition: parse/convert to bool            Condition->>Condition: compare boolean values            Condition-->>Alert: boolean result        else value is Null            Condition->>Condition: check operator = EqualTo            Condition->>Condition: check condition value = "null"            Condition-->>Alert: true if both match, false otherwise        else other type            Condition-->>Alert: false        end    else Column missing        Row-->>Condition: None        Condition-->>Alert: false    end
Loading

Copy link
Contributor

@greptile-appsgreptile-appsbot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings |Greptile

@uddhavdaveuddhavdave merged commit0dce003 intobranch-v0.20.0Dec 2, 2025
34 of 35 checks passed
@uddhavdaveuddhavdave deleted the ud/fix-conditions-pipeline branchDecember 2, 2025 18:22
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Loaki07Loaki07Loaki07 approved these changes

@hengfeiyanghengfeiyangAwaiting requested review from hengfeiyang

@oasiskoasiskAwaiting requested review from oasisk

+1 more reviewer

@greptile-appsgreptile-apps[bot]greptile-apps[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

☢️ BugSomething isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@uddhavdave@Loaki07

[8]ページ先頭

©2009-2025 Movatter.jp