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

[DOCS] Automate output for 4 case APIs #142173

Merged
merged 12 commits into from
Oct 5, 2022
Merged

Conversation

lcawl
Copy link
Contributor

@lcawl lcawl commented Sep 29, 2022

Summary

Relates to #137240

This PR uses the open API v3 specification (OAS) to generate output for some case APIs. It takes output from the open-api generator, in particular the HTML generator, applies a custom template and uses that output in a passthrough block in an appendix in the Kibana Guide. I've created a temporary bundled-min.json so that we can incrementally publish the previews without ill-affecting the spec.

Some elective changes were made in the specifications to improve the output, for example:

. Added titles so that the "models" in the output have clearer labels
. Added missing "required" and "nullable" properties
. Segmented the specifications into smaller chunks in the "schemas" folder, so they're easier to re-use

A note is also added to the original API pages to link to (1) the OAS as the source of truth, and (2) the generated output for a preview.

Note: The "oneOf" feature (where you can update either an alert or a comment in a case, for example) does not show up perfectly in the output. The two options are there in the model listings, but they're not linked. I've added this to the list of outstanding improvements necessary if we stay with this longer-term.

@lcawl lcawl added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) docs Feature:Cases Cases feature v8.6.0 labels Sep 29, 2022
@github-actions
Copy link
Contributor

Documentation preview:

@lcawl lcawl marked this pull request as ready for review September 29, 2022 15:51
@lcawl lcawl requested a review from a team as a code owner September 29, 2022 15:51
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@@ -0,0 +1,9 @@
title: Add case comment request
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a few other comment types that we support:

https://github.com/elastic/kibana/blob/main/x-pack/plugins/cases/common/api/cases/comment.ts#L24

I can help add those later if that's easier though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! If you're okay with deferring that work to a subsequent PR, we can get this initial set of content added then augment from there. I'll definitely take you up on the offer for help to understand what those other types accomplish.

- url: 'http://localhost:5601'
description: local
paths:
# '/s/{spaceId}/api/cases':
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove these commented out lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since I'm just using these -min. files until I get all the automated docs generated, I think it's okay to leave this as-is until we delete it.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@lcawl lcawl merged commit 2d8b29e into elastic:main Oct 5, 2022
@lcawl lcawl deleted the add-case-comment-v3 branch October 5, 2022 16:24
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 11, 2022
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 14, 2022
@lcawl lcawl added the v8.5.1 label Oct 20, 2022
@lcawl
Copy link
Contributor Author

lcawl commented Oct 20, 2022

💚 All backports created successfully

Status Branch Result
8.5

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

Questions ?

Please refer to the Backport tool documentation

lcawl added a commit to lcawl/kibana that referenced this pull request Oct 20, 2022
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 docs Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.5.0 v8.5.1 v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants