-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
Comments
url path to directory or file should contain 'tree' or 'blob'
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
This would change the behavior of `odo init`. Furthermore, due to an issue [1] in the Devfile library, it is not possible to parse some Devfiles with parents linked as GitHub URLs (like GitHub release artifacts). [1] devfile/api#1119 Co-authored-by: Philippe Martin <phmartin@redhat.com>
It seems like using |
Thanks, @mike-hoang !! Another point about error handling: would it be possible to wrap the original error of the |
Back to the original issue, the Devfile in our tests contains a parent referenced via a GitHub release artifact URL. |
When testing, I ran into some issues where checkout would still work: ➜ devfile-stack git:(fcee161) git switch --detach master
fatal: '--detach' cannot be used with '-b/-B/--orphan'
➜ devfile-stack git:(fcee161) git checkout master
Previous HEAD position was fcee161 Merge pull request #166 from mezarin/portDevfileRegDevfileUpdatesToStack
branch 'master' set up to track 'origin/master'. So I think
Yup I can wrap the git error
Yes, with the recent changes this will not work anymore. I wasn't aware that release artifact urls were being used, maybe this can be raised in the community call? |
Yes, why not! I'll add it to the agenda. I wasn't aware of that fact either, until I stumbled upon this in our tests :-) At first, I thought we were not using the So, unless I'm missing something from the docs/spec, it looks like it should be possible to use any hosted I tried to workaround this issue by serving the Devfile from a test HTTP server, but the parser was expecting a GitHub, Gitlab or BitBucket host. # With this URI: http://localhost:5000/devfile.yaml
$ go run . /tmp/devfile-issue-with-parent-uri.yaml
parsing devfile from /tmp/devfile-issue-with-parent-uri.yaml
failed to populateAndParseDevfile: url host should be a valid GitHub, GitLab, or Bitbucket host; received: localhost:5000 |
* Add integration tests highlighting our expectations * Bump Devfile library to latest commit devfile/library@f041d79 * Expose preference that allows users to globally configure an image registry * Return the effective Devfile view by default from the initial context This is supposed to be read-only, so that tools can rely on it and to the operations they need to perform right away. Raw Devfile objects can still be obtained upon request if there is need to update them (for example via 'odo add/remove binding' commands. * Pass the image registry preference to the Devfile parser to build the effective view * Fix 'odo init' integration tests - The test spec was actually not doing what it was supposed to do - Now 'odo init' returns a complete Devfile, where the parent is flattened, because the goal of 'odo init' is to bootstrap a Devfile. Previously, 'odo init' would not download the parent referenced, making it hard to understand the resulting Devfile. * Document how odo now handles relative image names as selectors * fixup! Document how odo now handles relative image names as selectors Co-authored-by: Philippe Martin <phmartin@redhat.com> * Revert "Fix 'odo init' integration tests" This reverts commit 78868b0. Co-authored-by: Philippe Martin <phmartin@redhat.com> * Do not make `odo init` return an effective Devfile as a result This would change the behavior of `odo init`. Furthermore, due to an issue [1] in the Devfile library, it is not possible to parse some Devfiles with parents linked as GitHub URLs (like GitHub release artifacts). [1] devfile/api#1119 Co-authored-by: Philippe Martin <phmartin@redhat.com> * fixup! Document how odo now handles relative image names as selectors --------- Co-authored-by: Philippe Martin <phmartin@redhat.com>
Yes, this should be the correct behaviour 😄 |
@rm3l pr has been merged now which should allow the Let me know if you run into more issues! |
This fixes the issue with parsing child Devfiles referencing parents via URIs (GitHub blob, raw or any hosted URL). See [2] for more context. [1] devfile/library@04a8b3f [2] devfile/api#1119
Thanks @mike-hoang !! I've just tested that your changes work with |
This fixes the issue with parsing child Devfiles referencing parents via URIs (GitHub blob, raw or any hosted URL). See [2] for more context. [1] devfile/library@04a8b3f [2] devfile/api#1119
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@f041d79Bug 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:
NOTES:
blob
one (https://github.com/OpenLiberty/devfile-stack/blob/maven-0.7.0/templates/devfiles/maven/devfile.yaml), but the parser still fails:raw
one (https://raw.githubusercontent.com/OpenLiberty/devfile-stack/maven-0.7.0/templates/devfiles/maven/devfile.yaml), but the parser still fails:Expected behavior
raw
orblob
URLs should have worked correctly.Suggestion on how to fix the bug
The text was updated successfully, but these errors were encountered: