Skip to content

Unable to parse Devfile with parent on GitHub: url path to directory or file should contain 'tree' or 'blob' if parent is a GitHub release artifact, or failed to switch repo to revision if parent is a blob or raw URL #1119

Closed
@rm3l

Description

@rm3l

Which area this feature is related to?

/kind bug

Which area this bug is related to?

/area library

What versions of software are you using?

Go project

Operating System and version:
Fedora 38

Go Pkg Version:
Latest commit on the main branch: devfile/library@f041d79

Bug Summary

Describe the bug:

In redhat-developer/odo#6768, we have updated the Devfile library to the latest commit. And now, some of our tests are failing due to Devfile parsing issues.

To Reproduce:
I've narrowed down this issue to the following reproduction steps:

  1. Sample Devfile
$ cat << EOF > /tmp/devfile-issue-with-parent-uri.yaml
schemaVersion: 2.1.0
metadata:
  name: new-ol-version
  description: Child devfile to test OL image updating
parent:
  uri: https://github.com/OpenLiberty/application-stack/releases/download/maven-0.7.0/devfile.yaml
  components:
    - name: dev
      container:
        image: maven:3.6-adoptopenjdk-11-openj9
EOF
  1. Parser is now failing (I'm running this from the library repo: https://github.com/devfile/library/blob/main/main.go)
$ go run .  /tmp/devfile-issue-with-parent-uri.yaml        

parsing devfile from /tmp/devfile-issue-with-parent-uri.yaml
failed to populateAndParseDevfile: url path to directory or file should contain 'tree' or 'blob'

NOTES:

$ go run .  /tmp/devfile-issue-with-parent-uri.yaml
parsing devfile from /tmp/devfile-issue-with-parent-uri.yaml
failed to populateAndParseDevfile: 1 error occurred:
        * failed to switch repo to revision. repo dir: /tmp/git-resources2839940370, revision: maven-0.7.0
$ go run .  /tmp/devfile-issue-with-parent-uri.yaml
parsing devfile from /tmp/devfile-issue-with-parent-uri.yaml
failed to populateAndParseDevfile: 1 error occurred:
        * failed to switch repo to revision. repo dir: /tmp/git-resources3340282075, revision: maven-0.7.0

Expected behavior

  • Is it intentional that we cannot reference a parent from a GitHub release artifact?
  • I guess however that using the raw or blob URLs should have worked correctly.

Suggestion on how to fix the bug

Metadata

Metadata

Assignees

Labels

area/libraryCommon devfile library for interacting with devfileskind/bugSomething isn't working

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions