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

SavedObjectsRepository code cleanup (bis) #157363

Merged
merged 7 commits into from
May 12, 2023

Conversation

pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented May 11, 2023

Summary

Follow-up of #157154

Continue the cleanup started in the previous PR, by moving more things around.

  • Move everything search-related (dsl, aggregations, kql utils) to a dedicated search folder
  • Move a few more things to /apis/internals
  • Remove the 'v5' field compatibility in the field list generation (see comment)
  • Cleanup some files a bit.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 400 404 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 480 484 +4
total +6

History

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

@pgayvallet pgayvallet added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes v8.9.0 labels May 11, 2023
Copy link
Contributor Author

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

self-review

Comment on lines -50 to -51
// BEWARE: The SavedObjectClient depends on the implementation details of the SavedObjectsRepository
// so any breaking changes to this repository are considered breaking changes to the SavedObjectsClient.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NIT: removed those comments because they didn't really bring any value (and the original comment from the repository file was removed in the previous PR)

Comment on lines -48 to -51
return [...acc, ...sourceFields.map((f) => `${t}.${f}`)];
acc.push(...sourceFields.map((f) => `${t}.${f}`));
return acc;
}, [])
.concat(ROOT_FIELDS)
.concat(fields); // v5 compatibility
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is the only behavioral change from the PR: I removed the 'v5' compatibility from the time the type fields were at the top level. (this should have been removed years ago...)

@@ -3792,7 +3792,6 @@ describe('SavedObjectsRepository', () => {
'updated_at',
'created_at',
'originId',
'title',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See previous comment (on the v5 field compat) for the reason of this test change

Copy link
Contributor Author

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

self-review

@pgayvallet pgayvallet marked this pull request as ready for review May 12, 2023 08:32
@pgayvallet pgayvallet requested a review from a team as a code owner May 12, 2023 08:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@pgayvallet pgayvallet merged commit 8911bfa into elastic:main May 12, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 12, 2023
jasonrhodes pushed a commit that referenced this pull request May 17, 2023
## Summary

Follow-up of #157154

Continue the cleanup started in the previous PR, by moving more things
around.

- Move everything search-related (dsl, aggregations, kql utils) to a
dedicated `search` folder
- Move a few more things to `/apis/internals`
- Remove the 'v5' field compatibility in the field list generation (see
comment)
- Cleanup some files a bit.

---------

Co-authored-by: kibanamachine <[email protected]>
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:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants