question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support an annotation that skips building techdocs

See original GitHub issue

Feature Suggestion

We’d like it to be possible to define the following catalog-info.yaml

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: my-component-with-docs
  description: My awesome component
  annotations:
    backstage.io/techdocs-ref: dir:.
    my-org.com/skip-techdocs-build: true
spec:
...

Adding the annotation my-org.com/skip-techdocs-build (potentially customizable in config) with the value true would cause the techdocs backend to not attempt to build techdocs for this component. However techdocs would still be fetched from whatever datastore is in use, and the docs for this component would still be displayed in the UI. This would allow users to place their own tech-docs in the correct place and have them served. See the context below for more info on the use case.

Possible Implementation

Can we add an additional condition to this line? https://github.com/backstage/backstage/blob/9c17a6cdb9be6ba85ef9bfab76b94e672902b9fe/plugins/techdocs-backend/src/service/router.ts#L203

Something like

if (config.getString('techdocs.builder') !== 'local' || entity?.metadata?.annotations?.[config.getString('techdocs.builder.ignoreAnnotation'))

I’m happy to have a go at implementing this, or an alternate solution.

Context

At our organisation, we’d like to support a ‘hybrid’ approach to handling the building of tech docs.

One path would be the ‘default’/‘out of the box’ experience, where the Backstage backend builds the docs for you. The advantage here is that users need only populate their repository with their docs and an mkdocs.yaml, and we do the rest for them. For many users, this would work well. The limitation is that the user is bound by the plugins we choose to offer, and other things related to the execution of mkdocs.

We’d like users to have the option of opting out of us building docs for them, if they need added flexibility in how they build their docs, or to customize mkdocs plugins etc. We think a sensible way for them to signal this would be to add an annotation to their catalog-info.yaml that indicates that we should not build the docs for them. They would instead build the docs themselves, and write them to the appropriate place for Backstage to serve them from.

If there’s a better/easier way to accomplish this, we’d love to hear!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kuangpcommented, Feb 11, 2022
0reactions
Nikskocommented, Mar 16, 2022

@soapraj yep, closing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating and publishing your docs - Backstage.io
The backstage.io/techdocs-ref annotation is used by TechDocs to download the documentation source files for generating an entity's TechDocs site.
Read more >
Backstage TechDocs - DEV Community ‍ ‍
TechDocs enables documentation to be found from a service page in Backstage's Catalog and be built with good old Markdown. How TechDocs works....
Read more >
PL/IgnoreUnitTest Annotation - Technical Documentation For IFS ...
Newly introduced annotation @IgnoreUnitTest can be used with PLSQL ... In such cases, developer can use DynamicStatement annotation to ignore the method ...
Read more >
Documentation for the jaxrs-spec Generator
implicitHeadersRegex, Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: ...
Read more >
XSD Design Guidelines - Ed-Fi Tech Docs
The XML schema should be flexible to support the interchange of ... types listed below are the building blocks of interchange schemas.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found