Skip to content

Conversation

@jas4711
Copy link
Contributor

@jas4711 jas4711 commented Oct 7, 2025

Hi! We got this test failure because - is not accepted in usernames by the code, this pull request fixes this.

=== RUN   TestRunLsWithExamplesDirectoryWithOSLookup
    ls_formatting_test.go:87: drwxr-xr-x    8 salsa-ci users        4096 Oct 7 13:16 examples
    ls_formatting_test.go:138: runLs("examples"): username / uid mismatch, expected user, got: "salsa-ci", err: <nil>
--- FAIL: TestRunLsWithExamplesDirectoryWithOSLookup (0.00s)
=== RUN   TestRunLsWithLicensesFileWithOSLookup
    ls_formatting_test.go:87: -rw-r--r--    1 salsa-ci users        1289 Oct 7 13:16 LICENSE
    ls_formatting_test.go:138: runLs("LICENSE"): username / uid mismatch, expected user, got: "salsa-ci", err: <nil>
--- FAIL: TestRunLsWithLicensesFileWithOSLookup (0.00s)

Thanks,
Simon

// username / uid (len 8, number or string)
const (
name = "(?:[a-z_][a-z0-9_]*)"
name = "(?:[a-z_][-a-z0-9_]*)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we’re going to be expanding this username regexp, then we should probably target adding all the allowed characters (that is, underscore and period) and upper-case letters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the pull request to include those in the regexp too, thanks!

@jas4711 jas4711 force-pushed the test-username-regexp branch from c4f1526 to 935fe8e Compare October 7, 2025 14:03
@puellanivis puellanivis merged commit 939b203 into pkg:master Oct 22, 2025
7 of 13 checks passed
puellanivis added a commit that referenced this pull request Oct 22, 2025
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