Skip to content

Allow digit-prefixed repository owners#6591

Open
w3lld1 wants to merge 1 commit into
mindersec:mainfrom
w3lld1:fix/gitlab-numeric-namespace
Open

Allow digit-prefixed repository owners#6591
w3lld1 wants to merge 1 commit into
mindersec:mainfrom
w3lld1:fix/gitlab-numeric-namespace

Conversation

@w3lld1

@w3lld1 w3lld1 commented Jul 12, 2026

Copy link
Copy Markdown

Summary

Allow UpstreamRepositoryRef.owner values to start with a digit so valid GitLab namespaces such as 2testminder can be registered. The generated protobuf descriptor is updated, and a regression test covers letter-prefixed, digit-prefixed, and invalid punctuation-prefixed owners.

Fixes #6590

Testing

  • go test ./pkg/api/protobuf/go/minder/v1 -run TestUpstreamRepositoryRef_Validate -count=1
  • buf lint
  • make gen
  • git diff --check

@w3lld1 w3lld1 requested a review from a team as a code owner July 12, 2026 10:40
@CLAassistant

CLAassistant commented Jul 12, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 60.923%. remained the same — w3lld1:fix/gitlab-numeric-namespace into mindersec:main

@intelligent-ears intelligent-ears left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the turnaround on this! The fix looks correct — ^[A-Za-z0-9][-[:word:]]*$ accurately reflects GitLab's actual namespace rules while remaining valid for GitHub (which doesn't allow digit-starting org names anyway).

A few notes:

  • Proto change is minimal and correct
  • make gen was clearly run — the .pb.go binary descriptor update matches the pattern change
  • Test coverage is good with the three cases

One suggestion: it might be worth adding a test case for a digit-hyphen-word style name like 2-mindertest (digit followed by hyphens and words), since that's the real-world pattern that triggered this issue. The current regex should handle it, but an explicit test case would make that clear.
Otherwise this looks good to me. Just needs the CLA to be signed before it can be merged.

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.

fix: GitLab repository registration fails for namespaces starting with a digit

4 participants