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

Migrate to gitlab.com/gitlab-org/api/client-go #307

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

erikgb
Copy link
Contributor

@erikgb erikgb commented Dec 28, 2024

Description

go-gitlab moves to gitlab.com: xanzy/go-gitlab#2060. The latest releases of https://gitlab.com/gitlab-org/api/client-go require Go 1.23, and I don't want to miss a Go upgrade into this PR.

Test results

Somehow tests are failing on my workstation, but it's failing with the same errors without this change. 🤔 Might be something strange in my corporate environment.

$ make test
go mod tidy -compat=1.22
go fmt ./...
go vet ./...
go test  -race -coverprofile=coverage.txt -covermode=atomic ./...
?       github.com/fluxcd/go-git-providers/bitbucket    [no test files]
        github.com/fluxcd/go-git-providers/gitprovider/cache            coverage: 0.0% of statements
        github.com/fluxcd/go-git-providers/gitprovider/testutils                coverage: 0.0% of statements
2024/12/28 13:10:25 failed to create Gitea client: unknown version: f943dcdc4
FAIL    github.com/fluxcd/go-git-providers/gitea        1.092s
ok      github.com/fluxcd/go-git-providers/github       2.025s  coverage: 12.9% of statements
ok      github.com/fluxcd/go-git-providers/gitlab       1.048s  coverage: 5.6% of statements
--- FAIL: Test_makeCientOptions (0.01s)
    --- FAIL: Test_makeCientOptions/WithCustomCAPostChainTransportHook (0.00s)
        client_options_test.go:308: makeOptions() = &{{<nil> <nil> <nil> 0x849d60 <nil> [45 45 45 45 45 66 69 71 73 78 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10 77 73 73 66 104 122 67 67 65 83 50 103 65 119 73 66 65 103 73 85 100 115 65 116 105 88 51 103 78 48 117 107 55 100 100 120 65 83 87 89 69 47 116 100 118 48 119 119 67 103 89 73 75 111 90 73 122 106 48 69 65 119 73 119 10 71 84 69 88 77 66 85 71 65 49 85 69 65 120 77 79 90 88 104 104 98 88 66 115 90 83 53 106 98 50 48 103 81 48 69 119 72 104 99 78 77 106 65 119 78 68 69 51 77 68 103 120 79 68 65 119 87 104 99 78 77 106 85 119 10 78 68 69 50 77 68 103 120 79 68 65 119 87 106 65 90 77 82 99 119 70 81 89 68 86 81 81 68 69 119 53 108 101 71 70 116 99 71 120 108 76 109 78 118 98 83 66 68 81 84 66 90 77 66 77 71 66 121 113 71 83 77 52 57 10 65 103 69 71 67 67 113 71 83 77 52 57 65 119 69 72 65 48 73 65 66 75 55 104 47 53 68 56 98 86 57 51 77 109 69 100 104 117 48 50 74 115 83 54 117 103 66 56 115 54 80 122 82 108 51 80 86 52 120 115 51 83 98 114 10 82 78 107 107 77 53 57 43 120 51 98 48 105 87 120 47 105 55 54 113 80 89 112 78 76 111 105 86 85 86 88 81 109 65 57 89 43 52 68 98 77 120 105 106 85 122 66 82 77 65 52 71 65 49 85 100 68 119 69 66 47 119 81 69 10 65 119 73 66 66 106 65 80 66 103 78 86 72 82 77 66 65 102 56 69 66 84 65 68 65 81 72 47 77 66 48 71 65 49 85 100 68 103 81 87 66 66 81 71 121 85 105 85 49 81 69 90 105 77 65 113 106 115 110 73 89 84 119 90 10 52 121 112 53 119 122 65 80 66 103 78 86 72 82 69 69 67 68 65 71 104 119 82 47 65 65 65 66 77 65 111 71 67 67 113 71 83 77 52 57 66 65 77 67 65 48 103 65 77 69 85 67 73 81 68 122 100 116 118 75 100 69 56 79 10 49 43 87 82 84 90 57 77 117 83 105 70 89 99 114 69 122 55 90 110 101 55 86 88 111 117 68 69 75 113 75 69 105 103 73 103 77 52 87 108 98 68 101 117 78 67 75 98 113 104 113 106 43 120 90 86 48 112 97 51 114 119 101 98 10 79 68 56 69 106 106 67 77 89 54 57 82 77 79 48 61 10 45 45 45 45 45 69 78 68 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10]} <nil> <nil>}, want &{{<nil> <nil> <nil> 0x8567e0 <nil> [45 45 45 45 45 66 69 71 73 78 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10 77 73 73 66 104 122 67 67 65 83 50 103 65 119 73 66 65 103 73 85 100 115 65 116 105 88 51 103 78 48 117 107 55 100 100 120 65 83 87 89 69 47 116 100 118 48 119 119 67 103 89 73 75 111 90 73 122 106 48 69 65 119 73 119 10 71 84 69 88 77 66 85 71 65 49 85 69 65 120 77 79 90 88 104 104 98 88 66 115 90 83 53 106 98 50 48 103 81 48 69 119 72 104 99 78 77 106 65 119 78 68 69 51 77 68 103 120 79 68 65 119 87 104 99 78 77 106 85 119 10 78 68 69 50 77 68 103 120 79 68 65 119 87 106 65 90 77 82 99 119 70 81 89 68 86 81 81 68 69 119 53 108 101 71 70 116 99 71 120 108 76 109 78 118 98 83 66 68 81 84 66 90 77 66 77 71 66 121 113 71 83 77 52 57 10 65 103 69 71 67 67 113 71 83 77 52 57 65 119 69 72 65 48 73 65 66 75 55 104 47 53 68 56 98 86 57 51 77 109 69 100 104 117 48 50 74 115 83 54 117 103 66 56 115 54 80 122 82 108 51 80 86 52 120 115 51 83 98 114 10 82 78 107 107 77 53 57 43 120 51 98 48 105 87 120 47 105 55 54 113 80 89 112 78 76 111 105 86 85 86 88 81 109 65 57 89 43 52 68 98 77 120 105 106 85 122 66 82 77 65 52 71 65 49 85 100 68 119 69 66 47 119 81 69 10 65 119 73 66 66 106 65 80 66 103 78 86 72 82 77 66 65 102 56 69 66 84 65 68 65 81 72 47 77 66 48 71 65 49 85 100 68 103 81 87 66 66 81 71 121 85 105 85 49 81 69 90 105 77 65 113 106 115 110 73 89 84 119 90 10 52 121 112 53 119 122 65 80 66 103 78 86 72 82 69 69 67 68 65 71 104 119 82 47 65 65 65 66 77 65 111 71 67 67 113 71 83 77 52 57 66 65 77 67 65 48 103 65 77 69 85 67 73 81 68 122 100 116 118 75 100 69 56 79 10 49 43 87 82 84 90 57 77 117 83 105 70 89 99 114 69 122 55 90 110 101 55 86 88 111 117 68 69 75 113 75 69 105 103 73 103 77 52 87 108 98 68 101 117 78 67 75 98 113 104 113 106 43 120 90 86 48 112 97 51 114 119 101 98 10 79 68 56 69 106 106 67 77 89 54 57 82 77 79 48 61 10 45 45 45 45 45 69 78 68 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10]} <nil> <nil>}
    --- FAIL: Test_makeCientOptions/WithOAuth2Token (0.00s)
        client_options_test.go:304: unexpected authTransport, got (gitprovider.ChainableRoundTripperFunc)(0x8494e0), want (gitprovider.ChainableRoundTripperFunc)(0x856600)
FAIL
coverage: 87.0% of statements
FAIL    github.com/fluxcd/go-git-providers/gitprovider  0.055s
ok      github.com/fluxcd/go-git-providers/stash        6.988s  coverage: 34.0% of statements
ok      github.com/fluxcd/go-git-providers/validation   0.836s  coverage: 100.0% of statements
FAIL
make: *** [Makefile:44: test] Error 1

Signed-off-by: Erik Godding Boye <[email protected]>
@erikgb
Copy link
Contributor Author

erikgb commented Jan 2, 2025

@stefanprodan Would it be possible for you to approve the workflows and eventually review this PR, please. 🙏

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @erikgb 🏅

PS. If you can, please do this update in notification-controller

@stefanprodan stefanprodan added the dependencies Pull requests that update a dependency file label Jan 3, 2025
@stefanprodan stefanprodan merged commit ecb9610 into fluxcd:main Jan 3, 2025
6 of 8 checks passed
@stefanprodan stefanprodan changed the title Migrate to new GitLab client-go Migrate to gitlab.com/gitlab-org/api/client-go Jan 3, 2025
@erikgb
Copy link
Contributor Author

erikgb commented Jan 3, 2025

Sure @stefanprodan! I'll take a look at the notification-controller. In the meantime you can maybe review #308?

@erikgb
Copy link
Contributor Author

erikgb commented Jan 3, 2025

PR for doing the same in notification-controller is here: fluxcd/notification-controller#1016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants