Skip to content

Devcontainers plugin: Plugin is not able to process GitLab URLs correctly #117

@Parkreiner

Description

@Parkreiner

Issue comes from a user at a prospective company.

Problem

  • When using the devcontainers plugin, the plugin is sometimes unable to parse GitLab repo URLs, and detect whether the repo has a devcontainers plugin

Likely issue

  • The issue seems to be that the target field in the LocationSpec value includes additional paths at the end that make the URL not valid. The URL becomes valid when those additional pieces are removed

Other notes

Brandon provided a sample catalog-info file that isn't working (though he obviously can't share the full repo):

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  namespace: default
  annotations:
    backstage.io/managed-by-location: url:https://my.gitlab.com/devexportal/sandbox/myreactapp/-/blob/main/catalog-info.yaml
    backstage.io/managed-by-origin-location: url:https://my.gitlab.com/devexportal/sandbox/myreactapp/-/blob/main/catalog-info.yaml
    backstage.io/view-url: https://my.gitlab.com/devexportal/sandbox/myreactapp/-/blob/main/catalog-info.yaml
    backstage.io/edit-url: https://my.gitlab.com/devexportal/sandbox/myreactapp/-/edit/main/catalog-info.yaml
    backstage.io/source-location: url:https://my.gitlab.com/devexportal/sandbox/myreactapp/-/blob/main/
    swf-backstage-dev.com/template-source-url: https://my.gitlab.com/devexportal/templates/simple-react-app/-/blob/0.5.0/
    swf-backstage-dev.com/template-source-name: simple-react-app
    gitlab.com/project-slug: devexportal/sandbox/myreactapp
    backstage.io/techdocs-ref: dir:.
    argocd/app-name: myreactapp-main
    argocd/proxy-url: /argocd/api
    backstage.io/kubernetes-namespace: myreactapp
    backstage.io/kubernetes-label-selector: app.kubernetes.io/component=myreactapp
    gitlab.com/instance: my.gitlab.com
  title: myReactApp
  name: myreactapp
  description: Creating React App from Template
  tags:
    - helm
    - kubernetes
    - react
    - typescript
    - vite
    - devcontainers
  links:
    - url: https://my.gitlab.com/devexportal/templates/simple-react-app/-/blob/0.5.0/
      title: Template Source Url
      type: templates
  uid: e375af26-1e87-44aa-b02f-78498e879628
  etag: d26e609289dbb3d09c7550f5c57d17c3f45a9c3e
relations:
  - type: ownedBy
    targetRef: group:default/gitlab-users
    target:
      kind: group
      namespace: default
      name: gitlab-users
  - type: scaffoldedFrom
    targetRef: template:default/simple-react-app
    target:
      kind: template
      namespace: default
      name: simple-react-app
spec:
  type: website
  lifecycle: experimental
  owner: group:default/my-group
  dependsOn: []
  consumesApis: []
  coder:
    templateName: docker
    mode: auto
    params:
      repo: custom
      region: us-east-1
  createdDate: 2024-04-17T17:08:58.204Z

The culprit might be the fact that the backstage.io/source-location property has a value of url:https://my.gitlab.com/devexportal/sandbox/myreactapp/-/blob/main/, and that the /~/blob/main/ at the end shouldn't be there?

We aren't working with this property directly, but it might be shared with the APIs we are using

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions