Skip to content

fix: allow dots in usernames for non-GitHub git providers#4343

Open
sanmaxdev wants to merge 2 commits into
nf-core:devfrom
sanmaxdev:fix/allow-dots-in-username
Open

fix: allow dots in usernames for non-GitHub git providers#4343
sanmaxdev wants to merge 2 commits into
nf-core:devfrom
sanmaxdev:fix/allow-dots-in-username

Conversation

@sanmaxdev

Copy link
Copy Markdown

Summary

  • Updated the username validation regex in _get_username() to accept dots (.)
  • Made the warning message provider-agnostic (not GitHub-specific)

GitLab and other git providers allow dots in usernames, but the existing regex only accepted alphanumeric characters and hyphens. This blocked module creation for users with dotted usernames on those platforms.

Changes

  • nf_core/components/create.py: Modified regex to include . as a valid character in usernames
  • Updated comment and warning text to refer generically to username validation

Verification

  • ruff format — 1 file already formatted
  • ruff check — All checks passed
  • Regex validation — tested with @user, @user.name, @first.last, @user-name.last
  • Import check — from nf_core.components.create import ComponentCreate passes

Closes #3655

The username validation regex was GitHub-specific and rejected
usernames containing dots, which are valid on GitLab and other
git providers. Updated the regex to accept dots and made the
warning message provider-agnostic.

Fixes nf-core#3655
@mashehu

mashehu commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

thanks for the fix.

Can you please add a test in tests/modules/test_create.py for it and also join the github org via the slack channel so the CI runs for you.

@sanmaxdev

Copy link
Copy Markdown
Author

Thanks — added the requested regression coverage in tests/modules/test_create.py.

Verification:

  • VIRTUAL_ENV= uv run --all-extras pytest tests/modules/test_create.py -k dotted_author_username --color=yes — 1 passed, 12 deselected
  • VIRTUAL_ENV= uv run --all-extras ruff check nf_core/components/create.py tests/modules/test_create.py — passed
  • VIRTUAL_ENV= uv run --all-extras ruff format --check nf_core/components/create.py tests/modules/test_create.py — passed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants