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

[gp-cli] Display the Gitpod Task ID instead of the Working Directory of the running task #9620

Merged
merged 1 commit into from
Apr 28, 2022

Conversation

felladrin
Copy link
Contributor

@felladrin felladrin commented Apr 28, 2022

Description

Display the Gitpod Task ID instead of the Working Directory of the running task, on the list from gp tasks attach command.

To avoid confusion when more than two tasks are running in the same directory and haven't been named on .gitpod.yml.

Taking Phaser's .gitpod.yml config as example, which contains two tasks without the name property set:

tasks:
  - init: >
            npm install &&
            npm run build
    command: npm run watch
  - init: >
            cd ../ &&
            git clone https://github.com/photonstorm/phaser3-examples.git &&
            cd phaser3-examples &&
            npm install && npm start

When user opens Phaser's repo now, the terminal shows:

image

This PR changes it to be displayed as the following:

image

Here's how terminal names are displayed on VS Code Terminal now:

image

And gp tasks lists output is displayed like this:

gitpod /workspace/phaser (master) $ gp tasks list
|             TERMINAL ID              |     NAME      |  STATE  |
|--------------------------------------|---------------|---------|
| fafe9af7-caf4-41f5-9998-3a713c24d4ed | Gitpod Task 1 | running |
| 62339a91-d078-4d92-9c7e-27c891a31867 | Gitpod Task 2 | running |

Related Issue(s)

None.

How to test

  • Open any repository that contains two or more tasks that keep running on background after the workspace starts and don't have a task name defined in .gitpod.yml. For example: Phaser's repo
  • Confirm if unamed tasks from .gitpod.yml are displayed as Gitpod Task <ID> when gp tasks attach is executed.
  • Note: gp tasks attach is executed automatically during the Welcome Message on JetBrains IDEs Terminals, that's what you see on the screenshots from the description of this PR.

Release Notes

The `gp tasks attach` command now shows the Gitpod Task ID instead of the working directory of the task, to avoid duplicated items in the list of running tasks, as most of the tasks runs in the root directory of the project.

Documentation

None.

@felladrin felladrin force-pushed the vn/improve-gp-tasks-attach branch from ba6521b to a0f3f72 Compare April 28, 2022 13:41
@felladrin felladrin marked this pull request as ready for review April 28, 2022 14:03
@felladrin felladrin requested a review from a team April 28, 2022 14:03
@felladrin felladrin changed the title Display the Gitpod Task ID instead of the Working Directory of the running task [gp-cli] Display the Gitpod Task ID instead of the Working Directory of the running task Apr 28, 2022
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

/hold

see a comment about VS Code integration, up to you to decide we can change it later too

…nning task

To avoid confusion when more than two tasks are running in the same directory and haven't been named on .gitpod.yml.
@felladrin felladrin force-pushed the vn/improve-gp-tasks-attach branch from a0f3f72 to 5fed071 Compare April 28, 2022 14:29
@felladrin felladrin self-assigned this Apr 28, 2022
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@akosyakov
Copy link
Member

@felladrin feel free to deploy

@felladrin
Copy link
Contributor Author

Thanks for reviewing it, @akosyakov!

/unhold

@roboquat roboquat merged commit d2e3555 into main Apr 28, 2022
@roboquat roboquat deleted the vn/improve-gp-tasks-attach branch April 28, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants