Che: Allow Che 7 Git + SSH Flow

Created on 7 Jun 2019  路  17Comments  路  Source: eclipse/che

The problem

As mentioned in #12850 git+ssh is currently not working (cloning a project). A user is able to generate an SSH key pair with the ssh plugin (even if currently this plugin doesn't seems to be included in che-theia) but:

  • cloning may happen at IDE startup (a user won't be able to generate the keys)
  • git in che-theia doesn't support SSH
  • ssh keys are only available in che-theia container

The proposed flow

Here is a list of steps/task of a git+ssh flow that I have splitted in 3 priority levels:

馃critical for the GA: allow SSH key persistence and usage
馃惔nice to have for the GA: automate for a better UX and get rid of the SSH plugin
馃惍postponed after the GA: leverage GitHub token when available to automate even more

First time user login

  • [x] 馃惔Generate SSH keys when the user login for the first time and store them in user preferences #14411
  • [ ] 馃惍If a GitHub token is available upload the SSH key to GitHub

At workspace creation:

  • [x] 馃mount the SSH keys as secrets in all workspace containers #13520
  • [x] 馃惔setup (or mount?) git config (name and email) #13874

At workspace cloning with git+ssh:

  • [ ] 馃惔Check if the user can authenticate
  • [ ] 馃惔If the user cannot be auth but it's a GitHub URL

    • [ ] 馃惍If we have his GitHub token: automatically upload the SSH key

    • [ ] 馃惔If we don't have his GH token prompt him to upload the key manually

  • [ ] 馃惔If the user cannot be authenticated and it's not GitHub prompt the user to do the following steps after the workspace is started 1) generate the key using the addon if that hasn't been done yet 2) add its SSH public key to the git server 3) clone the project or restart the workspace

Misc

  • [x] 馃Add git+ssh support in che-theia container #12850
  • [x] 馃Enable the SSH plugin
  • [ ] 馃惔Make sure that current Che 7 stacks have git+ssh support
  • [ ] 馃惔Add git+ssh scenario in e2e happy path tests
aregit kinepic lifecyclfrozen teaplugins

Most helpful comment

We have discussed that the current behavior of the SSH plugin should be changed.

  1. There should be 2 generate commands: SSH: generate key pair... and SSH: generate key pair for particular host...
  2. SSH: generate key pair for particular host... works as the currently implemented in https://github.com/eclipse/che-theia/pull/352/files
  3. SSH: generate key pair... instead would add a key for the generic host
Host *
  IdentityFile <path>
  1. SSH: generate key pair... would send a request the the SSH manager with parameters { "service" : "vcs", "name": "default-<timestamp>"}
  2. When a user call SSH: generate key pair... a second time a new key will be generated and added, the previous keys won't be deleted.

All 17 comments

@vparfonov @evidolob can you please review and split up the critical tasks (馃) amongst your teams?
cc @slemeur @sunix @benoitf please review as well

@l0rd I thought git+ssh was working on che-theia. What are the steps used to have it "not working" ?

@l0rd聽I thought git+ssh was working on che-theia. What are the steps used to have it "not working" ?

@benoitf that's described here #12850

@l0rd OK somehow the previous fix has been lost, will fix it.

FYI SSH plugin for shh key management use wsagent at the moment

@vparfonov as a first step a user need to be able to:

  • add an SSH key-pair to the user preferences (it can be through the SSH plugin or another plugin)
  • use his SSH key-pair with the git client (mount it as a secret in che-theia and other containers)

Adding a command to generate the key-pair is something that can be done as second step: initially we can request users to generate the key pair manually.

We have reviewed this with @vparfonov and we are not going to address the problem of the git+ssh within a container where the user doesn't exist (arbitrary user). @vparfonov is going to create an issue instead that is going to be added to the known issue section in the documentation.

We have discussed that the current behavior of the SSH plugin should be changed.

  1. There should be 2 generate commands: SSH: generate key pair... and SSH: generate key pair for particular host...
  2. SSH: generate key pair for particular host... works as the currently implemented in https://github.com/eclipse/che-theia/pull/352/files
  3. SSH: generate key pair... instead would add a key for the generic host
Host *
  IdentityFile <path>
  1. SSH: generate key pair... would send a request the the SSH manager with parameters { "service" : "vcs", "name": "default-<timestamp>"}
  2. When a user call SSH: generate key pair... a second time a new key will be generated and added, the previous keys won't be deleted.

@vparfonov I am removing this issue from 7.0.0 since all the GA stuff has been addressed. Setting it 7.1.0

@azatsarynnyy @vparfonov Preserving the known_hosts between workspaces/sessions and git config for user and mail #13874 are the 2 priority issues on this flow as far as I can see.

@gorkem we're finalizing preserving git config.
known_hosts issue is planned for the next sprint.

So I guess this has slipped to 7.2.0? fixing milestone accordingly.

@nickboldt part of it has been implemented in 7.1.0, another part will be implemented in 7.2.0 but I am not sure that everything will be completed at the end of this sprint. In particular the part mentioned in First time user login is not planned yet.

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

How much is there left to do here? It seems the vast majority of use cases are solved, maybe it's time we close this one and use a more recent ticket?

@ericwill what is currently missing is checking if the user has privileges to clone at the startup of the workspace. Current UX is not ideal if you click on a factory link of a devfile with a git+ssh URL and you do not have the SSH key uploaded on the git server yet.

@ericwill what is currently missing is checking if the user has privileges to clone at the startup of the workspace. Current UX is not ideal if you click on a factory link of a devfile with a git+ssh URL and you do not have the SSH key uploaded on the git server yet.

@ericwill in this sprint and next one platform team is working on something that is related to that

Was this page helpful?
0 / 5 - 0 ratings

Related issues

l0rd picture l0rd  路  3Comments

InterestedInTechAndCake picture InterestedInTechAndCake  路  3Comments

skabashnyuk picture skabashnyuk  路  3Comments

JamesDrummond picture JamesDrummond  路  3Comments

luckymore0520 picture luckymore0520  路  3Comments