Skip to content

feat(docs): autogenerate API documentation #27573

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

Merged
merged 12 commits into from
Mar 2, 2025

Conversation

aramissennyeydd
Copy link
Contributor

@aramissennyeydd aramissennyeydd commented Nov 10, 2024

Hey, I just made a Pull Request!

Addresses #26894.

This uses https://github.com/PaloAltoNetworks/docusaurus-openapi-docs to render our existing specs. The goal here is to make the OpenAPI spec the source of truth for docs + API definition. I moved the existing catalog docs into the spec and saw really nice results in the autogenerated markdown.

TODO:

  • Figure out a better balance of stored in git vs generated.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@github-actions github-actions bot added area:documentation Improvements or additions to documentation area:catalog Related to the Catalog Project Area area:microsite Changes to backstage.io labels Nov 10, 2024
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Nov 10, 2024

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @backstage/catalog-client
  • @backstage/plugin-catalog-backend
  • @backstage/plugin-search-backend

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/catalog-client packages/catalog-client none v1.9.1
@backstage/plugin-catalog-backend plugins/catalog-backend none v1.31.1-next.0
@backstage/plugin-search-backend plugins/search-backend none v1.8.3-next.0

@backstage-goalie
Copy link
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

Copy link
Collaborator

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

This looks like a great addition to the docs @aramissennyeydd, thanks for taking this on!

Looks good over all, curious about two things:

  1. Whats the impact on build time?
  2. Do we need to manage the new sidebars manually?

Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Dec 26, 2024
@aramissennyeydd
Copy link
Contributor Author

@awanlin Sorry for the slow response here, impact on build time should be ~2 mins added, mostly from having to run the extra yarn install. I think there are security issues if we don't separate out the user generated content + hosted content. Happy to chat about this at the next SIG though :)

We will also need to manage the new sidebars semi-manually, we'd need to add the initial reference to the autogenerated file as I have here, but after that, we can just use the autogenerated one.

@github-actions github-actions bot removed the stale label Dec 30, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@aramissennyeydd aramissennyeydd force-pushed the sennyeya/docsite-openapi branch from a1254c2 to 53f55db Compare January 29, 2025 03:07
@aramissennyeydd aramissennyeydd marked this pull request as ready for review January 31, 2025 14:57
Copy link
Member

@freben freben left a comment

Choose a reason for hiding this comment

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

Pretty cool. Tentative approval. Would love to see the result of it, but haven't had the time yet to run it locally. I see it angers lighthouse too.

@aramissennyeydd
Copy link
Contributor Author

Lighthouse ended up being a CJS/MJS issue :shaking_fist, should be fixed now :)

Copy link
Collaborator

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

Let's try it out 🚀

Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Feb 24, 2025
@Rugvip Rugvip removed the stale label Feb 28, 2025
Copy link
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

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

Awesome stuff! 😁

Couple small pieces before :shipit:

@@ -266,7 +276,27 @@ const config: Config = {
ratingMode: 'stars',
},
],
[
'docusaurus-plugin-openapi-docs',
Copy link
Member

Choose a reason for hiding this comment

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

Ran into a minor cosmetic issue:

image

The double // goes away if I remove the leading / from the generated .mdx files, but perhaps there's some config somewhere to avoid the other /. Either way not a blocking issue, fine to merge without a fix for this.

aramissennyeydd and others added 9 commits February 28, 2025 09:26
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
@aramissennyeydd aramissennyeydd force-pushed the sennyeya/docsite-openapi branch from a94996d to c49e11b Compare February 28, 2025 16:09
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Copy link
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

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

Alright, let's :shipit: 🎉

Thank you, awesome stuff! 😁 👍

@Rugvip Rugvip merged commit 1ebf9f6 into backstage:master Mar 2, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:catalog Related to the Catalog Project Area area:documentation Improvements or additions to documentation area:microsite Changes to backstage.io area:search domain:docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants