+
Skip to content

Fix #3655: Allow dots (.), hyphens (-), and underscores (_) in GitHub usernames #3658

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

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

Nisarg908
Copy link

@Nisarg908 Nisarg908 commented Jul 6, 2025

🔧 What does this PR do?
This PR fixes username validation in the modules create flow. Previously, usernames with dots (e.g., @john.doe) were rejected as invalid, even though they are allowed on platforms like GitLab. This blocked users from using custom module repositories with valid usernames.

🛠️ Changes made:
Updated the GitHub username validation regex in create.py to allow ., -, and _ characters

Error message updated to reflect valid formats

📌 Why is this needed?
To support usernames on platforms other than GitHub (e.g., GitLab), which allow characters like . in usernames. Previously, the validation was too strict and caused confusion and unnecessary errors for users.

🔗 Related Issue
Fixes #3655

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@mashehu
Copy link
Contributor

mashehu commented Jul 6, 2025

Nice, thanks!

Could you add a check that we are not working with a github repo and then add a pytest for the whole new functionality?

Copy link

codecov bot commented Jul 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.89%. Comparing base (27229e2) to head (799b97e).

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Nisarg908
Copy link
Author

Hi @mashehu
Just to check I’ve got the requirement right: when the project’s remote isn’t on github.com, you’d like us to skip the GitHub‑specific username regex and only require the username to start with “@”, correct?

@mashehu
Copy link
Contributor

mashehu commented Jul 6, 2025

Not too sure about the requirements for gitlab, but maybe this would be the simplest solution

@Nisarg908
Copy link
Author

Hi @mashehu,

I've implemented the new logic for username validation, including conditional checks to bypass strict regex validation for non-GitHub origins. I’ve also added corresponding unit tests to ensure correctness, and all test cases are passing now.

Could you please review the changes when you get a chance? Let me know if any modifications or improvements are needed.

@Nisarg908
Copy link
Author

Hi @mashehu , just following up on this PR 😊
Let me know if you need any context from my side or if there are concerns I can address. Appreciate your feedback!

@mashehu
Copy link
Contributor

mashehu commented Jul 12, 2025

Hi, yes, I will come back to this on Monday. Sorry for the delay, but I am on partial parental leave and we had a release last week that took away a lot of time.

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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载