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

Fix refreshing index pattern fields does not include the scripted fields #6237

Merged

Conversation

Desvelao
Copy link
Member

@Desvelao Desvelao commented Dec 20, 2023

Description

This pull request fixes that refreshing the index pattern fields does not include the scripted fields.

Changes:

  • Replaced custom service logic for a similar one to the Dashboards
    Management/Index pattern of the platform
    • Use a more low level logic to update the index pattern fields taking
      in account the scripted fields
    • The SavedObjects.refreshIndexPattern now throws an error when
      something fails instead of return the error message
  • Removed the ability to define fields that are not fields from the
    indices that match the index pattern or scripted fields
  • Display a warning in the check fields or when refreshing the index
    pattern of the default configurated index pattern of the plugins

Issues Resolved

#3632

Evidence

image
image
image

Test

Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

UI

Test Chrome Firefox Safari
Ensuring a scripted field is added to the index pattern, run or force the alerts pattern check is run. The scripted field should not be lost (use Discover or Events tab to check it is there)
Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. The scripted field should not be lost (use Discover or Events tab to check it is there)
Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. Index data with new fields for the index pattern (you can use some category of sample data), then go to Events tab and open an alert that contain a new field. Then use the Reload button of the toast. The scripted field should not be lost (use Discover or Events tab to check it is there)

Details

⚫ Ensuring a scripted field is added to the index pattern, run or force the alerts pattern check is run. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. Index data with new fields for the index pattern (you can use some category of sample data), then go to Events tab and open an alert that contain a new field. Then use the Reload button of the toast. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

- Replaced custom service logic for a similar one to the Dashboards
  Management/Index pattern of the platform
- Removed the ability to define fields that are not fields from the
  indices that match the index pattern or scripted fields
@Desvelao Desvelao self-assigned this Dec 20, 2023
Desvelao and others added 4 commits December 20, 2023 15:18
- Use a more low level logic to update the index pattern fields taking
  in account the scripted fields
- The SavedObjects.refreshIndexPattern now throws an error when
  something fails instead of return the error message
- Display a warning in the check fields or when refreshing the index
  pattern of the default configurated index pattern of the plugins
@Desvelao Desvelao marked this pull request as ready for review December 21, 2023 12:55
@Desvelao Desvelao requested a review from a team as a code owner December 21, 2023 12:55
@JuanGarriuz JuanGarriuz self-requested a review December 22, 2023 12:00
@JuanGarriuz
Copy link
Member

JuanGarriuz commented Dec 22, 2023

Test

Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

UI

Test Chrome Firefox Safari
Ensuring a scripted field is added to the index pattern, run or force the alerts pattern check is run. The scripted field should not be lost (use Discover or Events tab to check it is there) 🟢
Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. The scripted field should not be lost (use Discover or Events tab to check it is there) 🟢
Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. Index data with new fields for the index pattern (you can use some category of sample data), then go to Events tab and open an alert that contain a new field. Then use the Reload button of the toast. The scripted field should not be lost (use Discover or Events tab to check it is there) 🟢

Details

🟢 Ensuring a scripted field is added to the index pattern, run or force the alerts pattern check is run. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - 🟢

image
image

Firefox - ⚫

Safari - ⚫

🟢 Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - 🟢

image
image

Firefox - ⚫

Safari - ⚫

🟢 Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. Index data with new fields for the index pattern (you can use some category of sample data), then go to Events tab and open an alert that contain a new field. Then use the Reload button of the toast. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

Copy link
Member

@JuanGarriuz JuanGarriuz left a comment

Choose a reason for hiding this comment

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

LGTM!!

Copy link
Contributor

github-actions bot commented Jan 2, 2024

Wazuh Core plugin code coverage (Jest) test % values
Statements 22.02% ( 176 / 799 )
Branches 19.55% ( 79 / 404 )
Functions 14.63% ( 36 / 246 )
Lines 22.23% ( 173 / 778 )

Copy link
Contributor

github-actions bot commented Jan 2, 2024

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.33% ( 171 / 224 )
Branches 57.57% ( 57 / 99 )
Functions 61.7% ( 29 / 47 )
Lines 76.33% ( 171 / 224 )

Copy link
Contributor

github-actions bot commented Jan 2, 2024

Main plugin code coverage (Jest) test % values
Statements 11.3% ( 3880 / 34311 )
Branches 7.51% ( 1704 / 22669 )
Functions 10.89% ( 893 / 8200 )
Lines 11.47% ( 3771 / 32849 )

@yenienserrano yenienserrano self-requested a review January 3, 2024 10:23
@yenienserrano
Copy link
Member

yenienserrano commented Jan 3, 2024

Test

Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

UI

Test Chrome Firefox Safari
Ensuring a scripted field is added to the index pattern, run or force the alerts pattern check is run. The scripted field should not be lost (use Discover or Events tab to check it is there) 🟢
Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. The scripted field should not be lost (use Discover or Events tab to check it is there) 🟢
Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. Index data with new fields for the index pattern (you can use some category of sample data), then go to Events tab and open an alert that contain a new field. Then use the Reload button of the toast. The scripted field should not be lost (use Discover or Events tab to check it is there) 🟢

Details

🟢 Ensuring a scripted field is added to the index pattern, run or force the alerts pattern check is run. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

🟢 Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - 🟢

image

image

Firefox - ⚫

Safari - ⚫

🟢 Ensuring a scripted field is added to the index pattern, use the index pattern selector to select the index pattern with the scripted field. Index data with new fields for the index pattern (you can use some category of sample data), then go to Events tab and open an alert that contain a new field. Then use the Reload button of the toast. The scripted field should not be lost (use Discover or Events tab to check it is there)

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

LGTM

@asteriscos asteriscos merged commit 5603760 into master Jan 3, 2024
4 checks passed
@asteriscos asteriscos deleted the fix/3632-refresh-index-pattern-fields-scripted-fields branch January 3, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scripted fields disappear when the app refreshes the index pattern fields
4 participants