-
Notifications
You must be signed in to change notification settings - Fork 72
Support GitHub repository devfile url #793
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
Conversation
@@ -128,6 +128,6 @@ public RemoteFactoryUrl parseFactoryUrl(String factoryUrl) throws ApiException { | |||
|
|||
@Override | |||
public FactoryResolverPriority priority() { | |||
return HIGHEST; | |||
return LOWEST; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vinokurig hmm, why raw Devfile has the lowest priority now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the repository devfile url may matc the RAW devfile url pattern, so we need to check the provider resolvers first.
/retest |
Verified on Eclipse Che with |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: artaleks9, ibuziuk, tolusha, vinokurig The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Build 3.21 :: server_3.x/400: Console, Changes, Git Data |
Build 3.21 :: sync-to-downstream_3.x/9147: Console, Changes, Git Data |
Build 3.21 :: push-latest-container-to-quay_3.x/5136: Console, Changes, Git Data |
Build 3.21 :: get-sources-rhpkg-container-build_3.x/9280: server : 3.x :: Build 67304025 : quay.io/devspaces/server-rhel9:3.21-6 |
Build 3.21 :: server_3.x/400: Upstream sync done; /DS_CI/sync-to-downstream_3.x/9147 triggered |
Build 3.21 :: update-digests_3.x/8976: Console, Changes, Git Data |
Build 3.21 :: operator-bundle_3.x/4753: Console, Changes, Git Data |
Build 3.21 :: sync-to-downstream_3.x/9148: Console, Changes, Git Data |
Build 3.21 :: get-sources-rhpkg-container-build_3.x/9281: devspaces-operator-bundle : 3.x :: Failed in 67304261 : BREW:BUILD/STATUS:UNKNOWN |
What does this PR do?
Add an ability to start a workspace from the repository url of a devfile e.g.
https://github.com/vinokurig/test/blob/master/devfile.yaml
This will be an experimental feature and will be applied only for GitHub.Since GitHub url defines branch as a segment of the file path e.g.
https://github.com/user/repository/blob/branch/file
, we can not distinguish a branch with/
from the path. For instance we can have such path:/branch/with/slash/file
in the url, so we can not parse it as<branch>/<path to file>
as both branch and path may contain/
, see.In this implementation when parsing a file path from a url, we give the priority to the file path, so when parsing
/branch/with/slash/file
, we assume thatbranch
=>branch/with/slash
andfile path
=>file
With this solution we can generate RAW devfile url from a repository url like:
https://github.com/user/repository/blob/branch/path/to/devfile.yaml
, but we passbranch/path/to
to the factory parameters, and as a result the project clone will fail and the default branch will be used. However, we do not break the existing functionality that allows to start a workspace with branch that has/
in its name.Screenshot/screencast of this PR
What issues does this PR fix or reference?
fixes eclipse-che/che#23390
How to test this PR?
quay.io/eclipse/che-server:pr-793
https://github.com/vinokurig/test/blob/master/path/devfile.yaml
See: devfile from the directory
path
is resolved.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedRelease Notes
Reviewers
Reviewers, please comment how you tested the PR when approving it.