Skip to content

entity.List() reads data from a deprectated API #101

@SwissGipfel

Description

@SwissGipfel

While debugging an issue in our Terraform code that uses terraform-provider-backstage, I noticed that this provider reads data from the API endpoint that Backstage marked as deprecated: GET /entities

This endpoint is deprecated in favor of GET /entities/by-query, which provides a more efficient implementation and cursor based pagination.

Currently, the read requests still work for me, but produce a weird behavior, where I get some entities twice in the response using the old API. Using the new API, the same entity gets returned once, as expected.

Provider request according to debugging:

$ curl -XGET <... truncated ...>/backend/api/catalog/entities?filter=kind%3DAPI%2Cmetadata.namespace%3Ddefault%2Cspec.type%3Dopenapi&order=asc%3Ametadata.name | jq . | grep "8ac7c1ad-6f27-40e3-93cd-4044161f1af1"

      "uid": "8ac7c1ad-6f27-40e3-93cd-4044161f1af1"
      "uid": "8ac7c1ad-6f27-40e3-93cd-4044161f1af1"

Request to the Backstage API as documented:

$ curl -XGET <... truncated ...>/backend/api/catalog/entities/by-query?filter=kind=API,metadata.namespace=default,spec.type=openapi | jq . | grep "8ac7c1ad-6f27-40e3-93cd-4044161f1af1"

        "uid": "8ac7c1ad-6f27-40e3-93cd-4044161f1af1"

Couple of notes to this (please correct me if I'm wrong):

  • I stepped through terraform-provider-backstage v3.2.1 as my locally available delve did not support go1.25.0 used in terraform-provider-backstage v3.3.0 yet => Between those versions, go-backstage was bumped from 3.1.0 to 3.2.0. This bump didn't change the logic as far as I saw, only updated the Go version.
  • Just looked at the entity List function as it was related to my issue, but I assume there are more functions that have a similar issue.
  • Maybe there's also an issue with the data in my Backstage instance that I need to fix. Nevertheless I still think it's worth upgrading to the new API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions