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

[Fleet] parse elasticsearch.source_mode from manifest + small refactor #144464

Merged
merged 2 commits into from
Nov 3, 2022

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Nov 2, 2022

Summary

Part of #141211.

Add source_mode to the elasticsearch fields we parse out of the package manifest. I noticed an opportunity to break out some small unit tests while I was in the code as well.

@hop-dev hop-dev added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.6.0 labels Nov 2, 2022
@hop-dev hop-dev self-assigned this Nov 2, 2022
@hop-dev hop-dev requested a review from a team as a code owner November 2, 2022 17:24
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

parsedElasticsearchEntry.privileges = elasticsearch.privileges;
}

if (elasticsearch?.source_mode) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Source mode can only be one of two values, not sure if we should be validating here? We only seem to do high level validation

@@ -351,6 +351,7 @@ export interface RegistryElasticsearch {
'index_template.settings'?: estypes.IndicesIndexSettings;
'index_template.mappings'?: estypes.MappingTypeMapping;
'ingest_pipeline.name'?: string;
Copy link
Member

Choose a reason for hiding this comment

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

I am curious about the usage of this key, it looks like to me that is not used anywhere

Copy link
Contributor Author

@hop-dev hop-dev Nov 3, 2022

Choose a reason for hiding this comment

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

@nchaulet do you mean ingest_pipeline.name? It was added as part of this PR to make our logic the same as registry info:

https://github.com/elastic/kibana/pull/126915/files

It was added to the registry 2 years ago here elastic/package-registry#564 , I am not sure it was ever implemented in Kibana (until we implemented it in the above PR to make sure we match the registry) but I am nervous to delete it :D Should I just go for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nchaulet turns out the system package uses this functionality

@hop-dev hop-dev force-pushed the support-source_mode branch from a59d59c to c0c6c7a Compare November 3, 2022 15:44
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

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
fleet 897 898 +1
Unknown metric groups

API count

id before after diff
fleet 1000 1001 +1

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 58 64 +6
osquery 106 111 +5
securitySolution 440 446 +6
total +19

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 66 72 +6
osquery 107 113 +6
securitySolution 517 523 +6
total +20

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @hop-dev

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@hop-dev hop-dev merged commit 11dc1a8 into elastic:main Nov 3, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 3, 2022
@hop-dev hop-dev deleted the support-source_mode branch November 3, 2022 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants