[go: up one dir, main page]

Skip to content

Fixed HTTPClient in retryablehttp.Client not taking over in newRetryableHTTPClientWithRetryCheck

This is a small bug in !2201 (merged)

For normal use cases, there was no problem.

However, there was a bug that when using gitlab.WithHTTPClient and gitlab.WithRequestRetry at the same time, the HTTPClient passed in with gitlab.WithHTTPClient was not used 😵

e.g.

myHTTPClient := &http.Client{}
git := gitlab.NewClient("MY_PRIVATE_TOKEN", gitlab.WithHTTPClient(myHTTPClient))

// myHTTPClient is not used here...
_, _, err := git.MergeRequests.AcceptMergeRequest(
	"user/my-repo", mrIID,
	&gitlab.AcceptMergeRequestOptions{MergeWhenPipelineSucceeds: gitlab.Ptr(true)},
	gitlab.WithRequestRetry(retryHTTPCheckForAcceptMergeRequest),
)

In fact, when mocking API communication using https://github.com/jarcoal/httpmock, there was a phenomenon that it did not work properly.

Edited by sue445

Merge request reports

Loading