{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/che/issues/2681","repository_url":"https://api.github.com/repos/eclipse/che","labels_url":"https://api.github.com/repos/eclipse/che/issues/2681/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/che/issues/2681/comments","events_url":"https://api.github.com/repos/eclipse/che/issues/2681/events","html_url":"https://github.com/eclipse/che/issues/2681","id":180613048,"number":2681,"title":"[WIP] Intelligent commands","user":{"login":"slemeur","id":1636769,"avatar_url":"https://avatars.githubusercontent.com/u/1636769?v=3","gravatar_id":"","url":"https://api.github.com/users/slemeur","html_url":"https://github.com/slemeur","followers_url":"https://api.github.com/users/slemeur/followers","following_url":"https://api.github.com/users/slemeur/following{/other_user}","gists_url":"https://api.github.com/users/slemeur/gists{/gist_id}","starred_url":"https://api.github.com/users/slemeur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slemeur/subscriptions","organizations_url":"https://api.github.com/users/slemeur/orgs","repos_url":"https://api.github.com/users/slemeur/repos","events_url":"https://api.github.com/users/slemeur/events{/privacy}","received_events_url":"https://api.github.com/users/slemeur/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eclipse/che/labels/kind/epic","name":"kind/epic","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-03T10:58:36Z","updated_at":"2016-10-06T09:41:54Z","closed_at":null,"body":"# Goals\r\nEclipse Che commands are proposing a very high level of configurability, but in certain use cases, the navigation and access to the right command is difficult and user might run into commands which will not be executed properly. \r\nWith the new capabilities around multi-machine in workspace, the commands should also target the correct machine.\r\n\r\nCommands are tied to a context which define in which situation they might be used. Intelligent commands are providing contextualized command definition and ability for the system to know when a command is appropriate or not.\r\n\r\n\r\n# Values\r\n- Clearer and simpler way for user to find the default commands to build, test and run projects in a workspace. \r\n- Better configurability options for commands\r\n- Less error prone flow when executing commands\r\n\r\n# Commands's **context**\r\nTo run properly a command needs to be executed with the right context. Commands could be:\r\n- Associated to a specific project of the workspace,\r\n- Executed to a only a specific set of machines used in the workspace’s environment,\r\n- Executed only if a certain set of dependencies are installed in the machine.\r\n\r\nSo the command’s context is defined by the following meta-datas:\r\n\r\n| Projects | Machines | Dependencies |\r\n| --------- | ----------- | -----------------|\r\n|The projects in the workspace where the command can be applied | The targets in the environment where the command will be executed  | The dependencies or pre-requisites on machine which will allow the command to be properly executed |\r\n|*mvn clean install* can be executed only across a Maven project  | *mvn clean install* would be executed against a certain set of machine. | *mvn clean install* would run properly, only if Maven is properly installed in the machine.|\r\n\r\nTo know its context, the command will have new settings options.\r\n\r\n### 1- A command will know on which machine(s) it can be executed\r\n**Phase1:**\r\n- User will have the possibility to specify the machine(s) where the command can be executed. It is the definition of the base machines for the command.\r\n\r\n**Phase2:**\r\n- We add the notion of tag to commands. This notion allow to default the behavior of commands and enable it only for certain machines. \r\n- For example:\r\n  - *mvn clean install* would have the following tags: Maven, Java\r\n  - Workspace machineAA would have the tags from the stack used: Maven, Java\r\n  - System will be able to propose to execute *mvn clean install* onto machineAA\r\n\r\n### 2- A command will know on which project it has to be applied\r\n\r\nThe command will have meta-datas to let the system know for which projects it can be applied.  \r\n\r\nIf those meta-datas are not defined, it means the command is not project-specific and available in all project context. \r\n\r\nFor example:\r\n - *mvn clean install* will be available only for specified maven project\r\n - *run script.sql* will be available at any time\r\n\r\n\r\n### 3- A command use macros in its definition to be apply to an IDE context (currently existing)\r\n\r\nIn a single workspace, the user might have multiple Maven projects. \r\n\r\nWorkspace:\r\n - ProjectA\r\n - ProjectB\r\n - ProjectC\r\n\r\nIt is possible to define a command which will just be executed across the currently selected project (in the IDE project explorer). In this case the command definition will use the macros that we already have into the system:https://eclipse-che.readme.io/docs/commands#macros\r\n\r\nCommand definition\r\n`cd ./projects/${explorer.current.file.relpath}/ mvn clean install`\r\n\r\n### 4- A command could have a set of pre-conditions defined ?\r\n\r\nThere could be the possibility to define pre-check conditions in order to execute a command. This could be a script. \r\n\r\nFor example: before executing a mvn clean install command, the user will be able to configure the pre-conditions to check if the command can be executed. \r\n\r\n- Check mvn installed: mvn -version\r\n- Check java installed\r\n\r\n\r\n# Command’s goal:\r\nWhen a user is configuring a commands, he is always doing it for a certain purpose, a certain goal or a certain phase of the project lifecycle. For example, he will define a command to “Build” the projects in the workspaces, he will define a command to “Run” a project, he will define a command to “Deploy” the project and so on.\r\n\r\nConsidering this notion of goal for a command, we will use them in order to better contextualize the commands:\r\n- Build\r\n- Test\r\n- Run\r\n- Deploy\r\n\r\nChe will provide default set of goals, but user would have the ability to define/configure them\r\n\r\nCommand’s goal allow to configure default workspace commands and provide clearer organization and navigation into the commands. \r\n\r\n# Associated features\r\n\r\n- “F5” keyboard shorcut would be always bind to a default command which will build+run the project\r\n\r\n- Commands Panel: \r\nPanel displayed with keyboard shortcut which allow to browse and start any configured command.\r\n\r\n- Primary vs secondary command configuration\r\nAbility to select the command used by default “build button” and “run button”\r\n\r\n- Command Organization\r\nTo regroup commands together, the user will have to give them a name and use slash (/) in the name of the command and we will treat these as a group separator.\r\nFor examples, two commands named Maven/Clean-Install and Maven/Package will be grouped together into a submenu named Maven\r\n\r\n\r\n# Mockups (design not final)\r\n\r\n*Toolbar*\r\n![commands toolbar](https://cloud.githubusercontent.com/assets/1636769/19035263/c2a6436a-8968-11e6-96c4-1b37fd934c56.png)\r\n\r\n*Palette*\r\n![commands palette](https://cloud.githubusercontent.com/assets/1636769/19035271/cea63d8c-8968-11e6-934c-db0245b49139.png)\r\n\r\n*Right Click actions*\r\n![commands right click actions](https://cloud.githubusercontent.com/assets/1636769/19035278/d97cdd7e-8968-11e6-947e-4504b64bdb5c.png)\r\n\r\n*Command Explorer - Info*\r\n![commands explorer - info](https://cloud.githubusercontent.com/assets/1636769/19035286/e5561606-8968-11e6-8235-a79d58e0033e.png)\r\n\r\n*Command Explorer - Arguments*\r\n![commands explorer - arguments](https://cloud.githubusercontent.com/assets/1636769/19035293/f3b31ef6-8968-11e6-82c0-ce23cd06e465.png)\r\n\r\n*Command Explorer - Arguments - Macros Catalog*\r\n![commands explorer - arguments - macros catalog](https://cloud.githubusercontent.com/assets/1636769/19035300/fea8d30a-8968-11e6-83d4-d9aa0ddabd2b.png)\r\n\r\n*Command Explorer - PreviewURL*\r\n![commands explorer - previewurl](https://cloud.githubusercontent.com/assets/1636769/19035303/0c955880-8969-11e6-8590-22cdf393fd40.png)\r\n\r\n*Command Explorer - Common*\r\n![commands explorer - common](https://cloud.githubusercontent.com/assets/1636769/19035312/16fc565c-8969-11e6-9813-30f703d1f4b0.png)\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/eclipse/che/issues/comments/251914761","html_url":"https://github.com/eclipse/che/issues/2681#issuecomment-251914761","issue_url":"https://api.github.com/repos/eclipse/che/issues/2681","id":251914761,"user":{"login":"benoitf","id":436777,"avatar_url":"https://avatars.githubusercontent.com/u/436777?v=3","gravatar_id":"","url":"https://api.github.com/users/benoitf","html_url":"https://github.com/benoitf","followers_url":"https://api.github.com/users/benoitf/followers","following_url":"https://api.github.com/users/benoitf/following{/other_user}","gists_url":"https://api.github.com/users/benoitf/gists{/gist_id}","starred_url":"https://api.github.com/users/benoitf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benoitf/subscriptions","organizations_url":"https://api.github.com/users/benoitf/orgs","repos_url":"https://api.github.com/users/benoitf/repos","events_url":"https://api.github.com/users/benoitf/events{/privacy}","received_events_url":"https://api.github.com/users/benoitf/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T09:41:54Z","updated_at":"2016-10-06T09:41:54Z","body":"- If I add Maven to my project I expect to see some basic commands  for Maven\r\nlike mvn clean install, having nice UI for configuring maven commands (not a to skip tests, work offline, etc.\r\n\r\n- If I have a Java TestNG or Junit dependency in my project, I expect to have commands to run a dedicated test method, or the whole class or tests at package level or project level. \r\n\r\n- I'm also expecting that I could use any remote tool (like a CLI to execute the default build command specified in the current project : like maven clean install with skipTests and offline mode) \r\n\r\n\r\nabout agents : \r\n> If I have MySQL provided with standard image, w/o Agent nothing should prevent me to call mySQL related commands/scripts.\r\n\r\nEclipse Che could propose me to add some MySQL facets/tools by seeing that my image contains MySQL as well (and I could have some UI about MySQL for running scripts into my machine)\r\n\r\nIn the same way I expect that an IDE propose me to select the type of the project (or facets, builders, etc) I would also expect that it could check what is my runtime and propose tools matching this runtime.\r\nIf I have tomcat installed in the machine, maybe it could propose me to add the stop/start command for tomcat as well.\r\n\r\n\r\n"}}
{"actor":{"display_login":"benoitf"}}