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

Only log deprecation warnings for calls to Saved Objects routes from non-kibana request #152971

Merged

Conversation

TinaHeiligers
Copy link
Contributor

@TinaHeiligers TinaHeiligers commented Mar 8, 2023

follow up to #150775

The logs are generated every time a deprecated route is called and we have extensive use of these routes throughout Kibana.

Since customers can't do anything about the Kibana UI using the saved objects client, logging these warnings so many times may lead to turning off logging completely.

This PR improves that, only logging when a request is external to Kibana.

Risk Matrix

Risk Probability Severity Mitigation/Notes
3rd party plugin developers may miss the warning and fail to migrate off of the API's before they're removed, causing their plugin to break. Low Low 3rd party developers should rely on typescript to catch the deprecations and take action appropriately.

@TinaHeiligers TinaHeiligers added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Saved Objects v8.8.0 labels Mar 8, 2023
@TinaHeiligers TinaHeiligers added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Mar 9, 2023
@TinaHeiligers TinaHeiligers marked this pull request as ready for review March 9, 2023 01:03
@TinaHeiligers TinaHeiligers requested a review from a team as a code owner March 9, 2023 01:03
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@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.

LGTM

@@ -152,3 +153,27 @@ export interface BulkGetItem {
fields?: string[];
namespaces?: string[];
}

export function getIsKibanaRequest({ headers }: KibanaRequest) {
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: getIsKibanaRequest -> isKibanaRequest

@TinaHeiligers TinaHeiligers enabled auto-merge (squash) March 9, 2023 16:19
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 431 433 +2

Total ESLint disabled count

id before after diff
securitySolution 508 510 +2

History

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

@TinaHeiligers TinaHeiligers merged commit e37e834 into elastic:main Mar 9, 2023
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.7 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 152971

Questions ?

Please refer to the Backport tool documentation

@TinaHeiligers
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.7

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

Questions ?

Please refer to the Backport tool documentation

TinaHeiligers added a commit to TinaHeiligers/kibana that referenced this pull request Mar 9, 2023
…non-kibana request (elastic#152971)

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit e37e834)

# Conflicts:
#	packages/core/saved-objects/core-saved-objects-server-internal/src/routes/index.ts
#	packages/core/saved-objects/core-saved-objects-server-internal/src/routes/utils.ts
#	packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json
TinaHeiligers added a commit that referenced this pull request Mar 9, 2023
… from non-kibana request (#152971) (#153053)

# Backport

This will backport the following commits from `main` to `8.7`:
- [Only log deprecation warnings for calls to Saved Objects routes from
non-kibana request
(#152971)](#152971)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Christiane (Tina)
Heiligers","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-03-09T17:23:21Z","message":"Only
log deprecation warnings for calls to Saved Objects routes from
non-kibana request (#152971)\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"e37e83428abe9bb8971419672969bcaa9db9918e","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","Feature:Saved
Objects","release_note:skip","backport:prev-minor","v8.8.0"],"number":152971,"url":"https://github.com/elastic/kibana/pull/152971","mergeCommit":{"message":"Only
log deprecation warnings for calls to Saved Objects routes from
non-kibana request (#152971)\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"e37e83428abe9bb8971419672969bcaa9db9918e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/152971","number":152971,"mergeCommit":{"message":"Only
log deprecation warnings for calls to Saved Objects routes from
non-kibana request (#152971)\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"e37e83428abe9bb8971419672969bcaa9db9918e"}}]}]
BACKPORT-->
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
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) Feature:Saved Objects 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.7.0 v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants