#GitHubEntityProvider

13 messages · Page 1 of 1 (latest)

austere nacelle
#

Hi Team.
I am trying to import systems using GitHubEntityProvider (GitHub Discovery) with below config settings. I am using wild card in catalogPath

    github:
      providerId:
        organization: 'org-name' # string
        catalogPath: '/systems/**/system.yaml' # string
        filters:
          branch: 'main'
          repository: 'system-test'
        schedule: 
          frequency: { minutes: 5 }
          timeout: { minutes: 10 }  

I am getting system populated in UI but the problem is:

When I inspect the entity I can see that star (wild card) is coming in managed-by-origin-location which is giving kind of wrong information, also, If I click the link, the page will give 404.
In actual it should show full correct path without star in the link.
Error:

backstage.io/managed-by-origin-location
url:https://github.com/org-name/system-test/blob/main/systems/**/system.yaml

Correct Way should be:

backstage.io/managed-by-origin-location
url:https://github.com/org-name/system-test/blob/main/systems/abc1/system.yaml

Is there any way I can fix this.

timid iron
#

Hi @austere nacelle, we do something very similar and that result is tottaly valid for that annotation. That is the true "origin" of the entity. If you want the valid URL then use the backstage.io/managed-by-location annotation instead

austere nacelle
#

@timid iron I understand that it is true 'origin' of the entity but is there any way I can get full actual path.

timid iron
#

Use the backstage.io/managed-by-location annotation, it has the full path

austere nacelle
#

@timid iron
We have below system.yaml in system-test/systems/abc1/system.yaml

apiVersion: backstage.io/v1alpha1
kind: System
metadata:
  name: system_1
  description: System 1 for test
spec:
  owner: user:gaurav
---
apiVersion: backstage.io/v1alpha1
kind: Location
metadata:
  name: location-all
spec:
  type: url
  targets:
  - https://github.com/org-name/compnent/blob/main/catalog-info.yaml

In this case both managed-by-location and managed-by-origin-location becomes different.

      "backstage.io/managed-by-location": "url:https://github.com/org-name/compnent/blob/main/catalog-info.yaml",
      "backstage.io/managed-by-origin-location": "url:https://github.com/org-name/system-test/blob/main/systems/**/system.yaml",
timid iron
#

Ok, my day is getting busy now so will need to reply later

timid iron
#

Alright, our setup is a little different so I'll share that and maybe it will help you out.

#

Our provider config is like this:

providers:
    github:
      githubBackstageSystems:
        organization: 'company-org'
        catalogPath: /some-path/another-path/**/system.*.yaml
        filters:
          branch: 'main'
          repository: '^specific-repo$'

(Our Systems are in various folders under this path, all start with system and then our own naming convention for the file. They all live in a specific repo but we have a few repos that have a similar name so that's why we have the regex pattern)

#

Then a System YAML looks like this:

apiVersion: backstage.io/v1alpha1
kind: System
metadata:
  name: system.something.another.final
  description: An exmple of a System at Company
  title: Some System Example
spec:
  owner: group:name-of-wner
  domain: domain.something
#

Then if I inspect the entity the annotations look like this:

backstage.io/managed-by-location
url:https://github.com/company-org/specific-repo/tree/main/some-path/another-path/something/another/final/system.something.another.final.yaml

backstage.io/managed-by-origin-location
url:https://github.com/company-org/specific-repo/blob/main/some-path/another-path/**/system.*.yaml
#

We don't use multi-document YAML files. We only use the Location kind for our Template Kinds

#

Hopefully this helps a little @austere nacelle?

austere nacelle
#

Thanks @timid iron for the explanation.