Skip to content

Query rules create mode#223613

Merged
efegurkan merged 7 commits intoelastic:mainfrom
efegurkan:query-rules-create-mode
Jun 18, 2025
Merged

Query rules create mode#223613
efegurkan merged 7 commits intoelastic:mainfrom
efegurkan:query-rules-create-mode

Conversation

@efegurkan
Copy link
Member

@efegurkan efegurkan commented Jun 12, 2025

Summary

Updates create flow and fixes some bugs.

Screen.Recording.2025-06-16.at.22.44.46.mov

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

Add a ruleset exist check endpoint.
Add a utility function to check common permissions in routes.
Add a new hook for query rule check.
Add new route for create mode in Ruleset Detail page.
Modify the Query Rule creation modal to give navigation option to the
user when ruleset already exists.
Add tests for hook and utility function.
@efegurkan efegurkan added ci:cloud-deploy Create or update a Cloud deployment release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Jun 12, 2025
@efegurkan efegurkan force-pushed the query-rules-create-mode branch 3 times, most recently from 3308f12 to 4a61c42 Compare June 14, 2025 12:55
@kibanamachine
Copy link
Contributor

Cloud deployment initiated, see credentials at: https://buildkite.com/elastic/kibana-deploy-cloud-from-pr/builds/243

@efegurkan efegurkan force-pushed the query-rules-create-mode branch from 4a61c42 to c7031bd Compare June 15, 2025 13:41
@efegurkan efegurkan marked this pull request as ready for review June 16, 2025 20:47
@efegurkan efegurkan requested a review from a team as a code owner June 16, 2025 20:47
@efegurkan
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@Samiul-TheSoccerFan Samiul-TheSoccerFan left a comment

Choose a reason for hiding this comment

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

Mostly look good, left some small comments. This is a large PR to review at once. I will do another round of review tomorrow.

Copy link
Member

@sphilipse sphilipse left a comment

Choose a reason for hiding this comment

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

two nitpicks but looks good overall

<EuiText size="s">
<EuiBadge>{criteria.metadata}</EuiBadge>&nbsp;
<EuiTextColor color={euiTheme.colors.textPrimary}>{criteria.type}</EuiTextColor>&nbsp;
{criteria.metadata && (
Copy link
Member

Choose a reason for hiding this comment

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

this should be Boolean(criteria.metadata) or it'll show the metadata inline with eh...more metadata

response.forbidden({
body: i18n.translate('xpack.search.queryRules.api.routes.permissionError', {
defaultMessage:
"Your user doesn't have manage_search_query_rules privilegesUser does not have the required privileges to access this resource",
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: this error message should probably lose everything from 'User' onwards

@efegurkan efegurkan force-pushed the query-rules-create-mode branch from d251120 to de456f1 Compare June 18, 2025 11:26
@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 18, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #75 / console app misc console behavior keyboard shortcuts should execute the request when Ctrl+Enter is pressed

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
searchQueryRules 133 140 +7

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
searchQueryRules 107.0KB 110.8KB +3.8KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
searchQueryRules 5.6KB 5.7KB +87.0B

History

Copy link
Contributor

@Samiul-TheSoccerFan Samiul-TheSoccerFan left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the explanations.

@efegurkan efegurkan merged commit 32e3374 into elastic:main Jun 18, 2025
11 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15736934691

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Query Rules UI] Query rules flyout document selector. (#222541)

Manual backport

To create the backport manually run:

node scripts/backport --pr 223613

Questions ?

Please refer to the Backport tool documentation

});

return (
<EuiPanel hasShadow={false} hasBorder={false} paddingSize="l">
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use a panel here vs EuiEmptyPrompt

</>
)}
{criteria.type === 'always' ? (
<EuiBadge> {criteria.type}</EuiBadge>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the extra space at the beginning intentional here? What about this one not having a &nbsp; after the badge like the other cases here?

@efegurkan efegurkan removed the backport:version Backport to applied version labels label Jun 18, 2025
@efegurkan efegurkan added the backport:version Backport to applied version labels label Jun 18, 2025
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15741516701

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 18, 2025
## Summary

Updates create flow and fixes some bugs.

https://github.com/user-attachments/assets/b3525b50-df3f-42b5-9ede-13df53bd7bfb

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 32e3374)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 18, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [Query rules create mode
(#223613)](#223613)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Efe Gürkan
YALAMAN","email":"efeguerkan.yalaman@elastic.co"},"sourceCommit":{"committedDate":"2025-06-18T15:21:32Z","message":"Query
rules create mode (#223613)\n\n## Summary\n\nUpdates create flow and
fixes some
bugs.\n\n\nhttps://github.com/user-attachments/assets/b3525b50-df3f-42b5-9ede-13df53bd7bfb\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"32e337401350aa1c34a30ceacc92b642d64312dc","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","ci:cloud-deploy","backport:version","v9.1.0","v8.19.0"],"title":"Query
rules create
mode","number":223613,"url":"https://github.com/elastic/kibana/pull/223613","mergeCommit":{"message":"Query
rules create mode (#223613)\n\n## Summary\n\nUpdates create flow and
fixes some
bugs.\n\n\nhttps://github.com/user-attachments/assets/b3525b50-df3f-42b5-9ede-13df53bd7bfb\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"32e337401350aa1c34a30ceacc92b642d64312dc"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223613","number":223613,"mergeCommit":{"message":"Query
rules create mode (#223613)\n\n## Summary\n\nUpdates create flow and
fixes some
bugs.\n\n\nhttps://github.com/user-attachments/assets/b3525b50-df3f-42b5-9ede-13df53bd7bfb\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"32e337401350aa1c34a30ceacc92b642d64312dc"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Efe Gürkan YALAMAN <efeguerkan.yalaman@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels ci:cloud-deploy Create or update a Cloud deployment release_note:skip Skip the PR/issue when compiling release notes v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants