Skip to content

Allow setting codespace display name during create - #6739

Merged
mislav merged 4 commits into
cli:trunkfrom
despreston:codespace-displayname
Dec 19, 2022
Merged

mislav merged 4 commits into
cli:trunkfrom
despreston:codespace-displayname

Conversation

@despreston

@despreston despreston commented Dec 16, 2022 •

Copy link
Copy Markdown
Contributor

Adding the display_name field to the POST /user/codespaces request and exposing it via a new --display-name -d argument for gh codespace create.

e.g.

gh codespace create --display-name foo

The tests for the api code and the command handler both return a mock'd response that contains a
hardcoded codespace name and so updating the tests for these seemed kinda useless. Some of the other
commands' tests assert that the options object contains the right values, e.g. browse_test.go. I
didn't see any tests like that for codespace/create.go. Maybe that's something to be added in the
future?

Fixes #6549

@despreston
despreston requested a review from a team as a code owner December 16, 2022 15:46
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Dec 16, 2022

@mislav mislav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Added some tests.

Re: flags parsing test: this Cobra statement pretty much ensures that the flag value will be stored into opts.displayName, so we won't really need to test flags parsing logic.

createCmd.Flags().StringVarP(&opts.displayName, "display-name", "d", "", "display name for the codespace")

@mislav
mislav merged commit 4ade907 into cli:trunk Dec 19, 2022
@despreston
despreston deleted the codespace-displayname branch December 19, 2022 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow setting display name on codespace create

3 participants