-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enhancements for workspace create REST service to support additional parameters #3283
Comments
@skabashnyuk what do you think about this suggestion? |
Workspace API supposed to be client behavior agnostic. I think we have this things (pretty much the same you requested) when call IDE with Factory parameters. Not sure if it is available on Che assembly as well (not Codenvy only) but still - I believe we should not mix client specific with REST API, let's better keep using factory (on top of ws definition) for that. |
Hi @gazarenkov , I've looked at the Factory API already (I believe that you're talking about https://codenvy.readme.io/docs/factories ). I don't believe this feature is available in Che, also my concern with using Factory is that it is limited by URL length (see http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers ). The 2000 character limit will easily be exceeded if we are going to be including a list of open files, cursor positions, breakpoints and stacktrace information in the URL. The only reasonable way I can think of to send all this state is in a REST call which would not be restricted by size limits. |
Factories have a fixed-length when they are encoded with a hash, such as A user can then invoke a factory with the ID code and the system will then generate a workspace according to the configuration that was previously saved. So, in effect, a Factory implements exactly what you are seeking. |
@TylerJewell that sounds very interesting, the way you describe it is exactly what I'm looking for. Which REST call is used to create the factory? I see mention of configuring using a JSON snippet passed via URL or the command line here - https://codenvy.readme.io/docs/factories#configure, or is the REST call for creating the factory a different thing? Also, how do we get the factories feature in Che? |
If you look at the Swagger within Codenvy, there is a What you see with the We then have logic to determine what happens if a factory URL is clicked more than once (create new ws each time, reload existing workspace?, singleton ws or single ws / user?). There is a pretty rich sub-system involved with this. We have been talking with Red Hat management for a number of months about what would be involved with Codenvy open sourcing our Factory capabilities and including them within Che. They are probably better suited to discuss the state of that conversation. They have come to us and asked us to open source some other sub systems within Codenvy as part of Che as well and those discussions are all lumped together. |
@TylerJewell thanks, I'll checkout the /factory API - offhand do you know if it supports setting the workspace state such as open files, breakpoints, etc as I describe above? I'll talk to my Red Hat team members to find out what's happening with the other stuff. |
It does, yes. In the 5.0.0 version that we are shipping with Che, we have been enhancing the "workspace state" object inside of the "workspace" object which factories embody. The workspace state is a server-side set of properties that define (for the client) what it should configure itself to. It has things like open terminals, open files, which folder in the tree should be open, editor layout, client preferences. This state object is far from complete, but it's a server-side object that we incrementally enhance. If you pass a factory object with workspace state within it, then when the workspace is created the client will be passed this state information and told to configure itself that way. |
I think this thread has moved into other directions, so closing it for now. |
It would be useful for the workspace creation REST service to support setting up a new workspace with some additional parameters, such as open files, cursor positions in files, breakpoints, stacktrace info, etc. This would enable a developer to create a new workspace with the required state for working on an issue or feature request with these additional parameter values being provided by the issue tracking system.
This enhancement would require some changes to org.eclipse.che.api.workspace.server.WorkspaceService (che-core-api-workspace), probably in the org.eclipse.che.api.workspace.shared.dto.ProjectConfigDTO class, and changes in WorkspaceManager to support the extra params.
The text was updated successfully, but these errors were encountered: