Skip to content

[8.x] Changes deprecated SO HTTP APIs deprecation field to object (#197936)#201154

Merged
jloleysens merged 3 commits intoelastic:8.xfrom
jloleysens:backport/8.x/pr-197936
Nov 21, 2024
Merged

[8.x] Changes deprecated SO HTTP APIs deprecation field to object (#197936)#201154
jloleysens merged 3 commits intoelastic:8.xfrom
jloleysens:backport/8.x/pr-197936

Conversation

@jloleysens
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…197936)

fix elastic#197721.

The route deprecation field changed from a boolean to an object, where
the object contains information that is used in deprecation issues that
the Upgrade Assistant shows.

This PR makes the necessary changes in the deprecated Saved Objects HTTP
APIs.

This PR also includes a release notes entry for the API deprecations
that was missing.
![Screenshot 2024-10-29 at 12 01
29](https://github.com/user-attachments/assets/5c47c697-fbae-4b2e-8c6c-cd4701a667df)

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### How to test this:

- Pull PR, run es against a trial license and start kibana as usual.
- Make a curl request to Kibana to get the config saved object:

```
curl --location 'localhost:5601/abc/api/saved_objects/config/9.0.0' \
--header 'Content-Type: application/json' \
--header 'Accept-Encoding: gzip, deflate, br' \
--header 'kbn-xsrf: kibana' \
--header 'Kbn-Version: 9.0.0' \
--header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ=='
```

- Navigate to Upgrade Assistant and observe Kibana has at least 1
deprecation warning.
- View Kibana's warnings, you should see a warning entry for `The "GET
/api/saved_objects/{type}/{id}" route is deprecated`

![Screenshot 2024-11-06 at 16 26
26](https://github.com/user-attachments/assets/3b6a5644-3e5e-403e-a0f6-015686675b9f)

- click on the deprecation and you should see more detail about the
deprecated API that's been used in the flyout:

![Screenshot 2024-11-06 at 16 26
44](https://github.com/user-attachments/assets/696aaf8f-fb6b-4c61-bc3c-b3745f85059a)

- resolve the deprecation warning
- Kibana should continue to issue requests to the deprecated SO HTTP
APIs because these APIs have not been removed yet.

### Risk Matrix

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| End user concern from the deprecation warning that says the routes
have been deprecated | Low | Low | The APIs have been deprecated since
8.7 and recommends using public APIs instead. |

### For maintainers

- [x] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 0df2e98)

# Conflicts:
#	oas_docs/output/kibana.serverless.yaml
#	oas_docs/output/kibana.yaml
#	packages/core/deprecations/core-deprecations-server-internal/src/routes/post_validation_handler.ts
#	packages/core/http/core-http-server/index.ts
#	packages/core/http/core-http-server/src/router/index.ts
@jloleysens jloleysens added the backport This PR is a backport of another PR label Nov 21, 2024
@jloleysens jloleysens enabled auto-merge (squash) November 21, 2024 12:30
@github-actions
Copy link
Copy Markdown
Contributor

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@jloleysens jloleysens merged commit 7fd0115 into elastic:8.x Nov 21, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 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
@kbn/core-saved-objects-server-internal 72 74 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiAssistantManagementSelection 92.7KB 92.8KB +71.0B
lists 145.2KB 145.3KB +71.0B
total +142.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 454.0KB 454.1KB +71.0B
Unknown metric groups

API count

id before after diff
@kbn/core-saved-objects-server-internal 73 75 +2

History

@jloleysens jloleysens deleted the backport/8.x/pr-197936 branch November 22, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants