che-server icon indicating copy to clipboard operation
che-server copied to clipboard

Throw an error if Devfile from unsupported ssh repository is not resolved

Open vinokurig opened this issue 11 months ago • 8 comments

What does this PR do?

Throw an error if Devfile from unsupported ssh repository is not resolved instead of returning an empty factory dto without devfile. The ApiException will be handled by dashboard and default devfile will be used: https://github.com/eclipse-che/che-dashboard/blob/05bf4383a45cb367924c788763beb5c7689a7c79/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/index.tsx#L215

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://github.com/eclipse-che/che/issues/23277

How to test this PR?

  1. Deploy che with the pull request image: quay.io/eclipse/che-server:pr-763
  2. Start workspcae from an ssh url of an unsupported provider e.g. [email protected]:ivinokur/test.git

See workspace starts from the default devfile.

PR Checklist

As the author of this Pull Request I made sure that:

Release Notes

Reviewers

Reviewers, please comment how you tested the PR when approving it.

vinokurig avatar Feb 13 '25 14:02 vinokurig

/retest

vinokurig avatar Feb 14 '25 07:02 vinokurig

/retest

vinokurig avatar Feb 17 '25 12:02 vinokurig

@dmytro-ndp Why do we need a separate issue for the case described in the pull request? From the current issue description:

A typical example is when it's not GitHub, GitLab, Bitbucket or Azure DevOps repository or when SSH URL is used.

The pull request fixes the case when an SSH url from an unsupported provider is used, which is mentioned in the description above. But if you insist, I can create a separate issue.

vinokurig avatar Feb 18 '25 16:02 vinokurig

/retest

artaleks9 avatar Feb 18 '25 18:02 artaleks9

@vinokurig: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v14-gitlab-with-oauth-setup-flow 5715f7e85199fdc51c561927536715206c61d5e5 link true /test v14-gitlab-with-oauth-setup-flow

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Feb 18 '25 19:02 openshift-ci[bot]

@vinokurig : thank you for the answer!

If I understood the following description of issue #22025 correctly, an SSH URL from an unsupported provider should work in Eclipse Che:

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...).

As far as I remember, I was able to create and open a workspace from a Gogs Git repository using a GIT+SSH link (ssh://[email protected]:10022/test/quarkus-api-example-public.git) in Eclipse Che 7.98.x, and the devfile from the Git repository was successfully applied.

My concern is that, to avoid regression, it makes sense to ensure that Eclipse Che continues to support this functionality after this PR is merged. For example, someone could create a PR for the Dashboard to properly handle 500 server errors from Che Server in case of SSH url from unsupported provider like Gogs, and merge it together with this PR.

dmytro-ndp avatar Feb 20 '25 19:02 dmytro-ndp

@dmytro-ndp are we good to backport it to 7.98.x in order to properly resolve the SSH flow?

ibuziuk avatar Feb 24 '25 11:02 ibuziuk

@vinokurig : thank you for clarifying the PR test scenario and for opening a dedicated issue to describe the fix use case.

The PR has been successfully tested using Eclipse Che Next with che-server quay.io/eclipse/che-server:pr-763

Test scenario:

Preparation:

  1. Create private repo with devfile in Gogs server.
  2. Add public SSH key to Gogs server.
  3. Open Eclipse Che and add SSH key to User Preferences in User Dashboard.

Test creation of workspace using correct Gogs server SSH URL

  • Workspace created successfully.
  • Project cloned correctly.
  • Devfile from the git repo has been applied.

Test creation of workspace using incorrect Gogs server SSH URL

Workspace created successfully without warning message The specified link does not contain any Devfile. Continue with default devfile?.

Screencast

screen-capture (5).webm

@ibuziuk: +1 to backport this PR to 7.98.x branch in order to properly resolve the SSH flow.

dmytro-ndp avatar Feb 25 '25 19:02 dmytro-ndp

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dmytro-ndp, 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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Feb 25 '25 19:02 openshift-ci[bot]

Build 3.20 :: server_3.x/385: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/8838 triggered

devspacesbuild avatar Feb 26 '25 10:02 devspacesbuild