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

Improve UX during ${current.project.path} macros usage #13636

Closed
sleshchenko opened this issue Jun 27, 2019 · 3 comments
Closed

Improve UX during ${current.project.path} macros usage #13636

sleshchenko opened this issue Jun 27, 2019 · 3 comments
Assignees
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.

Comments

@sleshchenko
Copy link
Member

Description

I hope that there is much work to fix it, so I decided to describe several improvements in the same issue:

  1. Improve UX when user tries to run a command which has ${current.project.path} macros and there is no selected project.
    Actual: Three error messages: Can not resolve current.project.path ..., and Tasks is failed, sh: 1: Bad substitution.
    First time I got this:
    Screenshot_20190627_114007
    And then
    Screenshot_20190627_113345

Expected: Error message: please select a project before executing a command to make it possible to resolve the current project path. In my case there was only one project, so maybe it may be chosen automatically.

  1. Make it possible to use ${current.project.path} macros in workingDir field of Devfile. Currently, it just does not work:
    Screenshot_20190627_114022

I used the following Java Maven Devfile for testing:

Devfile.yaml
---
apiVersion: 1.0.0
metadata:
  name: java-maven
projects:
  -
    name: console-java-simple
    source:
      type: git
      location: "https://github.com/che-samples/console-java-simple.git"
components:
  -
    type: chePlugin
    id: redhat/java/latest
  -
    type: dockerimage
    alias: maven
    image: maven:3.6.0-jdk-11
    command: ['sleep']
    args: ['infinity']
    env:
      - name: MAVEN_CONFIG
        value: /home/user/.m2
      - name: MAVEN_OPTS
        value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
          -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
          -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom
          -Duser.home=/home/user"
      - name: JAVA_OPTS
        value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
          -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
          -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom"
      - name: JAVA_TOOL_OPTIONS
        value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
          -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
          -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom"
      - name: PS1
        value: $(echo ${0})\\$
      - name: HOME
        value: /home/user
    memoryLimit: 512Mi
    endpoints:
      - name: '8080/tcp'
        port: 8080
    mountSources: true
    volumes:
      - name: m2
        containerPath: /home/user/.m2
commands:
  -
    name: maven build
    actions:
      -
        type: exec
        component: maven
        command: "mvn -Duser.home=${HOME} clean install"
        workdir: ${current.project.path}
  -
    name: maven build and run
    actions:
      -
        type: exec
        component: maven
        command: "cd ${current.project.path} && mvn -Duser.home=${HOME} clean install && java -jar ./target/*.jar"
@sleshchenko sleshchenko added the kind/enhancement A feature request - must adhere to the feature request template. label Jun 27, 2019
@sleshchenko
Copy link
Member Author

@evidolob @vparfonov Please assign right team, because I'm not sure who should work on it.

@sunix
Copy link
Contributor

sunix commented Jul 23, 2019

From my experience (having used che6 a lot), the problem with current.project.path is that it is very hard to know what this is actually is .... the project selected in the project explorer ? the current active editor ? the folder where you are in the current terminal ?
Also, we don't really have 'projects'. What if you have a Maven project stored in a subfolder of the git root folder. What is your project ?
I know it is solving issues with samples, but in real use case it doesn't really work.

@vparfonov
Copy link
Contributor

in the Theia upstream exist similar macros called workspaceFolder probably we can reuse it, and deprecate current.project.path because we don't have project notation anymore.
Ideas ?

@vparfonov vparfonov added this to the Backlog - IDE 1 milestone Oct 30, 2019
@vparfonov vparfonov modified the milestones: Backlog - IDE 1, 7.5.0 Nov 11, 2019
@vparfonov vparfonov modified the milestones: 7.5.0, Backlog - IDE 1 Nov 28, 2019
@vzhukovs vzhukovs self-assigned this Dec 9, 2019
@vzhukovs vzhukovs added kind/task Internal things, technical debt, and to-do tasks to be performed. and removed kind/enhancement A feature request - must adhere to the feature request template. labels Dec 12, 2019
@ericwill ericwill mentioned this issue Dec 17, 2019
15 tasks
@azatsarynnyy azatsarynnyy mentioned this issue Dec 19, 2019
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

No branches or pull requests

4 participants