Skip to content
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

Ability to create workspace from devfile path in git repo URL #23169

Open
AObuchow opened this issue Sep 27, 2024 · 3 comments
Open

Ability to create workspace from devfile path in git repo URL #23169

AObuchow opened this issue Sep 27, 2024 · 3 comments
Labels
area/dashboard kind/enhancement A feature request - must adhere to the feature request template. severity/P3 Lower priority than a P2. Optional work that might get done, or not. See also help wanted issues. status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach

Comments

@AObuchow
Copy link

Is your enhancement related to a problem? Please describe

It's unintuitive how giving the direct path to a devfile in a git repo doesn't work for creating a workspace. For example, if you try starting a workspace from the following URL https://github.com/che-samples/web-nodejs-sample/blob/main/devfile.yaml, you'll get the following error:
image

Instead, you need to use the following URL https://github.com/che-samples/web-nodejs-sample/.

Describe the solution you'd like

It'd be nice if you could start a workspace by providing a git repo URL with the branch name & path to a devfile, such as https://github.com/che-samples/web-nodejs-sample/blob/main/devfile.yaml.

When doing so, I'd expect this to be interpreted as the Dashboard git repo options having the branch selected as well as the devfile path configured:

image

Describe alternatives you've considered

No response

Additional context

No response

@AObuchow AObuchow added kind/enhancement A feature request - must adhere to the feature request template. area/dashboard labels Sep 27, 2024
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Sep 27, 2024
@AObuchow AObuchow changed the title Ability to create workspace from devfile path in git repo link Ability to create workspace from devfile path in git repo URL Sep 27, 2024
@RomanNikitenko
Copy link
Member

@AObuchow
it's possible to create a workspace from a raw devfile, like https://raw.githubusercontent.com/RomanNikitenko/web-nodejs-sample/refs/heads/testPR/devfile.yaml

But I agree about

It's unintuitive how giving the direct path to a devfile in a git repo doesn't work for creating a workspace

and I don't know if the raw devfile way can be used as a workaround for the described issue...

@ibuziuk ibuziuk added status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach severity/P3 Lower priority than a P2. Optional work that might get done, or not. See also help wanted issues. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Sep 30, 2024
@ibuziuk
Copy link
Member

ibuziuk commented Sep 30, 2024

@AObuchow
Copy link
Author

@ibuziuk The df (devfilePath) parameter works, but only if the repo is given in the expected https://<che_fqdn>#<git_repository_url>?df=<filename>.yaml format, for example https://github.com/che-samples/web-nodejs-sample?devfilePath=devfile.yaml.

If you try taking the git repo URL that includes the branch & the devfile path, and then concatenate ?devfilePath=<path-to-devfile>, such as https://github.com/che-samples/web-nodejs-sample/blob/main/devfile.yaml?devfilePath=devfile.yaml it will not work and you'll get the same error as I originally reported.

image

Something that might be insightful: the above error is complaining about the Git provider: The Git provider is not supported.. I'm not exactly sure how the dashboard factory logic works, but it might be that the git provider regex is not configured to catch this case (where a git branch using /blob/ is provided, as well as a path to the devfile).

Additional testing

I tried removing the devfile file path from the URL, i.e.: https://github.com/che-samples/web-nodejs-sample/blob/main/devfile.yaml -> https://github.com/che-samples/web-nodejs-sample/blob/main, and this is not recognized as a valid git URL:
image

Note that https://github.com/che-samples/web-nodejs-sample/blob/main actually redirects you to https://github.com/che-samples/web-nodejs-sample/tree/main (/blob/ gets replaced with /tree/).

The link with /tree/ will work when provided in the Dashboard: https://github.com/che-samples/web-nodejs-sample/tree/main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard kind/enhancement A feature request - must adhere to the feature request template. severity/P3 Lower priority than a P2. Optional work that might get done, or not. See also help wanted issues. status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach
Projects
None yet
Development

No branches or pull requests

4 participants