From c57de18935771c6ab2a83c7cbe5149380767be00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Marseille?= Date: Wed, 27 Jun 2018 10:08:40 +0200 Subject: [PATCH] fix(version): upgrade refs to gitlab api from v3 to v4 --- commands.md | 12 ++++++------ commands/project_build_artifacts.go | 2 +- commands/project_build_artifacts_test.go | 10 +++++----- commands/project_builds_list.go | 2 +- commands/project_builds_list_test.go | 4 ++-- commands/project_list.go | 2 +- commands/project_list_test.go | 2 +- commands/s3_archive.go | 2 +- commands/s3_extract.go | 2 +- config.go | 2 +- integrations/flowdock/ci_flowdock_ci_status.go | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/commands.md b/commands.md index b57db86..10bf047 100644 --- a/commands.md +++ b/commands.md @@ -98,7 +98,7 @@ GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ### hipchat:message @@ -135,7 +135,7 @@ GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ### project:builds:artifacts @@ -159,7 +159,7 @@ GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ### project:list @@ -175,7 +175,7 @@ GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ### s3:archive @@ -203,7 +203,7 @@ GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ### s3:extract @@ -228,7 +228,7 @@ GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ### version diff --git a/commands/project_build_artifacts.go b/commands/project_build_artifacts.go index e379a45..85479c1 100644 --- a/commands/project_build_artifacts.go +++ b/commands/project_build_artifacts.go @@ -186,7 +186,7 @@ Credentials are retrieved from environment: GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ` return strings.TrimSpace(helpText) diff --git a/commands/project_build_artifacts_test.go b/commands/project_build_artifacts_test.go index bdcc946..bb4aa20 100644 --- a/commands/project_build_artifacts_test.go +++ b/commands/project_build_artifacts_test.go @@ -38,7 +38,7 @@ func Test_Project_Builds_Artifacts(t *testing.T) { reqs := []*helper.FakeRequest{ { - Path: "/api/v3/projects/3", + Path: "/api/v4/projects/3", Method: "GET", Response: &http.Response{ Body: fpProject, @@ -46,7 +46,7 @@ func Test_Project_Builds_Artifacts(t *testing.T) { }, }, { - Path: "/api/v3/projects", + Path: "/api/v4/projects", Method: "GET", Response: &http.Response{ Body: fpProjects, @@ -54,7 +54,7 @@ func Test_Project_Builds_Artifacts(t *testing.T) { }, }, { - Path: "/api/v3/projects/3/builds", + Path: "/api/v4/projects/3/builds", Method: "GET", Response: &http.Response{ Body: fpBuilds, @@ -62,7 +62,7 @@ func Test_Project_Builds_Artifacts(t *testing.T) { }, }, { - Path: "/api/v3/projects/3/repository/commits/889935cf4d3e7558ae6c0d4dd62e20ea600f5a57/builds", + Path: "/api/v4/projects/3/repository/commits/889935cf4d3e7558ae6c0d4dd62e20ea600f5a57/builds", Method: "GET", Response: &http.Response{ Body: fpCommits, @@ -70,7 +70,7 @@ func Test_Project_Builds_Artifacts(t *testing.T) { }, }, { - Path: "/api/v3/projects/3/builds/69/artifacts", + Path: "/api/v4/projects/3/builds/69/artifacts", Method: "GET", Response: &http.Response{ Body: fpArchive, diff --git a/commands/project_builds_list.go b/commands/project_builds_list.go index 1acd020..92c9bf3 100644 --- a/commands/project_builds_list.go +++ b/commands/project_builds_list.go @@ -116,7 +116,7 @@ Credentials are retrieved from environment: GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ` return strings.TrimSpace(helpText) diff --git a/commands/project_builds_list_test.go b/commands/project_builds_list_test.go index c389fd8..8d04ba2 100644 --- a/commands/project_builds_list_test.go +++ b/commands/project_builds_list_test.go @@ -25,14 +25,14 @@ func Test_Project_BuildsList_From_Args(t *testing.T) { reqs := []*helper.FakeRequest{ { - Path: "/api/v3/projects/3", + Path: "/api/v4/projects/3", Method: "GET", Response: &http.Response{ Body: fpProject, }, }, { - Path: "/api/v3/projects/3/builds", + Path: "/api/v4/projects/3/builds", Method: "GET", Response: &http.Response{ Body: fpBuild, diff --git a/commands/project_list.go b/commands/project_list.go index 8be89e1..707e4f8 100644 --- a/commands/project_list.go +++ b/commands/project_list.go @@ -71,7 +71,7 @@ Credentials are retrieved from environment: GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ` return strings.TrimSpace(helpText) diff --git a/commands/project_list_test.go b/commands/project_list_test.go index fe5b446..1988581 100644 --- a/commands/project_list_test.go +++ b/commands/project_list_test.go @@ -23,7 +23,7 @@ func Test_Project_List(t *testing.T) { reqs := []*helper.FakeRequest{ { - Path: "/api/v3/projects", + Path: "/api/v4/projects", Method: "GET", Response: &http.Response{ Body: fp, diff --git a/commands/s3_archive.go b/commands/s3_archive.go index c958c55..42cb07d 100644 --- a/commands/s3_archive.go +++ b/commands/s3_archive.go @@ -196,7 +196,7 @@ Credentials are retrieved from environment: GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ` return strings.TrimSpace(helpText) diff --git a/commands/s3_extract.go b/commands/s3_extract.go index 9faed9e..f25554e 100644 --- a/commands/s3_extract.go +++ b/commands/s3_extract.go @@ -169,7 +169,7 @@ Credentials are retrieved from environment: GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" ` return strings.TrimSpace(helpText) diff --git a/config.go b/config.go index aba769e..92a2876 100644 --- a/config.go +++ b/config.go @@ -34,7 +34,7 @@ func NewConfig() *Config { } if gitlab.ApiPath == "" { - gitlab.ApiPath = "/api/v3" + gitlab.ApiPath = "/api/v4" } return &Config{ diff --git a/integrations/flowdock/ci_flowdock_ci_status.go b/integrations/flowdock/ci_flowdock_ci_status.go index f035f78..5d75899 100644 --- a/integrations/flowdock/ci_flowdock_ci_status.go +++ b/integrations/flowdock/ci_flowdock_ci_status.go @@ -278,7 +278,7 @@ Gitlab's credentials are retrieved from environment: GITLAB_HOST The gitlab host GITLAB_TOKEN The user's token - GITLAB_API_PATH (optional) the api path, default to: "/api/v3" + GITLAB_API_PATH (optional) the api path, default to: "/api/v4" `, flowdockConfiguration)