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

🐛 Bug Report: Kind: APIs can't use apiProvidedBy to relate to a component #25387

Open
2 tasks done
pguppy opened this issue Jun 25, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@pguppy
Copy link

pguppy commented Jun 25, 2024

📜 Description

API kinds are unable to relate back to components in graph view. Is there a way of linking a kind API back to a component without creating a custom processor that emit the relations.

Was mentioned being an issue under #13535

👍 Expected behavior

When using a spec relationship link such as apiProvidedBy be able to link back to a component and it show up in the relations gragh.

👎 Actual Behavior with Screenshots

Currently it looks like their is no way to link back a API to a component

👟 Reproduction steps

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: test-api
  title: test.api
  annotations:
  namespace: default
  description: This is a test api
spec:
  owner: guest
  type: service
  lifecycle: experimental
---
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
  name: Test.API.v1_1
  title: Test.API.v1_1
  namespace: defualt
  description: >-
   Test Api
spec:
  type: openapi
  lifecycle: experimental
  owner: guest
  apiProvidedBy: Component:bunnings-technology-delivery/test-api # Way to link back to component, currently using apiProvidedBy does not work 
  definition:
    $text: swagger.json

📃 Provide the context for the Bug.

Use case

We are using a custom entity provider to inject our APIs directly into backstage from their swagger mapping files. Though are keeping the component as a catalog-info file in each repo. We don't want to have to update the catalog info file every time there is a change to our APIs and instead just edit the custom entity provider to link back to our component.

🖥️ Your Environment

Dependencies:
  @backstage/app-defaults                                            1.5.4
  @backstage/backend-app-api                                         0.7.5
  @backstage/backend-common                                          0.21.7, 0.22.0, 0.23.1
  @backstage/backend-defaults                                        0.2.18
  @backstage/backend-dev-utils                                       0.1.4
  @backstage/backend-openapi-utils                                   0.1.10
  @backstage/backend-plugin-api                                      0.6.18, 0.6.20
  @backstage/backend-tasks                                           0.5.23
  @backstage/backend-test-utils                                      0.3.8
  @backstage/catalog-client                                          1.6.5
  @backstage/catalog-model                                           1.5.0
  @backstage/cli-common                                              0.1.13, 0.1.14
  @backstage/cli-node                                                0.2.5
  @backstage/cli                                                     0.26.3
  @backstage/config-loader                                           1.8.0, 1.8.1
  @backstage/config                                                  1.2.0
  @backstage/core-app-api                                            1.12.4
  @backstage/core-compat-api                                         0.2.4
  @backstage/core-components                                         0.13.10, 0.14.7
  @backstage/core-plugin-api                                         1.9.2
  @backstage/dev-utils                                               1.0.31
  @backstage/errors                                                  1.2.4
  @backstage/eslint-plugin                                           0.1.7
  @backstage/frontend-plugin-api                                     0.6.5
  @backstage/integration-aws-node                                    0.1.12
  @backstage/integration-react                                       1.1.27
  @backstage/integration                                             1.11.0, 1.12.0
  @backstage/plugin-api-docs                                         0.11.4
  @backstage/plugin-app-backend                                      0.3.65
  @backstage/plugin-app-node                                         0.1.17
  @backstage/plugin-auth-backend-module-atlassian-provider           0.1.9
  @backstage/plugin-auth-backend-module-aws-alb-provider             0.1.9
  @backstage/plugin-auth-backend-module-azure-easyauth-provider      0.1.0
  @backstage/plugin-auth-backend-module-bitbucket-provider           0.1.0
  @backstage/plugin-auth-backend-module-cloudflare-access-provider   0.1.0
  @backstage/plugin-auth-backend-module-gcp-iap-provider             0.2.12
  @backstage/plugin-auth-backend-module-github-provider              0.1.15
  @backstage/plugin-auth-backend-module-gitlab-provider              0.1.14
  @backstage/plugin-auth-backend-module-google-provider              0.1.14
  @backstage/plugin-auth-backend-module-guest-provider               0.1.6
  @backstage/plugin-auth-backend-module-microsoft-provider           0.1.13
  @backstage/plugin-auth-backend-module-oauth2-provider              0.1.14
  @backstage/plugin-auth-backend-module-oauth2-proxy-provider        0.1.10
  @backstage/plugin-auth-backend-module-oidc-provider                0.1.8
  @backstage/plugin-auth-backend-module-okta-provider                0.0.10
  @backstage/plugin-auth-backend                                     0.22.4
  @backstage/plugin-auth-node                                        0.4.13, 0.4.15
  @backstage/plugin-auth-react                                       0.1.0
  @backstage/plugin-azure-sites-backend                              0.3.4
  @backstage/plugin-azure-sites-common                               0.1.3
  @backstage/plugin-azure-sites                                      0.1.23
  @backstage/plugin-badges-backend                                   0.4.0
  @backstage/plugin-badges                                           0.2.58
  @backstage/plugin-catalog-backend-module-github-org                0.1.12
  @backstage/plugin-catalog-backend-module-github                    0.6.0
  @backstage/plugin-catalog-backend-module-scaffolder-entity-model   0.1.15
  @backstage/plugin-catalog-backend                                  1.21.1
  @backstage/plugin-catalog-common                                   1.0.23
  @backstage/plugin-catalog-graph                                    0.4.4
  @backstage/plugin-catalog-import                                   0.10.10
  @backstage/plugin-catalog-node                                     1.11.1
  @backstage/plugin-catalog-react                                    1.12.0
  @backstage/plugin-catalog                                          1.19.0
  @backstage/plugin-events-backend-module-github                     0.2.3
  @backstage/plugin-events-backend                                   0.3.4
  @backstage/plugin-events-node                                      0.3.4
  @backstage/plugin-github-actions                                   0.6.15
  @backstage/plugin-home-react                                       0.1.13
  @backstage/plugin-kubernetes-backend                               0.17.0
  @backstage/plugin-kubernetes-common                                0.7.5
  @backstage/plugin-kubernetes-node                                  0.1.11
  @backstage/plugin-kubernetes-react                                 0.3.4
  @backstage/plugin-kubernetes                                       0.11.9
  @backstage/plugin-octopus-deploy                                   0.2.16
  @backstage/plugin-org                                              0.6.24
  @backstage/plugin-permission-backend-module-allow-all-policy       0.1.14
  @backstage/plugin-permission-backend                               0.5.41
  @backstage/plugin-permission-common                                0.7.13, 0.7.14
  @backstage/plugin-permission-node                                  0.7.29
  @backstage/plugin-permission-react                                 0.4.22
  @backstage/plugin-proxy-backend                                    0.4.15
  @backstage/plugin-scaffolder-backend-module-azure                  0.1.9
  @backstage/plugin-scaffolder-backend-module-bitbucket-cloud        0.1.7
  @backstage/plugin-scaffolder-backend-module-bitbucket-server       0.1.7
  @backstage/plugin-scaffolder-backend-module-bitbucket              0.2.7
  @backstage/plugin-scaffolder-backend-module-confluence-to-markdown 0.2.18
  @backstage/plugin-scaffolder-backend-module-gerrit                 0.1.9
  @backstage/plugin-scaffolder-backend-module-gitea                  0.1.7
  @backstage/plugin-scaffolder-backend-module-github                 0.2.7
  @backstage/plugin-scaffolder-backend-module-gitlab                 0.3.3
  @backstage/plugin-scaffolder-backend                               1.22.4
  @backstage/plugin-scaffolder-common                                1.5.2
  @backstage/plugin-scaffolder-node                                  0.4.4
  @backstage/plugin-scaffolder-react                                 1.8.4
  @backstage/plugin-scaffolder                                       1.19.3
  @backstage/plugin-search-backend-module-catalog                    0.1.22
  @backstage/plugin-search-backend-module-pg                         0.5.26
  @backstage/plugin-search-backend-module-techdocs                   0.1.22
  @backstage/plugin-search-backend-node                              1.2.21
  @backstage/plugin-search-backend                                   1.5.7
  @backstage/plugin-search-common                                    1.2.11
  @backstage/plugin-search-react                                     1.7.10
  @backstage/plugin-search                                           1.4.10
  @backstage/plugin-sonarqube-backend                                0.2.19
  @backstage/plugin-sonarqube-react                                  0.1.15
  @backstage/plugin-sonarqube                                        0.7.16
  @backstage/plugin-tech-radar                                       0.7.3
  @backstage/plugin-techdocs-backend                                 1.10.4
  @backstage/plugin-techdocs-module-addons-contrib                   1.1.9
  @backstage/plugin-techdocs-node                                    1.12.3
  @backstage/plugin-techdocs-react                                   1.2.3
  @backstage/plugin-techdocs                                         1.10.4
  @backstage/plugin-user-settings                                    0.8.5
  @backstage/release-manifests                                       0.0.11
  @backstage/repo-tools                                              0.8.0
  @backstage/test-utils                                              1.5.4
  @backstage/theme                                                   0.4.4, 0.5.5
  @backstage/types                                                   1.1.1
  @backstage/version-bridge                                          1.0.8

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

None

@pguppy pguppy added the bug Something isn't working label Jun 25, 2024
@benjdlambert
Copy link
Member

Hey 👋 thanks for raising this issue!

Yeah, unfortunately this isn't part of model right now, so those relations won't be emitted correctly.

You can however follow the guidance in the other issue, and create your own processor which would emit the correct relation by using the spec.apiProvidedBy field in the entities if it exists.

#13535 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants