Allow digit-prefixed repository owners#6591
Open
w3lld1 wants to merge 1 commit into
Open
Conversation
intelligent-ears
left a comment
Member
There was a problem hiding this comment.
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 genwas clearly run — the.pb.gobinary 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow
UpstreamRepositoryRef.ownervalues to start with a digit so valid GitLab namespaces such as2testmindercan 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=1buf lintmake gengit diff --check