Skip to content
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

Make GitHub username comparisons case-insensitive. #293

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TonyLovesDevOps
Copy link

This fixes the issue where setting GITHUB_USER to the same characters in a different case, causes the spurious error: the specified owner <username> doesn't match the identity associated with the given token.

Description

Does what it says on the tin.

Test results

I'm seeing a test failure for [Fail] GitHub Provider [It] should list the available organizations the user has access to, possibly because I am not a member of any organizations that I did not create. This same test fails on the tip of the main branch.

$ make test-e2e-github
go mod tidy -compat=1.22
go fmt ./...
go vet ./...
go test  -race -coverprofile=coverage.txt -covermode=atomic -tags=e2e ./github/...
Running Suite: GitHub Provider Suite
====================================
Random Seed: 1727210907
Will run 12 of 12 specs

•
------------------------------
• Failure [0.469 seconds]
GitHub Provider
/Users/tony/git/go-git-providers/github/integration_test.go:131
  should list the available organizations the user has access to [It]
  /Users/tony/git/go-git-providers/github/integration_test.go:212

  Expected
      <*string | 0x0>: nil
  not to be nil

  /Users/tony/git/go-git-providers/github/integration_test.go:240
------------------------------
•••••••
------------------------------
• [SLOW TEST:12.342 seconds]
GitHub Provider
/Users/tony/git/go-git-providers/github/integration_test.go:131
  should be possible to create and edit a pr for a user repository
  /Users/tony/git/go-git-providers/github/integration_test.go:450
------------------------------
••

Summarizing 1 Failure:

[Fail] GitHub Provider [It] should list the available organizations the user has access to
/Users/tony/git/go-git-providers/github/integration_test.go:240

Ran 12 of 12 Specs in 24.767 seconds
FAIL! -- 11 Passed | 1 Failed | 0 Pending | 0 Skipped
--- FAIL: TestProvider (24.78s)
FAIL
coverage: 55.0% of statements
FAIL    github.com/fluxcd/go-git-providers/github       26.497s
FAIL
make: *** [test-e2e-github] Error 1

@TonyLovesDevOps TonyLovesDevOps force-pushed the feature/make_github_username_comparison_case_insensitive branch from 60f3506 to 147a567 Compare September 24, 2024 20:57
… the issue where setting GITHUB_USER to the same characters in a different case, causes the spurious error: "the specified owner <username> doesn't match the identity associated with the given token"

Signed-off-by: Tony Worthit <[email protected]>
@TonyLovesDevOps TonyLovesDevOps force-pushed the feature/make_github_username_comparison_case_insensitive branch from 147a567 to 051821e Compare September 24, 2024 21:26
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.

1 participant