Skip to content

[gp-cli] Add alias for forward and await in ports #10463

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

Closed
wants to merge 0 commits into from
Closed

[gp-cli] Add alias for forward and await in ports #10463

wants to merge 0 commits into from

Conversation

CuriousCorrelation
Copy link
Contributor

@CuriousCorrelation CuriousCorrelation commented Jun 3, 2022

Description

This PR aliases forward-port and await-port command to ports namespace as ports forward, ports await

Related Issue(s)

Closes #10449

How to test

Both commands should be similar except for their Usage message

forward-port

❯ gp forward-port --help
Makes a port available on 0.0.0.0 so that it can be exposed to the internet

Usage:
  gp forward-port <local-port> [target-port] [flags]

Flags:
  -h, --help                  help for forward-port
  -r, --rewrite-host-header   rewrites the host header of passing HTTP requests to localhost
❯ gp ports forward --help
Makes a port available on 0.0.0.0 so that it can be exposed to the internet

Usage:
  gp ports forward <local-port> [target-port] [flags]

Flags:
  -h, --help                  help for forward
  -r, --rewrite-host-header   rewrites the host header of passing HTTP requests to localhost

await-port

❯ gp await-port --help
Waits for a process to listen on a port

Usage:
  gp await-port <port> [flags]

Flags:
  -h, --help   help for await-port
❯ gp ports await --help
Waits for a process to listen on a port

Usage:
  gp ports await <port> [flags]

Flags:
  -h, --help   help for await

Release Notes

Added alias for forward and await in ports CLI namespace

Documentation

Does this PR require updates to the documentation at www.gitpod.io/docs?

  • Yes

https://github.com/gitpod-io/website/issues/2173#issue-1260679472

@andreafalzetti
Copy link
Contributor

andreafalzetti commented Jun 7, 2022

Thanks a lot for the contribution @CuriousCorrelation 🙏

We want to slowly migrate usage over to the new alias so in order to do that, I would like to suggest if you could hide the old commands from the usage.

You can do that by adding Hidden: true on the command definition, example:

var awaitPortCmd = &cobra.Command{
	Hidden: true,
	Use:    "await-port <port>",
...

and

var portFwdCmd = &cobra.Command{
	Hidden: true,
	Use:    "forward-port <local-port> [target-port]",
...

By setting Hidden: true they will still be usable for users who know them, or have configured their .gitpod.yml but it will be easier to promote the new nested alternative.

🙏 🙏 🙏

@andreafalzetti
Copy link
Contributor

Before we can merge your first contribution, we kindly ask you to sign a Contributor License Agreement (CLA)[1].

cc @meysholdt will reach out about the CLA :)

@CuriousCorrelation
Copy link
Contributor Author

@andreafalzetti let me know if my latest commit looks good or something needs change

we kindly ask you to sign a Contributor License Agreement

Yes, of course

@meysholdt
Copy link
Member

hi @CuriousCorrelation! To get the CLA signed, can you please send me an email to [email protected] and let me know your real name? I will respond to your email with a DocuSign document for convenient signature.

@CuriousCorrelation
Copy link
Contributor Author

@meysholdt Done!

@andreafalzetti
Copy link
Contributor

andreafalzetti commented Jun 8, 2022

@CuriousCorrelation Thanks!

Can I ask you to rebase and squash your commits so that when we merge it's a single commit?

We have an automated system that merges the PR once I approve, so we won't be able to do it from the GitHub UI. 🙏

@andreafalzetti
Copy link
Contributor

andreafalzetti commented Jun 8, 2022

/werft run

👍 started the job as gitpod-build-main-fork.33
(with .werft/ from main)

@andreafalzetti
Copy link
Contributor

andreafalzetti commented Jun 8, 2022

The build is failing, could you try rebasing from main?

git rebase origin/main 🙏

@CuriousCorrelation
Copy link
Contributor Author

@andreafalzetti Hey I tried squash and rebase but unfortunately it didn't work. I kept getting remote: fatal: bad tree object errors. I am unsure why that was. I instead created a new PR here #10538 . It should be up-to-date with all prior commits.

@CuriousCorrelation
Copy link
Contributor Author

@andreafalzetti I think that PR should be good to go but please feel free to let me know if I should change something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move all ports commands under the gp CLI namespace
4 participants