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

Implement Import From Git option on Get Started page #15527

Closed
sleshchenko opened this issue Dec 18, 2019 · 16 comments
Closed

Implement Import From Git option on Get Started page #15527

sleshchenko opened this issue Dec 18, 2019 · 16 comments
Labels
area/dashboard kind/enhancement A feature request - must adhere to the feature request template. status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering.

Comments

@sleshchenko
Copy link
Member

Is your enhancement related to a problem? Please describe.

Implement Import From Git option on Get Started page.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@sleshchenko sleshchenko added kind/enhancement A feature request - must adhere to the feature request template. status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering. area/dashboard labels Dec 18, 2019
@sleshchenko
Copy link
Member Author

@beaumorley Hello,

Could you please help us determinate how Import From Git workflow should be in Che Dashboard.
I can imagine that it should be something like OpenShift DevConsole provides for creating an application:
Screenshot_20191218_143656
Screenshot_20191218_143815

But it also needed to keep in mind that Git repository can contain Devfile, like Che Repo has https://github.com/eclipse/che/blob/master/devfile.yaml. Then the dashboard should tell user that they are able to reuse Devfile from repo or use new one from samples.

@beaumorley
Copy link

beaumorley commented Dec 18, 2019

Sure. I am very familiar with that OpenShift screen.

Will this Import from Git option be available from the Ready-To-Go Stack screen or just the new Import Dev File screen? I know that the existing Ready-To-Go Stack screen already has an import from Git option under Projects. So I will assume this is just for the Import Devfile screen for now.

Here is a first stab at a simple mockup . I put the import from git first since you said the user may/may not need to add a dev file depending on their repo. Also, I am not sure what fields you need added to the form. If you let me know I can build on this.

image

I would consider changing the name of the tabs for the two screen views:

  • Templates - currently what you are calling of Ready-to-go
  • Custom Stack - currently what you are calling Import Devfile

Also, I am not sure I understand what the request is here: "... the dashboard should tell user that they are able to reuse Devfile from repo or use new one from samples." Are you thinking we need instructional text that lets the user know they only need to add a Devfile if they don't have one? Is there any way to detect whether there is one after the git import? If so we could ask for the devfile as a second step only when needed. I added some text in blue to the mockup above as a starting point.

@olexii4
Copy link
Contributor

olexii4 commented Dec 23, 2019

@beaumorley Sorry, but we cannot have this widget 'from Git' as is
because a custom devfile can contain several projects.

I think a popup which is called with the button 'Add project' could be better.

The project can already contain a devfile. And it can be interesting for the user to create a new workspace for this project from another devfile(it can be one from the Ready-to-go stacks).

As I understand in the case with import project 'from Git' we don't want to use an existing devfile. In the other case, we can import a devfile from the project repo.

@akurinnoy, @sleshchenko, @slemeur WDYT?

@akurinnoy
Copy link
Contributor

@beaumorley Hi!

My thoughts about "Getting Started" page.
I see it as a place from where newcomers are becoming familiar with Che. They should be able to start their first workspace from available template. But some of them will want to import and try their own project - GitHub repo - and it should be done I suppose on this very page. At this point it doesn't matter if GitHub repo have its own devfile or contains bunch of samples, it should be treated as a plain project.

@akurinnoy
Copy link
Contributor

akurinnoy commented Dec 24, 2019

@sleshchenko Hello!

I see your point but "Getting Started" page should be as simple as possible that's why I don’t agree with

the dashboard should tell user that they are able to reuse Devfile from repo or use new one from samples

maybe, somewhere else, but not on this page

@akurinnoy
Copy link
Contributor

akurinnoy commented Dec 24, 2019

@olexii4 Hi!

Maybe I didn’t understand you correctly, but I seem that you mixed creating workspaces by importing already prepared devfiles and creating them from templates.

Also, I don't see how your comment relates to "Getting Started” page. Authoring custom devfiles is rather an advanced usage of Che. Could you elaborate on this?

@olexii4
Copy link
Contributor

olexii4 commented Dec 24, 2019

@akurinnoy Yes. You are right. It is about 'Get Started' page.
I understand this flow as a redirection to another page for adding a project because it was noted in the issue #15520

There is no a page we can reuse for Import From Git, a dedicated issue will be registered to handle this workflow.
For Create a Custom Workspace workflow we're going to reuse existing Create Workspace page. If needed a dedicated issue should be registered to improve this page.

And, as I wrote, it should be a popup.

@akurinnoy
Copy link
Contributor

akurinnoy commented Dec 24, 2019

Another thing is that a template, which is a devfile under hood, consists of project(s), component(s) and commands bound together. Replacing existing project with another one may bring something unexpected, i.e. commands are not working, or workspace fails to start.

So, my question is do we even need to implement "Import from Git" option on "Getting Started" page?

@gazarenkov
Copy link
Contributor

How do you do Import from devfile stored in a Git repo?

As I understand in general case you have to clone a git repo somewhere (where?) and take this devfile from sources beforehand, no?

@sleshchenko
Copy link
Member Author

How do you do Import from devfile stored in a Git repo?

Currently, it's possible only with public repositories located by git providers that provide REST API to get files content, like GitHub.

As I understand in general case you have to clone a git repo somewhere (where?) and take this devfile from sources beforehand, no?

You're right but we do not support it in general case.

@gazarenkov
Copy link
Contributor

@sleshchenko
thanks, that what I suspected too.
It's like you know the GitHub API and make a URL for GET request concatenating GH repo URL and "devfile" or so...

I wonder, why not to make it more generic but instead of saying "Import from Git" (which is not truth) call it "Import from URL" (or so) and ask to provide a real URL where devfile lives instead?

@sleshchenko
Copy link
Member Author

sleshchenko commented Jan 9, 2020

I wonder, why not to make it more generic but instead of saying "Import from Git" (which is not truth) call it "Import from URL" (or so) and ask to provide a real URL where devfile lives instead?

We would like to propose something like that. But also provide users an ability to use Git Repo link that does not contain devfile at all, it should allow users easy to start. So, our proposal is the following:
There are two options to create workspaces:

  1. Get started Introduce Get Started page that will be open if there are no workspaces #15520 with an option Create Custom Workspace, see 2
  2. Create Custom Workspace (Import from URL could be considered as name well) that replaces existing Import Devfile + Ready-to-go-stacks.
    At the bottom, there is an input URL, and behavior is different according to that URL format:
    2.1. If the specified URL is url to content of a devfile or a GitHub repository that already contains devfile - we show it to the user and propose to create a workspace with it or process editing in Yaml Editor.
    2.2. If we do not resolve devfile in the specified url - we propose for the user to supply it as a git repository reference, and choose a template(from devfile registry) he would like to proceed.
  • One difficulty here is the fact that a template, which is a devfile under the hood, consists of project(s), component(s) and commands bound together. Replacing the existing projects with another one may bring something unexpected, i.e. commands are not working, or workspace fails to start.

@gazarenkov WDYT? Maybe as an easier and more straightforward option, we could go without 2.2 and then if a user wants to start with the project without devfile - they should choose a template on Get Started page, and then replace manually its projects with their own.

@gazarenkov
Copy link
Contributor

@sleshchenko
IMO different behavior according to existence of devfile in the file tree is quite confusing.
For me there are 3 ways of creating workspace:

  • from ready to use template(stack) - which is the goal of root issue as I understand
  • importing config(devfile) from URL (you can also consider uploading local devfile why not)
  • making devfile from scratch using nice UI/validations/defaults when applicable etc - here is the logical place for Projects Git URL BTW

In each case it would be a good idea to let user preview the workspace's yaml/json.

@amisevsk
Copy link
Contributor

For me there are 3 ways of creating workspace:

  • from ready to use template(stack) - which is the goal of root issue as I understand
  • importing config(devfile) from URL (you can also consider uploading local devfile why not)
  • making devfile from scratch using nice UI/validations/defaults when applicable etc - here is the logical place for Projects Git URL BTW

IMO the root issue here is the use case for e.g. taking our java-maven devfile and importing your own project. If one of the default templates supports the technologies we want to use, it shouldn't be hard to replace console-java-simple with your own project.

We currently have the already-mentioned issue about e.g. commands not working, but from what I recall the plan was to not hardcode commands, and it was just a workaround (see #13936 and the issue it depeneds on #13636). Alternatively, we could drop commands when the user specifies their own devfile (then the user flow is like opening a new folder in VS Code).

@gazarenkov
Copy link
Contributor

Agree @amisevsk , this is the quite natural flow.
To me one of the most straightforward way to implement it is updating existed (e g console-java-simple) workspace's config (devfile) with your own project.

Of course, user should do this some consciously and be ready to make some more modifications, e g unlikely any commands from a "sample" project can be guaranteed to work in a new project.

@sleshchenko
Copy link
Member Author

Was decided not to implement Import from Git option but have
Import Devfile that would allow user to supply Raw Devfile content, or URL to it #15661
&
Create Custom Workspace that allows user to create a workspace for their projects based on an existing template #15662

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. status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering.
Projects
None yet
Development

No branches or pull requests

6 participants