diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-19 00:08:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-19 00:08:06 +0300 |
commit | af7558b036a53ebb0484e7978694a0b419c38c70 (patch) | |
tree | 198bc423fd5bb7ca04e652f5a0c1d66c7d42d2c4 /workhorse | |
parent | 055b4c04d5cef7029625c08619df4f3bcdccc6c2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'workhorse')
-rw-r--r-- | workhorse/internal/upstream/routes.go | 4 | ||||
-rw-r--r-- | workhorse/jobs_test.go | 7 | ||||
-rw-r--r-- | workhorse/upload_test.go | 7 |
3 files changed, 0 insertions, 18 deletions
diff --git a/workhorse/internal/upstream/routes.go b/workhorse/internal/upstream/routes.go index f1b4199b87f..9190ee71a32 100644 --- a/workhorse/internal/upstream/routes.go +++ b/workhorse/internal/upstream/routes.go @@ -47,7 +47,6 @@ type routeOptions struct { const ( apiPattern = `^/api/` - ciAPIPattern = `^/ci/api/` gitProjectPattern = `^/.+\.git/` geoGitProjectPattern = `^/[^-].+\.git/` // Prevent matching routes like /-/push_from_secondary projectPattern = `^/([^/]+/){1,}[^/]+/` @@ -246,7 +245,6 @@ func configureRoutes(u *upstream) { // CI Artifacts u.route("POST", apiPattern+`v4/jobs/[0-9]+/artifacts\z`, contentEncodingHandler(upload.Artifacts(api, signingProxy, preparer))), - u.route("POST", ciAPIPattern+`v1/builds/[0-9]+/artifacts\z`, contentEncodingHandler(upload.Artifacts(api, signingProxy, preparer))), // ActionCable websocket u.wsRoute(`^/-/cable\z`, cableProxy), @@ -260,7 +258,6 @@ func configureRoutes(u *upstream) { // Long poll and limit capacity given to jobs/request and builds/register.json u.route("", apiPattern+`v4/jobs/request\z`, ciAPILongPolling), - u.route("", ciAPIPattern+`v1/builds/register.json\z`, ciAPILongPolling), // Not all API endpoints support encoded project IDs // (e.g. `group%2Fproject`), but for the sake of consistency we @@ -351,7 +348,6 @@ func configureRoutes(u *upstream) { // Explicitly proxy API requests u.route("", apiPattern, proxy), - u.route("", ciAPIPattern, proxy), // Serve assets u.route( diff --git a/workhorse/jobs_test.go b/workhorse/jobs_test.go index fe51fc58d6a..d70c8d77d88 100644 --- a/workhorse/jobs_test.go +++ b/workhorse/jobs_test.go @@ -18,11 +18,6 @@ func startWorkhorseServerWithLongPolling(authBackend string, pollingDuration tim type requestJobFunction func(url string, body io.Reader) (*http.Response, error) -func requestJobV1(url string, body io.Reader) (*http.Response, error) { - resource := `/ci/api/v1/builds/register.json` - return http.Post(url+resource, `application/json`, body) -} - func requestJobV4(url string, body io.Reader) (*http.Response, error) { resource := `/api/v4/jobs/request` return http.Post(url+resource, `application/json`, body) @@ -50,11 +45,9 @@ func testJobsLongPollingEndpoint(t *testing.T, requestJob requestJobFunction) { } func TestJobsLongPollingEndpointDisabled(t *testing.T) { - testJobsLongPollingEndpointDisabled(t, requestJobV1) testJobsLongPollingEndpointDisabled(t, requestJobV4) } func TestJobsLongPollingEndpoint(t *testing.T) { - testJobsLongPollingEndpoint(t, requestJobV1) testJobsLongPollingEndpoint(t, requestJobV4) } diff --git a/workhorse/upload_test.go b/workhorse/upload_test.go index de7c5c6dd52..4af4a7f05aa 100644 --- a/workhorse/upload_test.go +++ b/workhorse/upload_test.go @@ -24,12 +24,6 @@ import ( type uploadArtifactsFunction func(url, contentType string, body io.Reader) (*http.Response, string, error) -func uploadArtifactsV1(url, contentType string, body io.Reader) (*http.Response, string, error) { - resource := `/ci/api/v1/builds/123/artifacts` - resp, err := http.Post(url+resource, contentType, body) - return resp, resource, err -} - func uploadArtifactsV4(url, contentType string, body io.Reader) (*http.Response, string, error) { resource := `/api/v4/jobs/123/artifacts` resp, err := http.Post(url+resource, contentType, body) @@ -54,7 +48,6 @@ func testArtifactsUpload(t *testing.T, uploadArtifacts uploadArtifactsFunction) } func TestArtifactsUpload(t *testing.T) { - testArtifactsUpload(t, uploadArtifactsV1) testArtifactsUpload(t, uploadArtifactsV4) } |