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

[ML] Functional tests - cleanMlIndices without system index access #199653

Merged
merged 21 commits into from
Nov 22, 2024

Conversation

pheyos
Copy link
Member

@pheyos pheyos commented Nov 11, 2024

Summary

This PR updates the cleanMlIndices service method to no longer run with esDeleteAllIndices and thus no longer requires system index superuser privileges.

Details / other changes

  • Not all ML items can be cleaned up through APIs (e.g. notifications), so tests have been adjusted to deal with pre-existing data
  • Some cleanup steps had to be re-ordered
  • Basic license tests didn't need the cleanMlIndices in their before so it was removed there
  • Observability serverless tests can't use cleanMlIndices as the APIs for DFA are not available for that project type, so the cleanup is changed to cleanAnomalyDetection for the AD tests and the cleanMlIndices is removed from the AI assistant helpers as the existing cleanup there should be enough

@pheyos pheyos self-assigned this Nov 11, 2024
@pheyos pheyos added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.17.0 :ml labels Nov 14, 2024
@pheyos pheyos marked this pull request as ready for review November 14, 2024 16:25
@pheyos pheyos requested a review from a team as a code owner November 14, 2024 16:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@pheyos pheyos requested a review from a team as a code owner November 18, 2024 11:10
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Nov 18, 2024
@botelastic botelastic bot added the Team:Obs AI Assistant Observability AI Assistant label Nov 18, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 22, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 7fc96c9
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-199653-7fc96c95c23f

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #17 / Policy Advanced Settings section should expand and collapse section when button is clicked

Metrics [docs]

✅ unchanged

History

cc @pheyos

@pheyos pheyos merged commit 93dac54 into elastic:main Nov 22, 2024
26 checks passed
@pheyos pheyos deleted the ftr_clean_ml branch November 22, 2024 16:54
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 22, 2024
…lastic#199653)

## Summary

This PR updates the `cleanMlIndices` service method to no longer run
with `esDeleteAllIndices` and thus no longer requires system index
superuser privileges.

### Details / other changes

- Not all ML items can be cleaned up through APIs (e.g. notifications),
so tests have been adjusted to deal with pre-existing data
- Some cleanup steps had to be re-ordered
- Basic license tests didn't need the `cleanMlIndices` in their `before`
so it was removed there
- Observability serverless tests can't use `cleanMlIndices` as the APIs
for DFA are not available for that project type, so the cleanup is
changed to `cleanAnomalyDetection` for the AD tests and the
`cleanMlIndices` is removed from the AI assistant helpers as the
existing cleanup there should be enough

(cherry picked from commit 93dac54)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 22, 2024
…lastic#199653)

## Summary

This PR updates the `cleanMlIndices` service method to no longer run
with `esDeleteAllIndices` and thus no longer requires system index
superuser privileges.

### Details / other changes

- Not all ML items can be cleaned up through APIs (e.g. notifications),
so tests have been adjusted to deal with pre-existing data
- Some cleanup steps had to be re-ordered
- Basic license tests didn't need the `cleanMlIndices` in their `before`
so it was removed there
- Observability serverless tests can't use `cleanMlIndices` as the APIs
for DFA are not available for that project type, so the cleanup is
changed to `cleanAnomalyDetection` for the AD tests and the
`cleanMlIndices` is removed from the AI assistant helpers as the
existing cleanup there should be enough

(cherry picked from commit 93dac54)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.17
8.x

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 Nov 22, 2024
…cess (#199653) (#201434)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[ML] Functional tests - cleanMlIndices without system index access
(#199653)](#199653)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Robert
Oskamp","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-22T16:54:01Z","message":"[ML]
Functional tests - cleanMlIndices without system index access
(#199653)\n\n## Summary\r\n\r\nThis PR updates the `cleanMlIndices`
service method to no longer run\r\nwith `esDeleteAllIndices` and thus no
longer requires system index\r\nsuperuser privileges.\r\n\r\n### Details
/ other changes\r\n\r\n- Not all ML items can be cleaned up through APIs
(e.g. notifications),\r\nso tests have been adjusted to deal with
pre-existing data\r\n- Some cleanup steps had to be re-ordered\r\n-
Basic license tests didn't need the `cleanMlIndices` in their
`before`\r\nso it was removed there\r\n- Observability serverless tests
can't use `cleanMlIndices` as the APIs\r\nfor DFA are not available for
that project type, so the cleanup is\r\nchanged to
`cleanAnomalyDetection` for the AD tests and the\r\n`cleanMlIndices` is
removed from the AI assistant helpers as the\r\nexisting cleanup there
should be
enough","sha":"93dac5435ff51a3b28c5b3dd30bc4c24d1cf302c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","v9.0.0","backport:prev-minor","Team:Obs
AI Assistant","ci:project-deploy-observability","v8.17.0"],"title":"[ML]
Functional tests - cleanMlIndices without system index
access","number":199653,"url":"https://github.com/elastic/kibana/pull/199653","mergeCommit":{"message":"[ML]
Functional tests - cleanMlIndices without system index access
(#199653)\n\n## Summary\r\n\r\nThis PR updates the `cleanMlIndices`
service method to no longer run\r\nwith `esDeleteAllIndices` and thus no
longer requires system index\r\nsuperuser privileges.\r\n\r\n### Details
/ other changes\r\n\r\n- Not all ML items can be cleaned up through APIs
(e.g. notifications),\r\nso tests have been adjusted to deal with
pre-existing data\r\n- Some cleanup steps had to be re-ordered\r\n-
Basic license tests didn't need the `cleanMlIndices` in their
`before`\r\nso it was removed there\r\n- Observability serverless tests
can't use `cleanMlIndices` as the APIs\r\nfor DFA are not available for
that project type, so the cleanup is\r\nchanged to
`cleanAnomalyDetection` for the AD tests and the\r\n`cleanMlIndices` is
removed from the AI assistant helpers as the\r\nexisting cleanup there
should be
enough","sha":"93dac5435ff51a3b28c5b3dd30bc4c24d1cf302c"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199653","number":199653,"mergeCommit":{"message":"[ML]
Functional tests - cleanMlIndices without system index access
(#199653)\n\n## Summary\r\n\r\nThis PR updates the `cleanMlIndices`
service method to no longer run\r\nwith `esDeleteAllIndices` and thus no
longer requires system index\r\nsuperuser privileges.\r\n\r\n### Details
/ other changes\r\n\r\n- Not all ML items can be cleaned up through APIs
(e.g. notifications),\r\nso tests have been adjusted to deal with
pre-existing data\r\n- Some cleanup steps had to be re-ordered\r\n-
Basic license tests didn't need the `cleanMlIndices` in their
`before`\r\nso it was removed there\r\n- Observability serverless tests
can't use `cleanMlIndices` as the APIs\r\nfor DFA are not available for
that project type, so the cleanup is\r\nchanged to
`cleanAnomalyDetection` for the AD tests and the\r\n`cleanMlIndices` is
removed from the AI assistant helpers as the\r\nexisting cleanup there
should be
enough","sha":"93dac5435ff51a3b28c5b3dd30bc4c24d1cf302c"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Oskamp <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 22, 2024
…ess (#199653) (#201435)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] Functional tests - cleanMlIndices without system index access
(#199653)](#199653)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Robert
Oskamp","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-22T16:54:01Z","message":"[ML]
Functional tests - cleanMlIndices without system index access
(#199653)\n\n## Summary\r\n\r\nThis PR updates the `cleanMlIndices`
service method to no longer run\r\nwith `esDeleteAllIndices` and thus no
longer requires system index\r\nsuperuser privileges.\r\n\r\n### Details
/ other changes\r\n\r\n- Not all ML items can be cleaned up through APIs
(e.g. notifications),\r\nso tests have been adjusted to deal with
pre-existing data\r\n- Some cleanup steps had to be re-ordered\r\n-
Basic license tests didn't need the `cleanMlIndices` in their
`before`\r\nso it was removed there\r\n- Observability serverless tests
can't use `cleanMlIndices` as the APIs\r\nfor DFA are not available for
that project type, so the cleanup is\r\nchanged to
`cleanAnomalyDetection` for the AD tests and the\r\n`cleanMlIndices` is
removed from the AI assistant helpers as the\r\nexisting cleanup there
should be
enough","sha":"93dac5435ff51a3b28c5b3dd30bc4c24d1cf302c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","v9.0.0","backport:prev-minor","Team:Obs
AI Assistant","ci:project-deploy-observability","v8.17.0"],"title":"[ML]
Functional tests - cleanMlIndices without system index
access","number":199653,"url":"https://github.com/elastic/kibana/pull/199653","mergeCommit":{"message":"[ML]
Functional tests - cleanMlIndices without system index access
(#199653)\n\n## Summary\r\n\r\nThis PR updates the `cleanMlIndices`
service method to no longer run\r\nwith `esDeleteAllIndices` and thus no
longer requires system index\r\nsuperuser privileges.\r\n\r\n### Details
/ other changes\r\n\r\n- Not all ML items can be cleaned up through APIs
(e.g. notifications),\r\nso tests have been adjusted to deal with
pre-existing data\r\n- Some cleanup steps had to be re-ordered\r\n-
Basic license tests didn't need the `cleanMlIndices` in their
`before`\r\nso it was removed there\r\n- Observability serverless tests
can't use `cleanMlIndices` as the APIs\r\nfor DFA are not available for
that project type, so the cleanup is\r\nchanged to
`cleanAnomalyDetection` for the AD tests and the\r\n`cleanMlIndices` is
removed from the AI assistant helpers as the\r\nexisting cleanup there
should be
enough","sha":"93dac5435ff51a3b28c5b3dd30bc4c24d1cf302c"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199653","number":199653,"mergeCommit":{"message":"[ML]
Functional tests - cleanMlIndices without system index access
(#199653)\n\n## Summary\r\n\r\nThis PR updates the `cleanMlIndices`
service method to no longer run\r\nwith `esDeleteAllIndices` and thus no
longer requires system index\r\nsuperuser privileges.\r\n\r\n### Details
/ other changes\r\n\r\n- Not all ML items can be cleaned up through APIs
(e.g. notifications),\r\nso tests have been adjusted to deal with
pre-existing data\r\n- Some cleanup steps had to be re-ordered\r\n-
Basic license tests didn't need the `cleanMlIndices` in their
`before`\r\nso it was removed there\r\n- Observability serverless tests
can't use `cleanMlIndices` as the APIs\r\nfor DFA are not available for
that project type, so the cleanup is\r\nchanged to
`cleanAnomalyDetection` for the AD tests and the\r\n`cleanMlIndices` is
removed from the AI assistant helpers as the\r\nexisting cleanup there
should be
enough","sha":"93dac5435ff51a3b28c5b3dd30bc4c24d1cf302c"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Oskamp <[email protected]>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…lastic#199653)

## Summary

This PR updates the `cleanMlIndices` service method to no longer run
with `esDeleteAllIndices` and thus no longer requires system index
superuser privileges.

### Details / other changes

- Not all ML items can be cleaned up through APIs (e.g. notifications),
so tests have been adjusted to deal with pre-existing data
- Some cleanup steps had to be re-ordered
- Basic license tests didn't need the `cleanMlIndices` in their `before`
so it was removed there
- Observability serverless tests can't use `cleanMlIndices` as the APIs
for DFA are not available for that project type, so the cleanup is
changed to `cleanAnomalyDetection` for the AD tests and the
`cleanMlIndices` is removed from the AI assistant helpers as the
existing cleanup there should be enough
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…lastic#199653)

## Summary

This PR updates the `cleanMlIndices` service method to no longer run
with `esDeleteAllIndices` and thus no longer requires system index
superuser privileges.

### Details / other changes

- Not all ML items can be cleaned up through APIs (e.g. notifications),
so tests have been adjusted to deal with pre-existing data
- Some cleanup steps had to be re-ordered
- Basic license tests didn't need the `cleanMlIndices` in their `before`
so it was removed there
- Observability serverless tests can't use `cleanMlIndices` as the APIs
for DFA are not available for that project type, so the cleanup is
changed to `cleanAnomalyDetection` for the AD tests and the
`cleanMlIndices` is removed from the AI assistant helpers as the
existing cleanup there should be enough
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project :ml release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Observability AI Assistant v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants