Skip to content

feat(gitpod-cli): Create gp info command #13537

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

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

WVerlaek
Copy link
Member

@WVerlaek WVerlaek commented Oct 3, 2022

Description

Adds a gp info command, to print workspace details. For now, this includes:

  • Workspace ID
  • Instance ID
  • Workspace class
  • Workspace URL
  • Cluster host

The intention is for this to replace the use of the matching environment variables (see #10797 for more details).

Includes a --json flag to print as JSON, allowing e.g. for parsing the output in scripts.

Related Issue(s)

Fixes #10797

How to test

$ cd components/gitpod-cli

$ go run . info
  Workspace ID    : gitpodio-gitpod-4q1200dvfcf                            
  Instance ID     : 8a6188a3-4c7f-49fe-aa4d-db968c11e183                   
  Workspace class : Large: Up to 8 vCPU, 16GB memory, 50GB disk            
  Workspace URL   : https://gitpodio-gitpod-4q1200dvfcf.ws-eu67.gitpod.io  
  Cluster host    : ws-eu67.gitpod.io                                      

$ go run . info --json
{"workspace_id":"gitpodio-gitpod-4q1200dvfcf","instance_id":"8a6188a3-4c7f-49fe-aa4d-db968c11e183","workspace_class":{"id":"g1-large","display_name":"Large","description":"Up to 8 vCPU, 16GB memory, 50GB disk"},"workspace_url":"https://gitpodio-gitpod-4q1200dvfcf.ws-eu67.gitpod.io","cluster_host":"ws-eu67.gitpod.io"}

Release Notes

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@WVerlaek WVerlaek requested a review from Furisto October 3, 2022 14:33
@WVerlaek WVerlaek changed the title feat(gitpod-cli): gp info command feat(gitpod-cli): Create gp info command Oct 3, 2022
@Furisto Furisto marked this pull request as ready for review October 5, 2022 07:43
@Furisto Furisto requested a review from a team October 5, 2022 07:43
@andreafalzetti
Copy link
Contributor

andreafalzetti commented Oct 5, 2022

Could we update the release notes to be more user-focused?

e.g. Gitpod CLI: Added new cmd gp info to display the workspace info such as IDs, class, etc

(feel free to update it, it's just an example, what I'd like is to provide more context on what the cmd does at a glance, for someone who is reading the release notes)

}, nil
}

func outputInfo(info *infoData) {
Copy link
Contributor

@andreafalzetti andreafalzetti Oct 5, 2022

Choose a reason for hiding this comment

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

I liked this formatting style. It looks neater compared to a regular table, I think we should consider it for gp top as well!

Copy link
Member Author

Choose a reason for hiding this comment

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

gave it a go, what do you think of this:
image

Copy link
Contributor

@andreafalzetti andreafalzetti Oct 5, 2022

Choose a reason for hiding this comment

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

when we extended the top cmd to include the workspace class, I wasn't convinced by the layout of mixing table + plain text, it would be nice to make class feel more part of the output. However, now we also have gp info so maybe we don't need class in gp top? I think if you open a draft PR we can collect feedback in there :)

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea of moving the class to the table, raised a draft PR here: #13607

Copy link
Contributor

@andreafalzetti andreafalzetti left a comment

Choose a reason for hiding this comment

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

Nice addition! Thank you 🙏

/hold in case you want to update the release notes

@roboquat roboquat merged commit 208fbe4 into main Oct 5, 2022
@roboquat roboquat deleted the wverlaek/create-gp-info-command-10797 branch October 5, 2022 08:07
@andreafalzetti
Copy link
Contributor

andreafalzetti commented Oct 5, 2022

/hold didn't work, well 😅

@WVerlaek
Copy link
Member Author

WVerlaek commented Oct 5, 2022

😅
@andreafalzetti if I change the release notes now I'm guessing it won't have any effect anymore?

@Furisto Furisto added the team: workspace Issue belongs to the Workspace team label Oct 5, 2022
@andreafalzetti
Copy link
Contributor

I think it might be, not 100% sure

@filiptronicek
Copy link
Member

filiptronicek commented Oct 5, 2022

@WVerlaek it for sure will! These release notes only get fetched when we generate the changelog, so you can tweak them around post-merge 🙂

@WVerlaek
Copy link
Member Author

WVerlaek commented Oct 5, 2022

@filiptronicek awesome! updated

@roboquat roboquat added the deployed: IDE IDE change is running in production label Oct 5, 2022
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Oct 5, 2022
@roboquat
Copy link
Contributor

@WVerlaek: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@atduarte
Copy link
Contributor

atduarte commented Oct 31, 2022

@WVerlaek removed release notes, as a manual key highlight was created to replace it 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: gp cli deployed: IDE IDE change is running in production deployed: workspace Workspace team change is running in production deployed Change is completely running in production do-not-merge/hold do-not-merge/release-note-label-needed size/L team: IDE team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create gp info command
6 participants