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

Support GIT+SSH URLs when starting workspaces #22025

Closed
l0rd opened this issue Mar 2, 2023 · 5 comments · Fixed by eclipse-che/che-dashboard#786
Closed

Support GIT+SSH URLs when starting workspaces #22025

l0rd opened this issue Mar 2, 2023 · 5 comments · Fixed by eclipse-che/che-dashboard#786
Assignees
Labels
area/git/oauth-services OAuth support to authenticate developers with their GitHub, GitLab, Bitbucket etc...accounts kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system. sprint/next team/A This team is responsible for the Che Operator and all its operands as well as chectl and Hosted Che team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs.

Comments

@l0rd
Copy link
Contributor

l0rd commented Mar 2, 2023

Is your enhancement related to a problem? Please describe

Today it's not possible to start a workspace from an git repository URL using the GIT+SSH protocol: [email protected]:eclipse/che.git.

Even if the user has configured an SSH secret to be automatically mounted in workspaces and had uploaded the public key in its git service, starting a workspace won't work.

Describe the solution you'd like

If a user has configured SSH (secret created in his namespace + key uploaded to git service) or a git credential secret, then Che should be able to start a workspace from a GIT+SSH repository URL: if there is a devfile at the root of the git repo it should be used to define the corresponding DevWorkspace.

I think there are 3 possible solutions here:

  • che server downloads the devfile without cloning the git repository (not sure git+ssh allows this)
  • the dashboard creates a devworkspace that has an init container that, after cloning the source code, patches the DW CR with the content of the devfile using the devworkspace-generator npm library (similar to @amisevsk work)
  • che server does a git clone in a local temporary directory (depth 1 and sparse) and returns the devfile content (this is fragile)

Other considerations

Through the GIT+SSH protocol Che would be able to fully support any git service. That won't replace the HTTP + OAuth flow that remains the preferred if support (GitHub, BB, GitLab and Azure DevOps), but an alternative that allows Che to work on other services too (gerrit, gogs, githut...).

Screenshots

Dashboard doesn't even allow to provide a git repo URL that doesn't use HTTP: ⬇️
image

That what happen if I try the URL https://<che-host>/f?url=git%40github.com%3Al0rd%2Fgo-hello-world.git ⬇️
image

@l0rd l0rd added the kind/enhancement A feature request - must adhere to the feature request template. label Mar 2, 2023
@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 Mar 2, 2023
@l0rd l0rd added area/git/oauth-services OAuth support to authenticate developers with their GitHub, GitLab, Bitbucket etc...accounts severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Mar 2, 2023
@ibuziuk ibuziuk added sprint/next team/A This team is responsible for the Che Operator and all its operands as well as chectl and Hosted Che labels Mar 2, 2023
@ibuziuk ibuziuk mentioned this issue Mar 6, 2023
45 tasks
@ibuziuk ibuziuk mentioned this issue Mar 21, 2023
50 tasks
@ibuziuk ibuziuk added the team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs. label Mar 21, 2023
@ibuziuk ibuziuk moved this to 📅 Planned in Eclipse Che Team A Backlog Mar 31, 2023
@ibuziuk ibuziuk moved this from 📅 Planned to 🚧 In Progress in Eclipse Che Team A Backlog Apr 13, 2023
@svor svor moved this from 🚧 In Progress to ✅ Done in Eclipse Che Team A Backlog May 1, 2023
@l0rd
Copy link
Contributor Author

l0rd commented May 1, 2023

Re-opening this issue because I am afraid that there is still a missing part: the devfile in the git repository is ignored. This issue was about:

  • not failing when a GIT+SSH URL was provided (this is done)
  • using the devfile in the git repo to define the DevWorkspace (this is not done yet)

@l0rd l0rd reopened this May 1, 2023
@svor svor moved this from ✅ Done to 🚧 In Progress in Eclipse Che Team A Backlog May 1, 2023
@olexii4
Copy link
Contributor

olexii4 commented May 1, 2023

Re-opening this issue because I am afraid that there is still a missing part: the devfile in the git repository is ignored. This issue was about:

  • not failing when a GIT+SSH URL was provided (this is done)
  • using the devfile in the git repo to define the DevWorkspace (this is not done yet)

@l0rd Could you add more pieces of information on why you think so?
Unfortunately, I can't reproduce this issue.

@l0rd
Copy link
Contributor Author

l0rd commented May 1, 2023

@olexii4 Sorry I haven't tested or review the PR. I was assuming that the work that has been completed dashboard-side only and that the devfile cannot be resolved from a GIT+SSH URL. I am probably wrong though. Can you please help me understanding how the resolution is done?

@olexii4
Copy link
Contributor

olexii4 commented May 1, 2023

@olexii4 Sorry I haven't tested or review the PR. I was assuming that the work that has been completed dashboard-side only and that the devfile cannot be resolved from a GIT+SSH URL. I am probably wrong though. Can you please help me understanding how the resolution is done?

I found that the che-server part, which was added with the next PR does not work properly.

It always resolves the default defile:
Знімок екрана 2023-05-01 о 18 35 54

@tolusha WDYT?

@svor svor moved this from 🚧 In Progress to 📅 Planned in Eclipse Che Team A Backlog May 2, 2023
@l0rd
Copy link
Contributor Author

l0rd commented Jul 11, 2023

Closing as this is mostly done. I have opened a separate issue for the missing part:

@l0rd l0rd closed this as completed Jul 11, 2023
@ibuziuk ibuziuk moved this from 📋 Backlog to ✅ Done in Eclipse Che Team A Backlog Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/git/oauth-services OAuth support to authenticate developers with their GitHub, GitLab, Bitbucket etc...accounts kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system. sprint/next team/A This team is responsible for the Che Operator and all its operands as well as chectl and Hosted Che team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants