-
Notifications
You must be signed in to change notification settings - Fork 715
fix: dashboard ensure case-insensitive comparison for stream field validation for camelCase #8424
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Greptile Summary
This PR addresses a case sensitivity issue in dashboard field validation by implementing case-insensitive comparison for stream field names. The change modifies the validateCustomQueryFields function in web/src/utils/dashboard/convertDataIntoUnitValue.ts to use toLowerCase() comparison when validating X-axis fields against the available stream fields.
The core problem being solved is when dashboard panels have field names configured with different casing than what exists in the actual stream schema (e.g., 'fieldName' vs 'fieldname'). This mismatch would previously cause validation errors even when the fields were semantically the same. The case-insensitive comparison allows the validation to be more flexible and accommodating of these naming variations.
The change specifically updates the X-axis field validation logic from i.name == it.column to i.name.toLowerCase() == it.column.toLowerCase(), which enables matching regardless of case differences. This fits into the broader dashboard validation system that ensures panel configurations reference valid fields from the underlying data streams.
Confidence score: 2/5
- This PR introduces an inconsistency that will likely cause confusion and potential bugs in production
- Score reflects the incomplete implementation where only X-axis validation uses case-insensitive comparison while Y-axis validation remains case-sensitive
- Pay close attention to the Y-axis validation logic on line 1218 which still uses case-sensitive comparison
1 file reviewed, 1 comment
96e845e to
155746d
Compare
5f47344 to
fc2535d
Compare
fc2535d to
fd7ba69
Compare
…lidation for camelCase (#8424) ### **PR Type** Bug fix ___ ### **Description** - Make stream field validation case-insensitive - Prevent false errors for camelCase vs snake_case ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Query field names"] -- "toLowerCase()" --> B["Normalized names"] C["Available stream fields"] -- "toLowerCase()" --> D["Normalized fields"] B -- "compare" --> D E["Errors array"] -- "only push if unmatched" --> F["Accurate validation"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>convertDataIntoUnitValue.ts</strong><dd><code>Case-insensitive comparison for stream field validation</code> </dd></summary> <hr> web/src/utils/dashboard/convertDataIntoUnitValue.ts <ul><li>Compare field names using toLowerCase().<br> <li> Avoid mismatch when cases differ (e.g., camelCase).<br> <li> Update filter predicate for custom X field errors.</ul> </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/8424/files#diff-14c6fe442ef231566ec411f9e0262cdd24ec912fc67b9154eec743282ab7211a">+4/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ --------- Co-authored-by: ktx-akshay <[email protected]>
…lidation for camelCase (#8424) ### **PR Type** Bug fix ___ ### **Description** - Make stream field validation case-insensitive - Prevent false errors for camelCase vs snake_case ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Query field names"] -- "toLowerCase()" --> B["Normalized names"] C["Available stream fields"] -- "toLowerCase()" --> D["Normalized fields"] B -- "compare" --> D E["Errors array"] -- "only push if unmatched" --> F["Accurate validation"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>convertDataIntoUnitValue.ts</strong><dd><code>Case-insensitive comparison for stream field validation</code> </dd></summary> <hr> web/src/utils/dashboard/convertDataIntoUnitValue.ts <ul><li>Compare field names using toLowerCase().<br> <li> Avoid mismatch when cases differ (e.g., camelCase).<br> <li> Update filter predicate for custom X field errors.</ul> </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/8424/files#diff-14c6fe442ef231566ec411f9e0262cdd24ec912fc67b9154eec743282ab7211a">+4/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ --------- Co-authored-by: ktx-akshay <[email protected]>
…lidation for camelCase (#8424) (#8428) …lidation for camelCase (#8424) ### **PR Type** Bug fix ___ ### **Description** - Make stream field validation case-insensitive - Prevent false errors for camelCase vs snake_case ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Query field names"] -- "toLowerCase()" --> B["Normalized names"] C["Available stream fields"] -- "toLowerCase()" --> D["Normalized fields"] B -- "compare" --> D E["Errors array"] -- "only push if unmatched" --> F["Accurate validation"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>convertDataIntoUnitValue.ts</strong><dd><code>Case-insensitive comparison for stream field validation</code> </dd></summary> <hr> web/src/utils/dashboard/convertDataIntoUnitValue.ts <ul><li>Compare field names using toLowerCase().<br> <li> Avoid mismatch when cases differ (e.g., camelCase).<br> <li> Update filter predicate for custom X field errors.</ul> </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/8424/files#diff-14c6fe442ef231566ec411f9e0262cdd24ec912fc67b9154eec743282ab7211a">+4/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ --------- Co-authored-by: ktx-akshay <[email protected]>
…lidation for camelCase (#8424) (#8429) ### **PR Type** Bug fix ___ ### **Description** - Make stream field validation case-insensitive - Prevent false errors for camelCase vs snake_case ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Query field names"] -- "toLowerCase()" --> B["Normalized names"] C["Available stream fields"] -- "toLowerCase()" --> D["Normalized fields"] B -- "compare" --> D E["Errors array"] -- "only push if unmatched" --> F["Accurate validation"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>convertDataIntoUnitValue.ts</strong><dd><code>Case-insensitive comparison for stream field validation</code> </dd></summary> <hr> web/src/utils/dashboard/convertDataIntoUnitValue.ts <ul><li>Compare field names using toLowerCase().<br> <li> Avoid mismatch when cases differ (e.g., camelCase).<br> <li> Update filter predicate for custom X field errors.</ul> </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/8424/files#diff-14c6fe442ef231566ec411f9e0262cdd24ec912fc67b9154eec743282ab7211a">+4/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ --------- Co-authored-by: ktx-akshay <[email protected]>
…lidation for camelCase (#8424) (#8428) …lidation for camelCase (#8424) ### **PR Type** Bug fix ___ ### **Description** - Make stream field validation case-insensitive - Prevent false errors for camelCase vs snake_case ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Query field names"] -- "toLowerCase()" --> B["Normalized names"] C["Available stream fields"] -- "toLowerCase()" --> D["Normalized fields"] B -- "compare" --> D E["Errors array"] -- "only push if unmatched" --> F["Accurate validation"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>convertDataIntoUnitValue.ts</strong><dd><code>Case-insensitive comparison for stream field validation</code> </dd></summary> <hr> web/src/utils/dashboard/convertDataIntoUnitValue.ts <ul><li>Compare field names using toLowerCase().<br> <li> Avoid mismatch when cases differ (e.g., camelCase).<br> <li> Update filter predicate for custom X field errors.</ul> </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/8424/files#diff-14c6fe442ef231566ec411f9e0262cdd24ec912fc67b9154eec743282ab7211a">+4/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ --------- Co-authored-by: ktx-akshay <[email protected]>
PR Type
Bug fix
Description
Make stream field validation case-insensitive
Prevent false errors for camelCase vs snake_case
Diagram Walkthrough
File Walkthrough
convertDataIntoUnitValue.ts
Case-insensitive comparison for stream field validationweb/src/utils/dashboard/convertDataIntoUnitValue.ts