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

Add OpenAPI specs for EEM APIs #190203

Merged
merged 38 commits into from
Aug 19, 2024
Merged

Conversation

tommyers-elastic
Copy link
Contributor

Summary

Add OpenAPI specs for EEM APIs.

This PR introduces a couple of scripts to the @kbn/entities-schema package which generate OpenAPI specs and serves them in a Swagger UI.

To test:

cd x-pack/packages/kbn-entities-schema
yarn run openapi:generate  # [optional] this writes the spec to 'oas.yaml' 
yarn run openapi:serve  # this runs the swagger UI at 'localhost:3000'
Screenshot 2024-08-09 at 00 39 39

@tommyers-elastic tommyers-elastic added the Feature:EEM Elastic Entity Model label Aug 8, 2024
@tommyers-elastic tommyers-elastic requested a review from a team as a code owner August 8, 2024 23:42
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Aug 8, 2024
@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@tommyers-elastic tommyers-elastic added the release_note:skip Skip the PR/issue when compiling release notes label Aug 8, 2024
@miltonhultgren
Copy link
Contributor

Didn't look at the specs yet, but can we verify that this is compatible with the documentation team's OAS setup so that whatever we have:
a) Gets re-generated when they run their scripts
b) Gets picked up by their tools to be included in the Kibana OAS docs

@tommyers-elastic
Copy link
Contributor Author

@miltonhultgren sounds good - let's not block getting these merged though - we can follow up with the rest after. once we have the specs, the conversation with the docs team becomes easier.

@miltonhultgren
Copy link
Contributor

Sounds good to me, I filed https://github.com/elastic/elastic-entity-model/issues/131

@tommyers-elastic
Copy link
Contributor Author

@elasticmachine merge upstream

@klacabane klacabane added the team:obs-entities Observability Entities Team label Aug 14, 2024
@miltonhultgren
Copy link
Contributor

Running node scripts/generate_oas
I get the following warnings:

Recursive reference detected at #/allOf/1/anyOf/1/items! Defaulting to any
Recursive reference detected at #/allOf/1/anyOf/2/additionalProperties! Defaulting to any
Recursive reference detected at #/allOf/1/anyOf/1/items! Defaulting to any
Recursive reference detected at #/allOf/1/anyOf/2/additionalProperties! Defaulting to any

Copy link
Contributor

@miltonhultgren miltonhultgren left a comment

Choose a reason for hiding this comment

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

LGTM

klacabane and others added 5 commits August 19, 2024 15:22
Co-authored-by: Milton Hultgren <miltonhultgren@gmail.com>
…utes/enablement/check.ts

Co-authored-by: Milton Hultgren <miltonhultgren@gmail.com>
Co-authored-by: Milton Hultgren <miltonhultgren@gmail.com>
…utes/enablement/enable.ts

Co-authored-by: Milton Hultgren <miltonhultgren@gmail.com>
@klacabane
Copy link
Contributor

Running node scripts/generate_oas I get the following warnings:

Recursive reference detected at #/allOf/1/anyOf/1/items! Defaulting to any
Recursive reference detected at #/allOf/1/anyOf/2/additionalProperties! Defaulting to any
Recursive reference detected at #/allOf/1/anyOf/1/items! Defaulting to any
Recursive reference detected at #/allOf/1/anyOf/2/additionalProperties! Defaulting to any

I've had a look but couldn't find any obvious issue with the schemas. I've inspected the generate schema and everything look correctly generated so I'll log this as a follow up

@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 19, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: fd487bf
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-190203-fd487bfd2795

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #81 / Visualizations - Group 3 lens app - TSVB Open in Lens Dashboard to TSVB to Lens should convert a by reference TSVB viz to a Lens viz

Metrics [docs]

✅ unchanged

History

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

@klacabane klacabane merged commit e9c913d into elastic:main Aug 19, 2024
40 checks passed
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Aug 19, 2024
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 ci:project-deploy-observability Create an Observability project Feature:EEM Elastic Entity Model release_note:skip Skip the PR/issue when compiling release notes team:obs-entities Observability Entities Team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants