Skip to content

Document maximum length of gh codespace create --display-name option #8356

@kyanny

Description

@kyanny

Describe the bug

gh codespace create accepts --display-name option that must be up to 48 characters, but the help message doesn't tell it. Manual as well.

If I specify too long display name, it displays error message:

error creating codespace: HTTP 400: Display name must be 48 characters or less (https://api.github.com/user/codespaces)

However on other environment it displays generic 500 error message:

error creating codespace: HTTP 500 (https://api.github.com/user/codespaces)

I couldn't replicate the 500 error but my customer reported it and have experienced it many times. They ran gh command on GitHub Actions workflow.

Regardless if 500 was unexpected/intermittent response from creating Codespaces API endpoint, if the help message and manual explains the limit, it will reduces confusion.

Steps to reproduce the behavior

OK:

gh cs create --repo OWNER/REPO --machine basicLinux32gb --location SouthEastAsia --display-name this-is-the-long-display-name-with-48-characters

NOT OK:

gh cs create --repo OWNER/REPO --machine basicLinux32gb --location SouthEastAsia --display-name this-is-very-long-display-name-with-49-characters

Please replace --repo OWNER/REPO accordingly.

Expected vs actual behavior

Expected:

$ gh cs create -h

(snip)

  -d, --display-name string         display name for the codespace (48 characters or less)

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocsgh-codespacerelating to the gh codespace commandhelp wantedContributions welcomep3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions