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

[IndexAdapter] Extract index-adapter package from data-stream-adapter #199575

Merged
merged 15 commits into from
Nov 12, 2024

Conversation

semd
Copy link
Contributor

@semd semd commented Nov 9, 2024

Summary

Extracts IndexAdapter from DataStreamAdapter and IndexPatternAdapter from DataStreamSpaceAdapter.

There are no breaking changes for the data-stream-adapter package; the behavior of both the DataStreamAdapter and DataStreamSpaceAdapter remains unchanged.

The new index-adapter package exports IndexAdapter and IndexPatternAdapter to manage individual indices without using data streams.

This is needed for SIEM rule migrations.

@semd semd added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.18.0 labels Nov 9, 2024
@semd semd self-assigned this Nov 9, 2024
@semd semd marked this pull request as ready for review November 11, 2024 12:14
@semd semd requested a review from a team as a code owner November 11, 2024 12:14
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Comment on lines 19 to 20
const simulateIndexTemplateResponse = { template: { mappings: { is_managed: true } } };
// @ts-expect-error test data type mismatch
Copy link
Contributor

@kapral18 kapral18 Nov 12, 2024

Choose a reason for hiding this comment

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

Let me know if there is a specific reason behind the shape you use here, because the following makes both type check and tests pass:

Suggested change
const simulateIndexTemplateResponse = { template: { mappings: { is_managed: true } } };
// @ts-expect-error test data type mismatch
const simulateIndexTemplateResponse = {
template: {
settings: {},
aliases: {},
mappings: {},
},
};

Copy link
Contributor

@kapral18 kapral18 left a comment

Choose a reason for hiding this comment

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

LGTM

@semd
Copy link
Contributor Author

semd commented Nov 12, 2024

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #60 / spaces api with security get all rbac user with read at space_1 can access space_1 from default undefined purpose should return 200 when referencing the default space implicitly

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/data-stream-adapter 80 54 -26
@kbn/index-adapter - 80 +80
total +54

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/data-stream-adapter 1 0 -1
@kbn/index-adapter - 2 +2
total +1
Unknown metric groups

API count

id before after diff
@kbn/data-stream-adapter 80 55 -25
@kbn/index-adapter - 85 +85
total +60

ESLint disabled line counts

id before after diff
@kbn/data-stream-adapter 2 0 -2
@kbn/index-adapter - 2 +2
total -0

Total ESLint disabled count

id before after diff
@kbn/data-stream-adapter 2 0 -2
@kbn/index-adapter - 2 +2
total -0

History

cc @semd

@semd semd merged commit 9a9f02c into elastic:main Nov 12, 2024
39 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.x

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.18 The branch "8.18" does not exist
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- Upgrade EUI to v97.3.1 (#199186)
- [WIP] - Unskip threat hunting tests (#195662)

Manual backport

To create the backport manually run:

node scripts/backport --pr 199575

Questions ?

Please refer to the Backport tool documentation

@semd
Copy link
Contributor Author

semd commented Nov 12, 2024

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

semd added a commit to semd/kibana that referenced this pull request Nov 12, 2024
…elastic#199575)

## Summary

Extracts `IndexAdapter` from `DataStreamAdapter` and
`IndexPatternAdapter` from `DataStreamSpaceAdapter`.

There are no breaking changes for the _data-stream-adapter_ package; the
behavior of both the `DataStreamAdapter` and `DataStreamSpaceAdapter`
remains unchanged.

The new _index-adapter_ package exports `IndexAdapter` and
`IndexPatternAdapter` to manage individual indices without using data
streams.

This is needed for SIEM rule migrations.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 9a9f02c)

# Conflicts:
#	.github/CODEOWNERS
#	package.json
#	tsconfig.base.json
#	yarn.lock
semd added a commit that referenced this pull request Nov 12, 2024
…dapter (#199575) (#199848)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[IndexAdapter] Extract index-adapter package from data-stream-adapter
(#199575)](#199575)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Sergi
Massaneda","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-12T17:16:32Z","message":"[IndexAdapter]
Extract index-adapter package from data-stream-adapter (#199575)\n\n##
Summary\r\n\r\nExtracts `IndexAdapter` from `DataStreamAdapter`
and\r\n`IndexPatternAdapter` from `DataStreamSpaceAdapter`.\r\n\r\nThere
are no breaking changes for the _data-stream-adapter_ package;
the\r\nbehavior of both the `DataStreamAdapter` and
`DataStreamSpaceAdapter`\r\nremains unchanged.\r\n\r\nThe new
_index-adapter_ package exports `IndexAdapter`
and\r\n`IndexPatternAdapter` to manage individual indices without using
data\r\nstreams.\r\n\r\nThis is needed for SIEM rule
migrations.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"9a9f02c9315beda4089b1ef16089747c080bc345","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting","Team:
SecuritySolution","backport:prev-minor","v8.18.0"],"number":199575,"url":"https://github.com/elastic/kibana/pull/199575","mergeCommit":{"message":"[IndexAdapter]
Extract index-adapter package from data-stream-adapter (#199575)\n\n##
Summary\r\n\r\nExtracts `IndexAdapter` from `DataStreamAdapter`
and\r\n`IndexPatternAdapter` from `DataStreamSpaceAdapter`.\r\n\r\nThere
are no breaking changes for the _data-stream-adapter_ package;
the\r\nbehavior of both the `DataStreamAdapter` and
`DataStreamSpaceAdapter`\r\nremains unchanged.\r\n\r\nThe new
_index-adapter_ package exports `IndexAdapter`
and\r\n`IndexPatternAdapter` to manage individual indices without using
data\r\nstreams.\r\n\r\nThis is needed for SIEM rule
migrations.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"9a9f02c9315beda4089b1ef16089747c080bc345"}},"sourceBranch":"main","suggestedTargetBranches":["8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199575","number":199575,"mergeCommit":{"message":"[IndexAdapter]
Extract index-adapter package from data-stream-adapter (#199575)\n\n##
Summary\r\n\r\nExtracts `IndexAdapter` from `DataStreamAdapter`
and\r\n`IndexPatternAdapter` from `DataStreamSpaceAdapter`.\r\n\r\nThere
are no breaking changes for the _data-stream-adapter_ package;
the\r\nbehavior of both the `DataStreamAdapter` and
`DataStreamSpaceAdapter`\r\nremains unchanged.\r\n\r\nThe new
_index-adapter_ package exports `IndexAdapter`
and\r\n`IndexPatternAdapter` to manage individual indices without using
data\r\nstreams.\r\n\r\nThis is needed for SIEM rule
migrations.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"9a9f02c9315beda4089b1ef16089747c080bc345"}},{"branch":"8.18","label":"v8.18.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
tkajtoch pushed a commit to tkajtoch/kibana that referenced this pull request Nov 12, 2024
…elastic#199575)

## Summary

Extracts `IndexAdapter` from `DataStreamAdapter` and
`IndexPatternAdapter` from `DataStreamSpaceAdapter`.

There are no breaking changes for the _data-stream-adapter_ package; the
behavior of both the `DataStreamAdapter` and `DataStreamSpaceAdapter`
remains unchanged.

The new _index-adapter_ package exports `IndexAdapter` and
`IndexPatternAdapter` to manage individual indices without using data
streams.

This is needed for SIEM rule migrations.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…elastic#199575)

## Summary

Extracts `IndexAdapter` from `DataStreamAdapter` and
`IndexPatternAdapter` from `DataStreamSpaceAdapter`.

There are no breaking changes for the _data-stream-adapter_ package; the
behavior of both the `DataStreamAdapter` and `DataStreamSpaceAdapter`
remains unchanged.

The new _index-adapter_ package exports `IndexAdapter` and
`IndexPatternAdapter` to manage individual indices without using data
streams.

This is needed for SIEM rule migrations.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…elastic#199575)

## Summary

Extracts `IndexAdapter` from `DataStreamAdapter` and
`IndexPatternAdapter` from `DataStreamSpaceAdapter`.

There are no breaking changes for the _data-stream-adapter_ package; the
behavior of both the `DataStreamAdapter` and `DataStreamSpaceAdapter`
remains unchanged.

The new _index-adapter_ package exports `IndexAdapter` and
`IndexPatternAdapter` to manage individual indices without using data
streams.

This is needed for SIEM rule migrations.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
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) release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants