Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-39343

The filepath including leading slash makes error during parsing devfile using Gitlab

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • None
    • 4.15.z
    • Dev Console
    • Moderate
    • No
    • ODC Sprint 3262, ODC Sprint 3263
    • 2
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Release Note Not Required
    • In Progress

      This is a clone of issue OCPBUGS-33199. The following is the description of the original issue:

      Description of problem:

      When creating an application based on devfile "Import from Git" in Developer console using only GitLab repo, the following error block to create it.
      It only happened when using GitLab, not Github. And CLI operation based on "oc new-app" could work well. In other words, the issue is only for Dev console.  
      
        Could not fetch kubernetes resource "/deploy.yaml" for component "kubernetes-deploy" from Git repository https://{gitlaburl}.
      

      Version-Release number of selected component (if applicable):

      4.15.z
      

      How reproducible:

      Always
      

      Steps to Reproduce:

      You can always reproduce according to the following procedures.
      a. Switch "Developer" mode at your web console.
      b. Move "+Add", then click "Import from Git" in "Git Repository" section at the page.
      c. Input "https://<GITLAB HOSTNAME>/XXXX/devfile-sample-go-basic.git" to the "Git Repo URL" text box.
      d. Select "GitLab" at "Git type" drop box.
      e. You can see the below error messages.
      

      Actual results:

      The "/deploy.yaml" file path evaluated as invalid one with 400 response status during the process as follows.
      Look at the URL, "/%2Fdeploy.yaml" shows us leading slash was duplicated there.
      
        Request URL:
          https://<GITLAB HOSTNAME>/api/v4/projects/yyyy/repository/files/%2Fdeploy.yaml/raw?ref=main
        Response:
          {"error":"file_path should be a valid file path"}
      

      Expected results:

       The request URL for handling "deploy.yaml" file should be removed the duplicated leading slash and provide correct file path.
      
       Request URL:
         https://<GITLAB HOSTNAME>/api/v4/projects/yyyy/repository/files/deploy.yaml/raw?ref=main
       Response:
         "deploy.yaml" contents.
      

      Additional info:

      I submitted a pull request to fix this here: https://github.com/openshift/console/pull/13812 

              rh-ee-lprabhu Lokananda Prabhu
              openshift-crt-jira-prow OpenShift Prow Bot
              Sanket Pathak Sanket Pathak
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: