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

[PRFC] API Docs for the whole backend #17535

Merged
merged 13 commits into from
Oct 24, 2023

Conversation

sennyeya
Copy link
Contributor

@sennyeya sennyeya commented Apr 26, 2023

Hey, I just made a Pull Request!

Summary

Support serving your Backstage instance's API docs in your Backstage instance's catalog. Inception 🤯 .
Screenshot 2023-04-26 at 3 38 02 PM

Caveats

  1. Plugins must register with this service to have their specs shown.
  2. It only supports new plugin system plugins.
  3. The work is only to create the actual OpenAPI spec through a provider. It was decided that exposing a merged spec as an endpoint was less important than showing it in the UI.

Testing

Since the Uffizi instance isn't set up to serve the backend-next package, to see the full benefits of this package, you'll have to test locally. cd packages/backend-next && yarn start or yarn --cwd packages/backend-next start and then issue a GET request to ${your_base_url}/api/api-registry.openapi/openapi.json (still a WIP on the URL). You should see all registered OpenAPI specs under their correct prefixes. Currently, this is just the catalog API.

✔️ 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 the area:catalog Related to the Catalog Project Area label Apr 26, 2023
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Apr 26, 2023

Changed Packages

Package Name Package Path Changeset Bump Current Version
example-backend-next packages/backend-next none v0.0.16
@backstage/backend-openapi-utils packages/backend-openapi-utils minor v0.0.5
@backstage/plugin-catalog-backend-module-backstage-openapi plugins/catalog-backend-module-backstage-openapi minor v0.0.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.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 26, 2023

Uffizzi Ephemeral Environment deployment-38056

☁️ https://app.uffizzi.com/github.com/backstage/backstage/pull/17535

📄 View Application Logs etc.

What is Uffizzi? Learn more!

@sennyeya sennyeya force-pushed the api-docs-new-backend branch 2 times, most recently from 842dfb0 to 0b09425 Compare May 1, 2023 20:55
@sennyeya sennyeya force-pushed the api-docs-new-backend branch 3 times, most recently from cfceb19 to 592ce91 Compare May 1, 2023 21:42
@sennyeya sennyeya marked this pull request as ready for review May 9, 2023 14:39
@sennyeya sennyeya requested review from a team and backstage-service as code owners May 9, 2023 14:39
app-config.yaml Outdated
@@ -47,6 +47,7 @@ backend:
allow:
- host: example.com
- host: '*.mozilla.org'
- host: localhost:7007
Copy link
Contributor Author

@sennyeya sennyeya May 9, 2023

Choose a reason for hiding this comment

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

Catalog imports don't support reading the internal OpenAPI spec without this.

@sennyeya sennyeya requested a review from a team as a code owner May 16, 2023 14:55
@github-actions github-actions bot added the search Things related to Search label May 16, 2023
Copy link
Contributor

@camilaibs camilaibs left a comment

Choose a reason for hiding this comment

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

Looking forward to use Backstage to document our plugin APIs 🎉 , thanks for contributing!
The changes to search-backend looks great to me, I've added only a curiosity question below. I'll leave the registry plugin review to @backstage/maintainers , I think they'll have great inputs to share!

plugins/search-backend/src/alpha.ts Outdated Show resolved Hide resolved
@github-actions
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 May 24, 2023
@sennyeya sennyeya requested a review from a team as a code owner October 6, 2023 18:53
sennyeya and others added 6 commits October 6, 2023 14:57
Signed-off-by: Aramis <sennyeyaramis@gmail.com>
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
.changeset/gentle-pears-camp.md Outdated Show resolved Hide resolved
.changeset/thirty-stingrays-grin.md Outdated Show resolved Hide resolved
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
@Edje-C
Copy link
Collaborator

Edje-C commented Oct 16, 2023

Need a maintainer @Rugvip

@sennyeya sennyeya mentioned this pull request Oct 22, 2023
20 tasks
@github-actions github-actions bot added the stale label Oct 23, 2023
@backstage backstage deleted a comment from github-actions bot Oct 23, 2023
@sennyeya sennyeya removed the stale label Oct 23, 2023
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, another round and hopefully almost there 😁

Sorry about the silence on this one

packages/backend-openapi-utils/config.d.ts Outdated Show resolved Hide resolved
packages/backend-openapi-utils/api-report.md Show resolved Hide resolved
plugins/catalog-backend-module-openapi-spec/package.json Outdated Show resolved Hide resolved
plugins/catalog-backend-module-openapi-spec/package.json Outdated Show resolved Hide resolved
Comment on lines 214 to 217
'backstage.io/managed-by-location':
'internal-package:@backstage/plugin-catalog-backend-module-openapi-spec',
'backstage.io/managed-by-origin-location':
'internal-package:@backstage/plugin-catalog-backend-module-openapi-spec',
Copy link
Member

Choose a reason for hiding this comment

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

ANNOTATION_LOCATION and ANNOTATION_ORIGIN_LOCATION for these.

I take it this entire structure is fairly experimental and likely to evolve? Otherwise I'm thinking it would make sense to make it possible to configure the name and perhaps some other fields in the entity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, for now I'd like to keep the extensability small as this is all very experimental

Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
@sennyeya
Copy link
Contributor Author

@Rugvip I updated per your comments. Assuming this builds, it should be ready for another round.

@sennyeya sennyeya requested a review from Rugvip October 23, 2023 18:16
sennyeya and others added 2 commits October 23, 2023 15:02
Signed-off-by: Aramis Sennyey <aramiss@spotify.com>
…schema

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.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.

👌

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
@Rugvip Rugvip enabled auto-merge October 24, 2023 09:25
@Rugvip Rugvip merged commit 20fd010 into backstage:master Oct 24, 2023
35 checks passed
@github-actions
Copy link
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.20.0 release, scheduled for Tue, 14 Nov 2023.

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:openapi-tooling Related to the OpenAPI Tooling Project Area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants