Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-4608

GitLab - unable to fetch devfile - ref is missing from API call

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Release Notes, User Experience
    • Hide
      = Devfile not resolved on private GitLab repositories

      Before this update, {prod-short} failed to find devfiles at the root of GitLab private repositories. This update solves the issue.
      Show
      = Devfile not resolved on private GitLab repositories Before this update, {prod-short} failed to find devfiles at the root of GitLab private repositories. This update solves the issue.
    • Bug Fix
    • Done

      Description of problem:

      DevSpaces cannot find devfile in the hosted GitLab server private repositories where OAuth integration is in place and works successfully.

      When pointing to a GitLab private repository that has devfile.yaml at the root of the repository, it gets the following error:

       

      {{2023-07-19 22:37:53,849[nio-8080-exec-3]  [DEBUG] [.e.c.a.f.s.u.URLFactoryBuilder 128]  - Unreachable devfile location met: https://gitlab.mycompany.com/api/v4/projects/openshift%2Fdevspace-platform/repository/files/devfile.yaml/raw. Error is: Server returned HTTP response code: 400 for URL: https:// gitlab.mycompany.com /api/v4/projects/openshift%2Fdevspace-platform/repository/files/devfile.yaml/raw

      }}

      When you try to access the above link, you get: 

      {{

      {"error":"ref is missing, ref is empty"}

      }}

       

      According to GitLab's API docs, ref is a required field to list repository: https://docs.gitlab.com/ee/api/repository_files.html

       

      and if you add ?ref=main to the URL (like https://gitlab.mycompany.com/api/v4/projects/openshift%2Fdevspace-platform/repository/files/devfile.yaml/raw?ref=main), it returns the devfile. 

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      Use a hosted GitLab private repository URL that has devfile at the root to create a workspace. 

      Actual results:

      Devfile could not be found. Applying default configuration.

      Expected results:

      Workspace environment to be created based on the devfile.yaml in the repository.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Acceptance criteria: 

      Able to create workspace from devfile inside the private GitLab repository (hosted) where OAuth config is in place

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

       

       *

              ivinokur-1 Ihor Vinokur
              ckavili1@redhat.com Cansu Kavili Örnek
              Shmaraiev Oleksandr Shmaraiev Oleksandr
              Jana Vrbkova Jana Vrbkova
              Votes:
              8 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: