-
- Downloads
feat: put retryablehttp.Client behind feature flag
What --- - Update the `client.HttpClient` fields to have `http.Client` and `retryablehttp.Client`, one of them will be `nil` depending on the feature flag toggle. - Create new method `newRetryableRequest` which will create a `retryablehttp.Request` and use that if the `FF_GITLAB_SHELL_RETRYABLE_HTTP` feature flag is turned on. - Add checks for `FF_GITLAB_SHELL_RETRYABLE_HTTP` everywhere we use the http client to use the `retryablehttp.Client` or the default `http.Client` - New job `tests-integration-retryableHttp` to run the integraiton tests with the new retryablehttp client. We didn't update go tests because some assertions are different and will break table driven tests. Why --- As discussed in https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/703#note_1229645097 we want to put the client behind a feature flag, not just the retry logic. This does bring extra risk for accessing a `nil` field but there should be checks everytime we access `RetryableHTTP` and `HTTPClient`. Reference: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/7979 Signed-off-by:Steve Azzopardi <sazzopardi@gitlab.com>
Showing
- .gitlab-ci.yml 7 additions, 0 deletions.gitlab-ci.yml
- client/client_test.go 5 additions, 1 deletionclient/client_test.go
- client/gitlabnet.go 43 additions, 5 deletionsclient/gitlabnet.go
- client/httpclient.go 20 additions, 9 deletionsclient/httpclient.go
- client/httpclient_test.go 7 additions, 2 deletionsclient/httpclient_test.go
- internal/command/discover/discover_test.go 26 additions, 24 deletionsinternal/command/discover/discover_test.go
- internal/command/healthcheck/healthcheck_test.go 1 addition, 1 deletioninternal/command/healthcheck/healthcheck_test.go
- internal/command/personalaccesstoken/personalaccesstoken_test.go 4 additions, 2 deletions...l/command/personalaccesstoken/personalaccesstoken_test.go
- internal/command/twofactorrecover/twofactorrecover_test.go 4 additions, 2 deletionsinternal/command/twofactorrecover/twofactorrecover_test.go
- internal/command/twofactorverify/twofactorverify_test.go 1 addition, 1 deletioninternal/command/twofactorverify/twofactorverify_test.go
- internal/config/config.go 8 additions, 2 deletionsinternal/config/config.go
- internal/config/config_test.go 36 additions, 24 deletionsinternal/config/config_test.go
- internal/gitlabnet/lfsauthenticate/client_test.go 1 addition, 1 deletioninternal/gitlabnet/lfsauthenticate/client_test.go
- spec/gitlab_shell_discover_spec.rb 6 additions, 1 deletionspec/gitlab_shell_discover_spec.rb
Please register or sign in to comment