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

[Dashboards][OAS] Generate API docs for Dashboards API #199215

Merged
merged 26 commits into from
Dec 4, 2024

Conversation

nickpeihl
Copy link
Member

@nickpeihl nickpeihl commented Nov 6, 2024

Fixes #192875

Summary

Add Dashboards API to generated OpenAPI docs

We can generate an ephemeral API documentation webpage on Bump.sh for previewing the changes.

  1. Make sure you have no other Elasticsearch or Kibana instances running.
  2. You may have to globally install the bump-cli package the first time, e.g. npm install --global bump-cli.
  3. cd oas_docs
  4. make api-docs
  5. make api-docs-preview

The third step creates a webpage on Bump with a TTL of 90 minutes.

@nickpeihl nickpeihl force-pushed the dashboardApi_oasDocs branch from d468969 to 9d80b11 Compare November 6, 2024 19:42
nickpeihl and others added 15 commits November 8, 2024 13:28
…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 --include-path /api/dashboards --update'
This leads to issues with Open API documentation where the uuidv4 function returns unwanted values in the spec. If not provided, the Storage implementation generates random values instead.
…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 --include-path /api/dashboards --update'
@nickpeihl nickpeihl marked this pull request as ready for review November 14, 2024 13:28
@nickpeihl nickpeihl requested review from a team as code owners November 14, 2024 13:28
@nickpeihl nickpeihl added release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Nov 14, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-docs (Team:Docs)

@nickpeihl nickpeihl added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) docs labels Nov 14, 2024
@nickpeihl nickpeihl changed the title [Dashboards] Generate API docs for Dashboards API [Dashboards][OAS] Generate API docs for Dashboards API Nov 14, 2024
@lcawl
Copy link
Contributor

lcawl commented Nov 14, 2024

I've added the stability values so that they get the "Technical preview" badge per #181995. I've also added some parameter descriptions, but they're best guesses so might need to be updated if there is more information about wildcard support, etc. I didn't add descriptions for the response body properties, but they ought to have meta descriptions added in the same way too.

@nreese nreese self-requested a review November 19, 2024 17:50
src/plugins/dashboard/server/api/register_routes.ts Outdated Show resolved Hide resolved
meta: { description: 'The page number to return.' },
defaultValue: 1,
}),
perPage: schema.maybe(
Copy link
Contributor

Choose a reason for hiding this comment

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

how about including defaults in the description for when value is not provided.

Is there a max perPage value? Lets mention that as well.

Copy link
Member Author

@nickpeihl nickpeihl Nov 27, 2024

Choose a reason for hiding this comment

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

I've added a max perPage value of 1000 which matches the internal RPC default for the Dashboard listing page. abfffa8

@nickpeihl nickpeihl requested a review from nreese November 27, 2024 19:57
…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 --include-path /api/dashboards --update'
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review only

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
dashboard 13 14 +1

History

@nickpeihl nickpeihl merged commit c8866e4 into elastic:main Dec 4, 2024
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

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

You might need to backport the following PRs to 8.x:
- [Fleet] fix schema validation to allow undefined/null (#202732)
- [Core] [UA] Support API Deprecations (#196081)

Manual backport

To create the backport manually run:

node scripts/backport --pr 199215

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Dec 5, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 199215 locally

1 similar comment
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 199215 locally

SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Dec 9, 2024
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Dec 9, 2024
nickpeihl added a commit that referenced this pull request Dec 9, 2024
#203437)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dashboards][OAS] Generate API docs for Dashboards API
(#199215)](#199215)

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

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

<!--BACKPORT [{"author":{"name":"Nick
Peihl","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-04T22:33:10Z","message":"[Dashboards][OAS]
Generate API docs for Dashboards API
(#199215)","sha":"c8866e4ce3425bfb8188320997c75c4c152b2241","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","Team:Presentation","release_note:skip","backport
missing","v9.0.0","docs","backport:prev-minor"],"number":199215,"url":"https://github.com/elastic/kibana/pull/199215","mergeCommit":{"message":"[Dashboards][OAS]
Generate API docs for Dashboards API
(#199215)","sha":"c8866e4ce3425bfb8188320997c75c4c152b2241"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199215","number":199215,"mergeCommit":{"message":"[Dashboards][OAS]
Generate API docs for Dashboards API
(#199215)","sha":"c8866e4ce3425bfb8188320997c75c4c152b2241"}}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <[email protected]>
@kibanamachine kibanamachine added v8.18.0 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Dec 9, 2024
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 9, 2024
Samiul-TheSoccerFan pushed a commit to Samiul-TheSoccerFan/kibana that referenced this pull request Dec 10, 2024
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
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) docs release_note:skip Skip the PR/issue when compiling release notes Team:Docs Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboards][Docs] Add OpenAPI doc for Dashboard routes
6 participants