Skip to content
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

[BUG] ES query rule boundary field changed when editing the rule #163959

Closed
XavierM opened this issue Aug 15, 2023 · 4 comments · Fixed by #165155
Closed

[BUG] ES query rule boundary field changed when editing the rule #163959

XavierM opened this issue Aug 15, 2023 · 4 comments · Fixed by #165155
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Alerting/RulesManagement Issues related to the Rules Management UX Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@XavierM
Copy link
Contributor

XavierM commented Aug 15, 2023

In ES query rule when a boundary field is set up at the creation of the rule. Then, each time that you edit the rule, the boundary field get re-set to another value.

Step to reproduce

1. Create source data and data view:
PUT my-geo-test
{"mappings":{"properties":{"location1":{"type":"geo_point"},"location2":{"type":"geo_shape"}}}}
POST my-geo-test/_doc/
{
  "@timestamp": "2023-08-14T05:00:00.000Z",
  "location1": {
    "type": "Point",
    "coordinates": [
      -71.34,
      41.12
    ]
  },
  "location2": {
    "type": "LineString",
    "coordinates": [
      [
        -77.03653,
        30.897676
      ],
      [
        -77.009051,
        30.889939
      ]
    ]
  },
  "field1": "Wonderland",
  "field2": "The Shire",
  "field3": "Neverland",
  "field4": "Fresno",
  "other1": true,
  "other2": "abc123"
}
POST kbn:/api/saved_objects/index-pattern/my-geo-test*
{"attributes":{"fieldAttrs":"{}","title":"my-geo-test*","timeFieldName":"@timestamp","sourceFilters":"[]","fields":"[]","fieldFormatMap":"{}","typeMeta":"{}","runtimeFieldMap":"{}","name":"my-geo-test*"}}
2. Create a tracking containment rule in the UI and select field4 as the human readable boundary field

image

3. Edit the rule and observe the Boundary field selection changes to field1

image

The field change does not take effect unless you actually click SAVE, but this can result in accidental misconfigurations.

Originally posted by @rseldner in https://github.com/elastic/sdh-kibana/issues/4012#issuecomment-1678260324

@botelastic botelastic bot added the needs-team Issues missing a team label label Aug 15, 2023
@XavierM XavierM added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Aug 15, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Aug 15, 2023
@XavierM XavierM added Feature:Alerting/RulesManagement Issues related to the Rules Management UX bug Fixes for quality problems that affect the customer experience v8.8.0 labels Aug 15, 2023
@XavierM XavierM changed the title [BUG] [BUG] ES query rule boundary field changed when editing the rule Aug 15, 2023
@XavierM XavierM moved this from Awaiting Triage to Todo in AppEx: ResponseOps - Rules & Alerts Management Aug 22, 2023
@guskovaue guskovaue moved this from In Progress to In Review in AppEx: ResponseOps - Rules & Alerts Management Aug 28, 2023
@guskovaue
Copy link
Contributor

Agreed that gis team continue with refactoring, since they have bigger knowledge of the code and issues with it.

@nreese nreese added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas label Aug 29, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nreese nreese reopened this Aug 29, 2023
@nreese nreese moved this from Done to In Progress in AppEx: ResponseOps - Rules & Alerts Management Aug 29, 2023
@nreese nreese self-assigned this Aug 29, 2023
@nreese nreese removed the v8.8.0 label Aug 29, 2023
@nreese
Copy link
Contributor

nreese commented Aug 29, 2023

Problem is larger than just BoundaryIndexExpression. EntityIndexExpression also does the same thing and resets entity geo field and entity date field on page load.

nreese added a commit that referenced this issue Sep 6, 2023
…g the rule (#165155)

Fixes #163959

While digging into the original issue, it was determined that the
existing components were unsalvageable. Fixing all of the issues would
have required more work than just starting over. Problems with original
components include:
1) updating rule state on component load. This is the cause of the
reported bug.
2) lack of loading state when performing async tasks, like loading data
views.
3) not displaying validation errors. When users clicked "save" with
missing configuration, no UI notifications were displayed
4) Heavy use of EuiExpression made it impossible to view all
configuration in a single time

Now, geo containment form:
1) Only updates rule state when users interact with inputs.
2) Displays loading state when performing async tasks, like loading data
views.
3) Displays validation errors
4) Has a simpler UI that allows users to see all configuration
information at the same time.

<img width="300" alt="Screen Shot 2023-08-30 at 5 34 00 PM"
src="https://github.com/elastic/kibana/assets/373691/65abfa5d-6c8e-45a9-b69f-cc07f5be7184">

<img width="300" alt="Screen Shot 2023-08-30 at 5 34 48 PM"
src="https://github.com/elastic/kibana/assets/373691/63b5af12-7104-43ae-a836-0236cf9d1e98">

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Alerting/RulesManagement Issues related to the Rules Management UX Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
No open projects
4 participants