Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: allow old GitHub names #15730

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 2 commits into from
Closed

feat: allow old GitHub names #15730

wants to merge 2 commits into from

Conversation

Chagui-
Copy link

@Chagui- Chagui- commented Dec 3, 2024

Some people have old names that could include a trailing hyphen, like mine: Chagui-

This PR allows them to use coder, instead of getting this error on login:
'in tx: execute transaction: create user: invalid username "Chagui-": must be alphanumeric with hyphens'

The error already doesn't say anything about no trailing hyphens, so no change is needed there.

@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Dec 3, 2024
@Chagui- Chagui- changed the title feat: Allow old github names feat: allow old github names Dec 3, 2024
@Chagui- Chagui- changed the title feat: allow old github names feat: allow old GitHub names Dec 3, 2024
Copy link
Member

@ethanndickson ethanndickson left a comment

Choose a reason for hiding this comment

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

The regex for the frontend in site/src/utils/formUtils.ts also needs to be updated.

The end-to-end tests then pass for a user named admin-, so it doesn't look like this would break any core workflows.

Do we know why GitHub started rejecting names with trailing hyphens? Is it any of concern to us?

@matifali
Copy link
Member

matifali commented Dec 9, 2024

@ethanndickson A few issues I found are:

  1. hyphens aren't allowed at the end of the hostname part in DNS
  2. Docker tag doesn't allow tagging with -

@deansheather
Copy link
Member

deansheather commented Dec 11, 2024

This will break subdomain parsing for workspace apps in Coder. We should probably just attempt to trim the invalid characters when creating a new user for the GitHub account.

Our subdomains use the form <app>--<agent>--<workspace>--<username>(--<suffix>)?, so any leading or trailing hyphens on any of those components will break the parsing.

@github-actions github-actions bot added the stale This issue is like stale bread. label Dec 19, 2024
@github-actions github-actions bot closed this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Pull Requests and issues created by the community. stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants