Skip to content

Conversation

@jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Oct 29, 2024

Summary

Updates the logic for extracting operation IDs to something more usable. Note: for now we do not consider version when generating these.

Related https://github.com/elastic/docs-projects/issues/253

Notes

  • Not intended to be the perfect solution, just cover 90+% of cases, we should use overlays for the rest.
  • See contents of oas_docs/bundle.json for new output

@jloleysens jloleysens added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Feature:OAS Work or issues related to Core-provided mechanisms for generating OAS v8.16.0 backport:version Backport to applied version labels v8.17.0 labels Oct 29, 2024
@jloleysens
Copy link
Contributor Author

/ci

…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update'
@jloleysens
Copy link
Contributor Author

/ci

@jloleysens
Copy link
Contributor Author

/ci

@jloleysens jloleysens marked this pull request as ready for review October 30, 2024 11:33
@jloleysens jloleysens requested a review from a team as a code owner October 30, 2024 11:33
@elasticmachine
Copy link
Contributor

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

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

.replace(/[\/]+$/, '')
.toLowerCase();

const removePrefixes = ['internal/api/', 'internal/', 'api/']; // longest to shortest
Copy link
Member

Choose a reason for hiding this comment

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

super-nit: this could be a constant outside the function.

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #15 / Description renders description correctly

Metrics [docs]

✅ unchanged

History

Copy link
Contributor

@lcawl lcawl left a comment

Choose a reason for hiding this comment

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

Output lgtm, thanks!

@jloleysens jloleysens merged commit e53d68c into elastic:main Oct 30, 2024
22 checks passed
@jloleysens jloleysens deleted the oas/beautify-operation-ids branch October 30, 2024 19:11
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.x

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.16 Backport failed because of merge conflicts
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 198132

Questions ?

Please refer to the Backport tool documentation

lcawl pushed a commit to jloleysens/kibana that referenced this pull request Oct 31, 2024
lcawl pushed a commit to jloleysens/kibana that referenced this pull request Oct 31, 2024
(cherry picked from commit e53d68c)

# Conflicts:
#	oas_docs/bundle.json
#	oas_docs/bundle.serverless.json
#	oas_docs/output/kibana.serverless.yaml
#	oas_docs/output/kibana.yaml
#	packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap
#	packages/kbn-router-to-openapispec/src/process_versioned_router.test.ts
jloleysens added a commit that referenced this pull request Oct 31, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
 - [OAS] Beautify generated operation ids (#198132) (e53d68c)

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

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

<!--BACKPORT [{"author":{"name":"Jean-Louis
Leysens","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T19:11:24Z","message":"[OAS]
Beautify generated operation ids
(#198132)","sha":"e53d68c26d6c1f5330ee196938c650a786919a70"},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <[email protected]>
jloleysens added a commit that referenced this pull request Oct 31, 2024
# Backport

This will backport the following commits from `main` to `8.16`:
 - [OAS] Beautify generated operation ids (#198132) (e53d68c)

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

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

<!--BACKPORT [{"author":{"name":"Jean-Louis
Leysens","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T19:11:24Z","message":"[OAS]
Beautify generated operation ids
(#198132)","sha":"e53d68c26d6c1f5330ee196938c650a786919a70"},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: lcawl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:OAS Work or issues related to Core-provided mechanisms for generating OAS release_note:skip Skip the PR/issue when compiling release notes Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v8.16.0 v8.17.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants