diff --git a/compiler/registry/github/testdata/template.json b/compiler/registry/github/testdata/template.json index 699a6b846..bbc31496a 100644 --- a/compiler/registry/github/testdata/template.json +++ b/compiler/registry/github/testdata/template.json @@ -8,11 +8,11 @@ "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", "url": "https://api.github.com/repos/octokit/octokit.rb/contents/template.yml", "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", - "html_url": "https://github.com/octokit/octokit.rb/blob/master/template.yml", - "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/template.yml", + "html_url": "https://github.com/octokit/octokit.rb/blob/main/template.yml", + "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/main/template.yml", "_links": { "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", "self": "https://api.github.com/repos/octokit/octokit.rb/contents/template.yml", - "html": "https://github.com/octokit/octokit.rb/blob/master/template.yml" + "html": "https://github.com/octokit/octokit.rb/blob/main/template.yml" } } diff --git a/compiler/template/native/render_test.go b/compiler/template/native/render_test.go index 6f97092df..f4c92160d 100644 --- a/compiler/template/native/render_test.go +++ b/compiler/template/native/render_test.go @@ -122,7 +122,7 @@ func TestNative_RenderBuild(t *testing.T) { got, err := RenderBuild("build", string(sFile), map[string]string{ "VELA_REPO_FULL_NAME": "octocat/hello-world", - "VELA_BUILD_BRANCH": "master", + "VELA_BUILD_BRANCH": "main", }, map[string]interface{}{}) if (err != nil) != tt.wantErr { t.Errorf("RenderBuild() error = %v, wantErr %v", err, tt.wantErr) diff --git a/compiler/template/native/testdata/build/conditional/build.yml b/compiler/template/native/testdata/build/conditional/build.yml index 6c5745632..39acce9f5 100644 --- a/compiler/template/native/testdata/build/conditional/build.yml +++ b/compiler/template/native/testdata/build/conditional/build.yml @@ -5,7 +5,7 @@ version: "1" steps: - {{ if (eq $br "master") }} + {{ if (eq $br "main") }} - name: install commands: diff --git a/compiler/template/native/testdata/step/conditional/step.yml b/compiler/template/native/testdata/step/conditional/step.yml index f3e4401e8..e46064ad3 100644 --- a/compiler/template/native/testdata/step/conditional/step.yml +++ b/compiler/template/native/testdata/step/conditional/step.yml @@ -5,6 +5,6 @@ steps: vars: image: golang:latest pull_policy: "pull: true" - branch: master + branch: main \ No newline at end of file diff --git a/compiler/template/native/testdata/step/conditional/tmpl.yml b/compiler/template/native/testdata/step/conditional/tmpl.yml index f198f06e8..932ffeda9 100644 --- a/compiler/template/native/testdata/step/conditional/tmpl.yml +++ b/compiler/template/native/testdata/step/conditional/tmpl.yml @@ -5,7 +5,7 @@ metadata: steps: - {{ if (eq $br "master") }} + {{ if (eq $br "main") }} - name: install commands: diff --git a/compiler/template/native/testdata/step/to_yaml/step.yml b/compiler/template/native/testdata/step/to_yaml/step.yml index c8baf13d0..152394b36 100644 --- a/compiler/template/native/testdata/step/to_yaml/step.yml +++ b/compiler/template/native/testdata/step/to_yaml/step.yml @@ -5,4 +5,4 @@ steps: vars: ruleset: event: [push, pull_request] - branch: [master] + branch: [main] diff --git a/compiler/template/native/testdata/step/to_yaml/want.yml b/compiler/template/native/testdata/step/to_yaml/want.yml index 2eaa32d2d..e739a1f3f 100644 --- a/compiler/template/native/testdata/step/to_yaml/want.yml +++ b/compiler/template/native/testdata/step/to_yaml/want.yml @@ -5,4 +5,4 @@ steps: image: alpine ruleset: event: [ push, pull_request ] - branch: [ master ] + branch: [ main ] diff --git a/compiler/template/starlark/render_test.go b/compiler/template/starlark/render_test.go index 84eef6741..d07a74a6f 100644 --- a/compiler/template/starlark/render_test.go +++ b/compiler/template/starlark/render_test.go @@ -208,7 +208,7 @@ func TestNative_RenderBuild(t *testing.T) { got, err := RenderBuild("build", string(sFile), map[string]string{ "VELA_REPO_FULL_NAME": "octocat/hello-world", - "VELA_BUILD_BRANCH": "master", + "VELA_BUILD_BRANCH": "main", "VELA_REPO_ORG": "octocat", }, map[string]interface{}{}, tt.execLimit) if (err != nil) != tt.wantErr { diff --git a/compiler/template/starlark/testdata/build/conditional/build.star b/compiler/template/starlark/testdata/build/conditional/build.star index e00c5e3b8..5a1ab0b7b 100644 --- a/compiler/template/starlark/testdata/build/conditional/build.star +++ b/compiler/template/starlark/testdata/build/conditional/build.star @@ -4,7 +4,7 @@ def main(ctx): steps = [] for name in stepNames: - if name == "foo" and ctx["vela"]["build"]["branch"] == "master": + if name == "foo" and ctx["vela"]["build"]["branch"] == "main": steps.append(step(name)) return { diff --git a/database/build/last_repo_test.go b/database/build/last_repo_test.go index e4be37652..42ba67c7d 100644 --- a/database/build/last_repo_test.go +++ b/database/build/last_repo_test.go @@ -18,7 +18,7 @@ func TestBuild_Engine_LastBuildForRepo(t *testing.T) { _build.SetRepoID(1) _build.SetNumber(1) _build.SetDeployPayload(nil) - _build.SetBranch("master") + _build.SetBranch("main") _repo := testRepo() _repo.SetID(1) @@ -35,10 +35,10 @@ func TestBuild_Engine_LastBuildForRepo(t *testing.T) { // create expected result in mock _rows := sqlmock.NewRows( []string{"id", "repo_id", "pipeline_id", "number", "parent", "event", "event_action", "status", "error", "enqueued", "created", "started", "finished", "deploy", "deploy_payload", "clone", "source", "title", "message", "commit", "sender", "author", "email", "link", "branch", "ref", "base_ref", "head_ref", "host", "runtime", "distribution", "timestamp"}). - AddRow(1, 1, nil, 1, 0, "", "", "", "", 0, 0, 0, 0, "", nil, "", "", "", "", "", "", "", "", "", "master", "", "", "", "", "", "", 0) + AddRow(1, 1, nil, 1, 0, "", "", "", "", 0, 0, 0, 0, "", nil, "", "", "", "", "", "", "", "", "", "main", "", "", "", "", "", "", 0) // ensure the mock expects the query - _mock.ExpectQuery(`SELECT * FROM "builds" WHERE repo_id = $1 AND branch = $2 ORDER BY number DESC LIMIT 1`).WithArgs(1, "master").WillReturnRows(_rows) + _mock.ExpectQuery(`SELECT * FROM "builds" WHERE repo_id = $1 AND branch = $2 ORDER BY number DESC LIMIT 1`).WithArgs(1, "main").WillReturnRows(_rows) _sqlite := testSqlite(t) defer func() { _sql, _ := _sqlite.client.DB(); _sql.Close() }() @@ -72,7 +72,7 @@ func TestBuild_Engine_LastBuildForRepo(t *testing.T) { // run tests for _, test := range tests { t.Run(test.name, func(t *testing.T) { - got, err := test.database.LastBuildForRepo(context.TODO(), _repo, "master") + got, err := test.database.LastBuildForRepo(context.TODO(), _repo, "main") if test.failure { if err == nil { diff --git a/database/integration_test.go b/database/integration_test.go index f35a07e65..6aa55502d 100644 --- a/database/integration_test.go +++ b/database/integration_test.go @@ -1924,7 +1924,7 @@ func newResources() *Resources { deploymentOne.SetURL("https://github.com/github/octocat/deployments/1") deploymentOne.SetUser("octocat") deploymentOne.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - deploymentOne.SetRef("refs/heads/master") + deploymentOne.SetRef("refs/heads/main") deploymentOne.SetTask("vela-deploy") deploymentOne.SetTarget("production") deploymentOne.SetDescription("Deployment request from Vela") @@ -1936,7 +1936,7 @@ func newResources() *Resources { deploymentTwo.SetURL("https://github.com/github/octocat/deployments/2") deploymentTwo.SetUser("octocat") deploymentTwo.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135164") - deploymentTwo.SetRef("refs/heads/master") + deploymentTwo.SetRef("refs/heads/main") deploymentTwo.SetTask("vela-deploy") deploymentTwo.SetTarget("production") deploymentTwo.SetDescription("Deployment request from Vela") diff --git a/database/pipeline/count_repo_test.go b/database/pipeline/count_repo_test.go index 51bc359ee..e40888f3c 100644 --- a/database/pipeline/count_repo_test.go +++ b/database/pipeline/count_repo_test.go @@ -17,7 +17,7 @@ func TestPipeline_Engine_CountPipelinesForRepo(t *testing.T) { _pipelineOne.SetID(1) _pipelineOne.SetRepoID(1) _pipelineOne.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipelineOne.SetRef("refs/heads/master") + _pipelineOne.SetRef("refs/heads/main") _pipelineOne.SetType("yaml") _pipelineOne.SetVersion("1") diff --git a/database/pipeline/count_test.go b/database/pipeline/count_test.go index 3fc68b812..829acfd58 100644 --- a/database/pipeline/count_test.go +++ b/database/pipeline/count_test.go @@ -16,7 +16,7 @@ func TestPipeline_Engine_CountPipelines(t *testing.T) { _pipelineOne.SetID(1) _pipelineOne.SetRepoID(1) _pipelineOne.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipelineOne.SetRef("refs/heads/master") + _pipelineOne.SetRef("refs/heads/main") _pipelineOne.SetType("yaml") _pipelineOne.SetVersion("1") diff --git a/database/pipeline/create_test.go b/database/pipeline/create_test.go index f9850f0bd..f6a0b7af1 100644 --- a/database/pipeline/create_test.go +++ b/database/pipeline/create_test.go @@ -16,7 +16,7 @@ func TestPipeline_Engine_CreatePipeline(t *testing.T) { _pipeline.SetID(1) _pipeline.SetRepoID(1) _pipeline.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipeline.SetRef("refs/heads/master") + _pipeline.SetRef("refs/heads/main") _pipeline.SetType("yaml") _pipeline.SetVersion("1") _pipeline.SetData([]byte{}) @@ -31,7 +31,7 @@ func TestPipeline_Engine_CreatePipeline(t *testing.T) { _mock.ExpectQuery(`INSERT INTO "pipelines" ("repo_id","commit","flavor","platform","ref","type","version","external_secrets","internal_secrets","services","stages","steps","templates","data","id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15) RETURNING "id"`). - WithArgs(1, "48afb5bdc41ad69bf22588491333f7cf71135163", nil, nil, "refs/heads/master", "yaml", "1", false, false, false, false, false, false, AnyArgument{}, 1). + WithArgs(1, "48afb5bdc41ad69bf22588491333f7cf71135163", nil, nil, "refs/heads/main", "yaml", "1", false, false, false, false, false, false, AnyArgument{}, 1). WillReturnRows(_rows) _sqlite := testSqlite(t) diff --git a/database/pipeline/delete_test.go b/database/pipeline/delete_test.go index 14499551f..2b141b702 100644 --- a/database/pipeline/delete_test.go +++ b/database/pipeline/delete_test.go @@ -15,7 +15,7 @@ func TestPipeline_Engine_DeletePipeline(t *testing.T) { _pipeline.SetID(1) _pipeline.SetRepoID(1) _pipeline.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipeline.SetRef("refs/heads/master") + _pipeline.SetRef("refs/heads/main") _pipeline.SetType("yaml") _pipeline.SetVersion("1") diff --git a/database/pipeline/get_repo_test.go b/database/pipeline/get_repo_test.go index 592e86cb1..e01a4514d 100644 --- a/database/pipeline/get_repo_test.go +++ b/database/pipeline/get_repo_test.go @@ -17,7 +17,7 @@ func TestPipeline_Engine_GetPipelineForRepo(t *testing.T) { _pipeline.SetID(1) _pipeline.SetRepoID(1) _pipeline.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipeline.SetRef("refs/heads/master") + _pipeline.SetRef("refs/heads/main") _pipeline.SetType("yaml") _pipeline.SetVersion("1") _pipeline.SetData([]byte("foo")) @@ -28,7 +28,7 @@ func TestPipeline_Engine_GetPipelineForRepo(t *testing.T) { // create expected result in mock _rows := sqlmock.NewRows( []string{"id", "repo_id", "commit", "flavor", "platform", "ref", "type", "version", "services", "stages", "steps", "templates", "data"}). - AddRow(1, 1, "48afb5bdc41ad69bf22588491333f7cf71135163", "", "", "refs/heads/master", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}) + AddRow(1, 1, "48afb5bdc41ad69bf22588491333f7cf71135163", "", "", "refs/heads/main", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}) // ensure the mock expects the query _mock.ExpectQuery(`SELECT * FROM "pipelines" WHERE repo_id = $1 AND "commit" = $2 LIMIT 1`).WithArgs(1, "48afb5bdc41ad69bf22588491333f7cf71135163").WillReturnRows(_rows) diff --git a/database/pipeline/get_test.go b/database/pipeline/get_test.go index 67e4872cf..61119e6bb 100644 --- a/database/pipeline/get_test.go +++ b/database/pipeline/get_test.go @@ -17,7 +17,7 @@ func TestPipeline_Engine_GetPipeline(t *testing.T) { _pipeline.SetID(1) _pipeline.SetRepoID(1) _pipeline.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipeline.SetRef("refs/heads/master") + _pipeline.SetRef("refs/heads/main") _pipeline.SetType("yaml") _pipeline.SetVersion("1") _pipeline.SetData([]byte("foo")) @@ -28,7 +28,7 @@ func TestPipeline_Engine_GetPipeline(t *testing.T) { // create expected result in mock _rows := sqlmock.NewRows( []string{"id", "repo_id", "commit", "flavor", "platform", "ref", "type", "version", "services", "stages", "steps", "templates", "data"}). - AddRow(1, 1, "48afb5bdc41ad69bf22588491333f7cf71135163", "", "", "refs/heads/master", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}) + AddRow(1, 1, "48afb5bdc41ad69bf22588491333f7cf71135163", "", "", "refs/heads/main", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}) // ensure the mock expects the query _mock.ExpectQuery(`SELECT * FROM "pipelines" WHERE id = $1 LIMIT 1`).WithArgs(1).WillReturnRows(_rows) diff --git a/database/pipeline/list_repo_test.go b/database/pipeline/list_repo_test.go index b35ffb433..840d4bd6b 100644 --- a/database/pipeline/list_repo_test.go +++ b/database/pipeline/list_repo_test.go @@ -17,7 +17,7 @@ func TestPipeline_Engine_ListPipelinesForRepo(t *testing.T) { _pipelineOne.SetID(1) _pipelineOne.SetRepoID(1) _pipelineOne.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipelineOne.SetRef("refs/heads/master") + _pipelineOne.SetRef("refs/heads/main") _pipelineOne.SetType("yaml") _pipelineOne.SetVersion("1") _pipelineOne.SetData([]byte("foo")) @@ -43,7 +43,7 @@ func TestPipeline_Engine_ListPipelinesForRepo(t *testing.T) { // create expected result in mock _rows = sqlmock.NewRows( []string{"id", "repo_id", "commit", "flavor", "platform", "ref", "type", "version", "services", "stages", "steps", "templates", "data"}). - AddRow(1, 1, "48afb5bdc41ad69bf22588491333f7cf71135163", "", "", "refs/heads/master", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}). + AddRow(1, 1, "48afb5bdc41ad69bf22588491333f7cf71135163", "", "", "refs/heads/main", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}). AddRow(2, 1, "a49aaf4afae6431a79239c95247a2b169fd9f067", "", "", "refs/heads/main", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}) // ensure the mock expects the query diff --git a/database/pipeline/list_test.go b/database/pipeline/list_test.go index 4e322da37..02779e483 100644 --- a/database/pipeline/list_test.go +++ b/database/pipeline/list_test.go @@ -17,7 +17,7 @@ func TestPipeline_Engine_ListPipelines(t *testing.T) { _pipelineOne.SetID(1) _pipelineOne.SetRepoID(1) _pipelineOne.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipelineOne.SetRef("refs/heads/master") + _pipelineOne.SetRef("refs/heads/main") _pipelineOne.SetType("yaml") _pipelineOne.SetVersion("1") _pipelineOne.SetData([]byte("foo")) @@ -43,7 +43,7 @@ func TestPipeline_Engine_ListPipelines(t *testing.T) { // create expected result in mock _rows = sqlmock.NewRows( []string{"id", "repo_id", "commit", "flavor", "platform", "ref", "type", "version", "services", "stages", "steps", "templates", "data"}). - AddRow(1, 1, "48afb5bdc41ad69bf22588491333f7cf71135163", "", "", "refs/heads/master", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}). + AddRow(1, 1, "48afb5bdc41ad69bf22588491333f7cf71135163", "", "", "refs/heads/main", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}). AddRow(2, 2, "a49aaf4afae6431a79239c95247a2b169fd9f067", "", "", "refs/heads/main", "yaml", "1", false, false, false, false, []byte{120, 94, 74, 203, 207, 7, 4, 0, 0, 255, 255, 2, 130, 1, 69}) // ensure the mock expects the query diff --git a/database/pipeline/update_test.go b/database/pipeline/update_test.go index a90d52c8f..a489913ab 100644 --- a/database/pipeline/update_test.go +++ b/database/pipeline/update_test.go @@ -16,7 +16,7 @@ func TestPipeline_Engine_UpdatePipeline(t *testing.T) { _pipeline.SetID(1) _pipeline.SetRepoID(1) _pipeline.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") - _pipeline.SetRef("refs/heads/master") + _pipeline.SetRef("refs/heads/main") _pipeline.SetType("yaml") _pipeline.SetVersion("1") _pipeline.SetData([]byte{}) @@ -28,7 +28,7 @@ func TestPipeline_Engine_UpdatePipeline(t *testing.T) { _mock.ExpectExec(`UPDATE "pipelines" SET "repo_id"=$1,"commit"=$2,"flavor"=$3,"platform"=$4,"ref"=$5,"type"=$6,"version"=$7,"external_secrets"=$8,"internal_secrets"=$9,"services"=$10,"stages"=$11,"steps"=$12,"templates"=$13,"data"=$14 WHERE "id" = $15`). - WithArgs(1, "48afb5bdc41ad69bf22588491333f7cf71135163", nil, nil, "refs/heads/master", "yaml", "1", false, false, false, false, false, false, AnyArgument{}, 1). + WithArgs(1, "48afb5bdc41ad69bf22588491333f7cf71135163", nil, nil, "refs/heads/main", "yaml", "1", false, false, false, false, false, false, AnyArgument{}, 1). WillReturnResult(sqlmock.NewResult(1, 1)) _sqlite := testSqlite(t) diff --git a/mock/server/build.go b/mock/server/build.go index 0c19e5f8d..3edc55bf0 100644 --- a/mock/server/build.go +++ b/mock/server/build.go @@ -37,8 +37,8 @@ const ( "author": "OctoKitty", "email": "octokitty@github.com", "link": "https://vela.example.company.com/github/octocat/1", - "branch": "master", - "ref": "refs/heads/master", + "branch": "main", + "ref": "refs/heads/main", "base_ref": "", "host": "example.company.com", "runtime": "docker", @@ -69,8 +69,8 @@ const ( "author": "OctoKitty", "email": "octokitty@github.com", "link": "https://vela.example.company.com/github/octocat/1", - "branch": "master", - "ref": "refs/heads/master", + "branch": "main", + "ref": "refs/heads/main", "base_ref": "", "host": "ed95dcc0687c", "runtime": "", @@ -98,8 +98,8 @@ const ( "author": "OctoKitty", "email": "octokitty@github.com", "link": "https://vela.example.company.com/github/octocat/1", - "branch": "master", - "ref": "refs/heads/master", + "branch": "main", + "ref": "refs/heads/main", "base_ref": "", "host": "82823eb770b0", "runtime": "", diff --git a/mock/server/deployment.go b/mock/server/deployment.go index 51729476b..875432823 100644 --- a/mock/server/deployment.go +++ b/mock/server/deployment.go @@ -21,7 +21,7 @@ const ( "url": "https://api.github.com/repos/github/octocat/deployments/1", "user": "octocat", "commit": "48afb5bdc41ad69bf22588491333f7cf71135163", - "ref": "master", + "ref": "main", "task": "deploy:vela", "target": "production", "description": "Deployment request from Vela" @@ -35,7 +35,7 @@ const ( "url": "https://api.github.com/repos/github/octocat/deployments/2", "user": "octocat", "commit": "48afb5bdc41ad69bf22588491333f7cf71135163", - "ref": "master", + "ref": "main", "task": "deploy:vela", "target": "production", "description": "Deployment request from Vela" @@ -46,7 +46,7 @@ const ( "url": "https://api.github.com/repos/github/octocat/deployments/1", "user": "octocat", "commit": "48afb5bdc41ad69bf22588491333f7cf71135163", - "ref": "master", + "ref": "main", "task": "deploy:vela", "target": "production", "description": "Deployment request from Vela" diff --git a/mock/server/hook.go b/mock/server/hook.go index f1c662c92..9c874de4a 100644 --- a/mock/server/hook.go +++ b/mock/server/hook.go @@ -25,7 +25,7 @@ const ( "created": 1563475419, "host": "github.com", "event": "push", - "branch": "master", + "branch": "main", "error": "", "status": "success", "link": "https://github.com/github/octocat/settings/hooks/1" @@ -42,7 +42,7 @@ const ( "created": 1563475420, "host": "github.com", "event": "push", - "branch": "master", + "branch": "main", "error": "", "status": "success", "link": "https://github.com/github/octocat/settings/hooks/1" @@ -56,7 +56,7 @@ const ( "created": 1563475419, "host": "github.com", "event": "push", - "branch": "master", + "branch": "main", "error": "", "status": "success", "link": "https://github.com/github/octocat/settings/hooks/1" diff --git a/mock/server/pipeline.go b/mock/server/pipeline.go index baaf4da4d..73ee1b42f 100644 --- a/mock/server/pipeline.go +++ b/mock/server/pipeline.go @@ -110,7 +110,7 @@ templates: "commit": "48afb5bdc41ad69bf22588491333f7cf71135163", "flavor": "", "platform": "", - "ref": "refs/heads/master", + "ref": "refs/heads/main", "type": "yaml", "version": "1", "external_secrets": false, @@ -130,7 +130,7 @@ templates: "commit": "a49aaf4afae6431a79239c95247a2b169fd9f067", "flavor": "", "platform": "", - "ref": "refs/heads/master", + "ref": "refs/heads/main", "type": "yaml", "version": "1", "external_secrets": false, @@ -147,7 +147,7 @@ templates: "commit": "48afb5bdc41ad69bf22588491333f7cf71135163", "flavor": "", "platform": "", - "ref": "refs/heads/master", + "ref": "refs/heads/main", "type": "yaml", "version": "1", "external_secrets": false, diff --git a/mock/server/repo.go b/mock/server/repo.go index 1cc8a9293..724ba875b 100644 --- a/mock/server/repo.go +++ b/mock/server/repo.go @@ -23,7 +23,7 @@ const ( "full_name": "github/octocat", "link": "https://github.com/github/octocat", "clone": "https://github.com/github/octocat", - "branch": "master", + "branch": "main", "build_limit": 10, "timeout": 60, "visibility": "public", @@ -46,7 +46,7 @@ const ( "full_name": "github/octocat", "link": "https://github.com/github/octocat", "clone": "https://github.com/github/octocat", - "branch": "master", + "branch": "main", "build_limit": 10, "timeout": 60, "visibility": "public", @@ -66,7 +66,7 @@ const ( "full_name": "github/octokitty", "link": "https://github.com/github/octokitty", "clone": "https://github.com/github/octokitty", - "branch": "master", + "branch": "main", "build_limit": 10, "timeout": 60, "visibility": "public", diff --git a/queue/redis/redis_test.go b/queue/redis/redis_test.go index 328149eb7..919892976 100644 --- a/queue/redis/redis_test.go +++ b/queue/redis/redis_test.go @@ -65,8 +65,8 @@ var ( Commit: String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: String("OctoKitty"), Author: String("OctoKitty"), - Branch: String("master"), - Ref: String("refs/heads/master"), + Branch: String("main"), + Ref: String("refs/heads/main"), BaseRef: String(""), Host: String("example.company.com"), Runtime: String("docker"), @@ -80,7 +80,7 @@ var ( FullName: String("github/octocat"), Link: String("https://github.com/github/octocat"), Clone: String("https://github.com/github/octocat.git"), - Branch: String("master"), + Branch: String("main"), Timeout: Int64(60), Visibility: String("public"), Private: Bool(false), diff --git a/router/middleware/pipeline/pipeline_test.go b/router/middleware/pipeline/pipeline_test.go index 2a8327c9d..80df22009 100644 --- a/router/middleware/pipeline/pipeline_test.go +++ b/router/middleware/pipeline/pipeline_test.go @@ -81,7 +81,7 @@ func TestPipeline_Establish(t *testing.T) { want.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") want.SetFlavor("") want.SetPlatform("") - want.SetRef("refs/heads/master") + want.SetRef("refs/heads/main") want.SetType("yaml") want.SetVersion("1") want.SetExternalSecrets(false) diff --git a/router/middleware/pipeline/testdata/yml.json b/router/middleware/pipeline/testdata/yml.json index 458ecaa44..fbcb8e6dd 100644 --- a/router/middleware/pipeline/testdata/yml.json +++ b/router/middleware/pipeline/testdata/yml.json @@ -8,11 +8,11 @@ "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", "url": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.yml", "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", - "html_url": "https://github.com/octokit/octokit.rb/blob/master/.vela.yml", - "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/.vela.yml", + "html_url": "https://github.com/octokit/octokit.rb/blob/main/.vela.yml", + "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/main/.vela.yml", "_links": { "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", "self": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.yml", - "html": "https://github.com/octokit/octokit.rb/blob/master/.vela.yml" + "html": "https://github.com/octokit/octokit.rb/blob/main/.vela.yml" } } \ No newline at end of file diff --git a/scm/github/repo_test.go b/scm/github/repo_test.go index cc6725420..128e9d77d 100644 --- a/scm/github/repo_test.go +++ b/scm/github/repo_test.go @@ -1098,7 +1098,7 @@ func TestGithub_GetRepo(t *testing.T) { want.SetFullName("octocat/Hello-World") want.SetLink("https://github.com/octocat/Hello-World") want.SetClone("https://github.com/octocat/Hello-World.git") - want.SetBranch("master") + want.SetBranch("main") want.SetPrivate(false) want.SetTopics([]string{"octocat", "atom", "electron", "api"}) want.SetVisibility("public") @@ -1262,7 +1262,7 @@ func TestGithub_ListUserRepos(t *testing.T) { r.SetFullName("octocat/Hello-World") r.SetLink("https://github.com/octocat/Hello-World") r.SetClone("https://github.com/octocat/Hello-World.git") - r.SetBranch("master") + r.SetBranch("main") r.SetPrivate(false) r.SetTopics([]string{"octocat", "atom", "electron", "api"}) r.SetVisibility("public") @@ -1348,8 +1348,8 @@ func TestGithub_GetPullRequest(t *testing.T) { r.SetName("Hello-World") wantCommit := "6dcb09b5b57875f334f61aebed695e2e4193db5e" - wantBranch := "master" - wantBaseRef := "master" + wantBranch := "main" + wantBaseRef := "main" wantHeadRef := "new-topic" client, _ := NewTest(s.URL) diff --git a/scm/github/testdata/get_pull_request.json b/scm/github/testdata/get_pull_request.json index c5dcc6467..455dc9c76 100644 --- a/scm/github/testdata/get_pull_request.json +++ b/scm/github/testdata/get_pull_request.json @@ -291,7 +291,7 @@ "stargazers_count": 80, "watchers_count": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "is_template": true, "topics": [ @@ -326,8 +326,8 @@ } }, "base": { - "label": "octocat:master", - "ref": "master", + "label": "octocat:main", + "ref": "main", "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", "user": { "login": "octocat", @@ -426,7 +426,7 @@ "stargazers_count": 80, "watchers_count": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "is_template": true, "topics": [ diff --git a/scm/github/testdata/get_repo.json b/scm/github/testdata/get_repo.json index 630ce53e5..4e110616d 100644 --- a/scm/github/testdata/get_repo.json +++ b/scm/github/testdata/get_repo.json @@ -75,7 +75,7 @@ "stargazers_count": 80, "watchers_count": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "is_template": true, "topics": [ diff --git a/scm/github/testdata/hooks/deployment.json b/scm/github/testdata/hooks/deployment.json index 34b21e143..f12dae46d 100644 --- a/scm/github/testdata/hooks/deployment.json +++ b/scm/github/testdata/hooks/deployment.json @@ -5,7 +5,7 @@ "id": 145988746, "node_id": "MDEwOkRlcGxveW1lbnQxNDU5ODg3NDY=", "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", - "ref": "master", + "ref": "main", "task": "deploy", "payload": { "foo": "test1", @@ -131,7 +131,7 @@ "forks": 1, "open_issues": 2, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/deployment_commit.json b/scm/github/testdata/hooks/deployment_commit.json index fbbfa7553..528d9eeb8 100644 --- a/scm/github/testdata/hooks/deployment_commit.json +++ b/scm/github/testdata/hooks/deployment_commit.json @@ -129,7 +129,7 @@ "forks": 1, "open_issues": 2, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/deployment_unexpected_json_payload.json b/scm/github/testdata/hooks/deployment_unexpected_json_payload.json index c49f9a84a..5fad3f6c3 100644 --- a/scm/github/testdata/hooks/deployment_unexpected_json_payload.json +++ b/scm/github/testdata/hooks/deployment_unexpected_json_payload.json @@ -5,7 +5,7 @@ "id": 145988746, "node_id": "MDEwOkRlcGxveW1lbnQxNDU5ODg3NDY=", "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", - "ref": "master", + "ref": "main", "task": "deploy", "payload": { "foo": { @@ -132,7 +132,7 @@ "forks": 1, "open_issues": 2, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/deployment_unexpected_text_payload.json b/scm/github/testdata/hooks/deployment_unexpected_text_payload.json index c91a9ebed..a4de6c8d3 100644 --- a/scm/github/testdata/hooks/deployment_unexpected_text_payload.json +++ b/scm/github/testdata/hooks/deployment_unexpected_text_payload.json @@ -5,7 +5,7 @@ "id": 145988746, "node_id": "MDEwOkRlcGxveW1lbnQxNDU5ODg3NDY=", "sha": "f95f852bd8fca8fcc58a9a2d6c842781e32a215e", - "ref": "master", + "ref": "main", "task": "deploy", "payload": "foo", "original_environment": "production", @@ -128,7 +128,7 @@ "forks": 1, "open_issues": 2, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/issue_comment_created.json b/scm/github/testdata/hooks/issue_comment_created.json index aab7789cc..dd5cb87f5 100644 --- a/scm/github/testdata/hooks/issue_comment_created.json +++ b/scm/github/testdata/hooks/issue_comment_created.json @@ -171,7 +171,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/issue_comment_deleted.json b/scm/github/testdata/hooks/issue_comment_deleted.json index 42a5552fc..501dbc837 100644 --- a/scm/github/testdata/hooks/issue_comment_deleted.json +++ b/scm/github/testdata/hooks/issue_comment_deleted.json @@ -171,7 +171,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/issue_comment_pr.json b/scm/github/testdata/hooks/issue_comment_pr.json index 4cfae19ae..fa162ed02 100644 --- a/scm/github/testdata/hooks/issue_comment_pr.json +++ b/scm/github/testdata/hooks/issue_comment_pr.json @@ -177,7 +177,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/pull_request.json b/scm/github/testdata/hooks/pull_request.json index ffcd0c4a1..2d16c9ee7 100644 --- a/scm/github/testdata/hooks/pull_request.json +++ b/scm/github/testdata/hooks/pull_request.json @@ -33,7 +33,7 @@ "type": "User", "site_admin": false }, - "body": "This is a pretty simple change that we need to pull into master.", + "body": "This is a pretty simple change that we need to pull into main.", "created_at": "2018-05-30T20:18:30Z", "updated_at": "2018-05-30T20:18:50Z", "closed_at": "2018-05-30T20:18:50Z", @@ -173,12 +173,12 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" } }, "base": { - "label": "Codertocat:master", - "ref": "master", + "label": "Codertocat:main", + "ref": "main", "sha": "a10867b14bb761a232cd80139fbd4c0d33264240", "user": { "login": "Codertocat", @@ -291,7 +291,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" } }, "_links": { @@ -425,7 +425,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/pull_request_closed_action.json b/scm/github/testdata/hooks/pull_request_closed_action.json index cc6380473..5aecb6806 100644 --- a/scm/github/testdata/hooks/pull_request_closed_action.json +++ b/scm/github/testdata/hooks/pull_request_closed_action.json @@ -33,7 +33,7 @@ "type": "User", "site_admin": false }, - "body": "This is a pretty simple change that we need to pull into master.", + "body": "This is a pretty simple change that we need to pull into main.", "created_at": "2018-05-30T20:18:30Z", "updated_at": "2018-05-30T20:18:50Z", "closed_at": "2018-05-30T20:18:50Z", @@ -173,12 +173,12 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" } }, "base": { - "label": "Codertocat:master", - "ref": "master", + "label": "Codertocat:main", + "ref": "main", "sha": "a10867b14bb761a232cd80139fbd4c0d33264240", "user": { "login": "Codertocat", @@ -291,7 +291,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" } }, "_links": { @@ -425,7 +425,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/pull_request_closed_state.json b/scm/github/testdata/hooks/pull_request_closed_state.json index a74a828e8..65491ce94 100644 --- a/scm/github/testdata/hooks/pull_request_closed_state.json +++ b/scm/github/testdata/hooks/pull_request_closed_state.json @@ -33,7 +33,7 @@ "type": "User", "site_admin": false }, - "body": "This is a pretty simple change that we need to pull into master.", + "body": "This is a pretty simple change that we need to pull into main.", "created_at": "2018-05-30T20:18:30Z", "updated_at": "2018-05-30T20:18:50Z", "closed_at": "2018-05-30T20:18:50Z", @@ -173,12 +173,12 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" } }, "base": { - "label": "Codertocat:master", - "ref": "master", + "label": "Codertocat:main", + "ref": "main", "sha": "a10867b14bb761a232cd80139fbd4c0d33264240", "user": { "login": "Codertocat", @@ -291,7 +291,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" } }, "_links": { @@ -425,7 +425,7 @@ "forks": 0, "open_issues": 1, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "sender": { "login": "Codertocat", diff --git a/scm/github/testdata/hooks/push.json b/scm/github/testdata/hooks/push.json index 7058efe6b..9bc15cdb0 100644 --- a/scm/github/testdata/hooks/push.json +++ b/scm/github/testdata/hooks/push.json @@ -1,5 +1,5 @@ { - "ref": "refs/heads/master", + "ref": "refs/heads/main", "before": "d3d9188fc87a6977343e922c128f162a86018d76", "after": "9c93babf58917cd6f6f6772b5df2b098f507ff95", "created": false, @@ -154,9 +154,9 @@ "forks": 0, "open_issues": 2, "watchers": 0, - "default_branch": "master", + "default_branch": "main", "stargazers": 0, - "master_branch": "master", + "master_branch": "main", "topics": [ "go", "vela" diff --git a/scm/github/testdata/hooks/push_no_sender.json b/scm/github/testdata/hooks/push_no_sender.json index f9bef26d3..b87fc8c93 100644 --- a/scm/github/testdata/hooks/push_no_sender.json +++ b/scm/github/testdata/hooks/push_no_sender.json @@ -1,5 +1,5 @@ { - "ref": "refs/heads/master", + "ref": "refs/heads/main", "before": "d3d9188fc87a6977343e922c128f162a86018d76", "after": "9c93babf58917cd6f6f6772b5df2b098f507ff95", "created": false, @@ -154,9 +154,9 @@ "forks": 0, "open_issues": 2, "watchers": 0, - "default_branch": "master", + "default_branch": "main", "stargazers": 0, - "master_branch": "master", + "master_branch": "main", "topics": [ "go", "vela" diff --git a/scm/github/testdata/hooks/repository_archived.json b/scm/github/testdata/hooks/repository_archived.json index b9c0ff71b..2cc42e07a 100644 --- a/scm/github/testdata/hooks/repository_archived.json +++ b/scm/github/testdata/hooks/repository_archived.json @@ -92,7 +92,7 @@ "forks": 0, "open_issues": 2, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "enterprise": { "id": 1, diff --git a/scm/github/testdata/hooks/repository_publicized.json b/scm/github/testdata/hooks/repository_publicized.json index 50d8ff5d1..e75125ebe 100644 --- a/scm/github/testdata/hooks/repository_publicized.json +++ b/scm/github/testdata/hooks/repository_publicized.json @@ -92,7 +92,7 @@ "forks": 0, "open_issues": 2, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "enterprise": { "id": 1, diff --git a/scm/github/testdata/hooks/repository_rename.json b/scm/github/testdata/hooks/repository_rename.json index 69652ce44..51f49ff4b 100644 --- a/scm/github/testdata/hooks/repository_rename.json +++ b/scm/github/testdata/hooks/repository_rename.json @@ -99,7 +99,7 @@ "forks": 0, "open_issues": 2, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "enterprise": { "id": 1, diff --git a/scm/github/testdata/hooks/repository_transferred.json b/scm/github/testdata/hooks/repository_transferred.json index 2fdea23f6..37e9b2f83 100644 --- a/scm/github/testdata/hooks/repository_transferred.json +++ b/scm/github/testdata/hooks/repository_transferred.json @@ -118,7 +118,7 @@ "forks": 0, "open_issues": 2, "watchers": 0, - "default_branch": "master" + "default_branch": "main" }, "enterprise": { "id": 1, diff --git a/scm/github/testdata/listuserrepos.json b/scm/github/testdata/listuserrepos.json index 4cfcb4253..acbe35a85 100644 --- a/scm/github/testdata/listuserrepos.json +++ b/scm/github/testdata/listuserrepos.json @@ -76,7 +76,7 @@ "stargazers_count": 80, "watchers_count": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "is_template": true, "topics": [ diff --git a/scm/github/testdata/listuserrepos_ineligible.json b/scm/github/testdata/listuserrepos_ineligible.json index dec89bc8f..1cd26690c 100644 --- a/scm/github/testdata/listuserrepos_ineligible.json +++ b/scm/github/testdata/listuserrepos_ineligible.json @@ -76,7 +76,7 @@ "stargazers_count": 80, "watchers_count": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "is_template": true, "topics": [ @@ -188,7 +188,7 @@ "stargazers_count": 80, "watchers_count": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "is_template": true, "topics": [ diff --git a/scm/github/testdata/py.json b/scm/github/testdata/py.json index 6e9917242..cd33aa29e 100644 --- a/scm/github/testdata/py.json +++ b/scm/github/testdata/py.json @@ -8,11 +8,11 @@ "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", "url": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.py", "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", - "html_url": "https://github.com/octokit/octokit.rb/blob/master/.vela.py", - "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/.vela.py", + "html_url": "https://github.com/octokit/octokit.rb/blob/main/.vela.py", + "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/main/.vela.py", "_links": { "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", "self": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.py", - "html": "https://github.com/octokit/octokit.rb/blob/master/.vela.py" + "html": "https://github.com/octokit/octokit.rb/blob/main/.vela.py" } } diff --git a/scm/github/testdata/star.json b/scm/github/testdata/star.json index e1bc3a00d..b6d909593 100644 --- a/scm/github/testdata/star.json +++ b/scm/github/testdata/star.json @@ -8,11 +8,11 @@ "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", "url": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.star", "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", - "html_url": "https://github.com/octokit/octokit.rb/blob/master/.vela.star", - "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/.vela.star", + "html_url": "https://github.com/octokit/octokit.rb/blob/main/.vela.star", + "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/main/.vela.star", "_links": { "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", "self": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.star", - "html": "https://github.com/octokit/octokit.rb/blob/master/.vela.star" + "html": "https://github.com/octokit/octokit.rb/blob/main/.vela.star" } } diff --git a/scm/github/testdata/yaml.json b/scm/github/testdata/yaml.json index fd1ec65f1..f8c6acab3 100644 --- a/scm/github/testdata/yaml.json +++ b/scm/github/testdata/yaml.json @@ -8,11 +8,11 @@ "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", "url": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.yaml", "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", - "html_url": "https://github.com/octokit/octokit.rb/blob/master/.vela.yaml", - "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/.vela.yaml", + "html_url": "https://github.com/octokit/octokit.rb/blob/main/.vela.yaml", + "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/main/.vela.yaml", "_links": { "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", "self": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.yaml", - "html": "https://github.com/octokit/octokit.rb/blob/master/.vela.yaml" + "html": "https://github.com/octokit/octokit.rb/blob/main/.vela.yaml" } } diff --git a/scm/github/testdata/yml.json b/scm/github/testdata/yml.json index 9364dec2f..a84c704be 100644 --- a/scm/github/testdata/yml.json +++ b/scm/github/testdata/yml.json @@ -8,11 +8,11 @@ "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", "url": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.yml", "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", - "html_url": "https://github.com/octokit/octokit.rb/blob/master/.vela.yml", - "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/.vela.yml", + "html_url": "https://github.com/octokit/octokit.rb/blob/main/.vela.yml", + "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/main/.vela.yml", "_links": { "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", "self": "https://api.github.com/repos/octokit/octokit.rb/contents/.vela.yml", - "html": "https://github.com/octokit/octokit.rb/blob/master/.vela.yml" + "html": "https://github.com/octokit/octokit.rb/blob/main/.vela.yml" } } diff --git a/scm/github/webhook_test.go b/scm/github/webhook_test.go index 323e3d9c7..59139a99f 100644 --- a/scm/github/webhook_test.go +++ b/scm/github/webhook_test.go @@ -52,7 +52,7 @@ func TestGithub_ProcessWebhook_Push(t *testing.T) { wantHook.SetCreated(time.Now().UTC().Unix()) wantHook.SetHost("github.com") wantHook.SetEvent("push") - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -62,7 +62,7 @@ func TestGithub_ProcessWebhook_Push(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://github.com/Codertocat/Hello-World") wantRepo.SetClone("https://github.com/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics([]string{"go", "vela"}) @@ -76,8 +76,8 @@ func TestGithub_ProcessWebhook_Push(t *testing.T) { wantBuild.SetSender("Codertocat") wantBuild.SetAuthor("Codertocat") wantBuild.SetEmail("21031067+Codertocat@users.noreply.github.com") - wantBuild.SetBranch("master") - wantBuild.SetRef("refs/heads/master") + wantBuild.SetBranch("main") + wantBuild.SetRef("refs/heads/main") wantBuild.SetBaseRef("") want := &types.Webhook{ @@ -131,7 +131,7 @@ func TestGithub_ProcessWebhook_Push_NoSender(t *testing.T) { wantHook.SetCreated(time.Now().UTC().Unix()) wantHook.SetHost("github.com") wantHook.SetEvent("push") - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -141,7 +141,7 @@ func TestGithub_ProcessWebhook_Push_NoSender(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://github.com/Codertocat/Hello-World") wantRepo.SetClone("https://github.com/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics([]string{"go", "vela"}) @@ -155,8 +155,8 @@ func TestGithub_ProcessWebhook_Push_NoSender(t *testing.T) { wantBuild.SetSender("Codertocat") wantBuild.SetAuthor("Codertocat") wantBuild.SetEmail("21031067+Codertocat@users.noreply.github.com") - wantBuild.SetBranch("master") - wantBuild.SetRef("refs/heads/master") + wantBuild.SetBranch("main") + wantBuild.SetRef("refs/heads/main") wantBuild.SetBaseRef("") want := &types.Webhook{ @@ -210,7 +210,7 @@ func TestGithub_ProcessWebhook_PullRequest(t *testing.T) { wantHook.SetCreated(time.Now().UTC().Unix()) wantHook.SetHost("github.com") wantHook.SetEvent("pull_request") - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -220,7 +220,7 @@ func TestGithub_ProcessWebhook_PullRequest(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://github.com/Codertocat/Hello-World") wantRepo.SetClone("https://github.com/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil) @@ -235,9 +235,9 @@ func TestGithub_ProcessWebhook_PullRequest(t *testing.T) { wantBuild.SetSender("Codertocat") wantBuild.SetAuthor("Codertocat") wantBuild.SetEmail("") - wantBuild.SetBranch("master") + wantBuild.SetBranch("main") wantBuild.SetRef("refs/pull/1/head") - wantBuild.SetBaseRef("master") + wantBuild.SetBaseRef("main") wantBuild.SetHeadRef("changes") want := &types.Webhook{ @@ -292,7 +292,7 @@ func TestGithub_ProcessWebhook_PullRequest_ClosedAction(t *testing.T) { wantHook.SetCreated(time.Now().UTC().Unix()) wantHook.SetHost("github.com") wantHook.SetEvent("pull_request") - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -347,7 +347,7 @@ func TestGithub_ProcessWebhook_PullRequest_ClosedState(t *testing.T) { wantHook.SetCreated(time.Now().UTC().Unix()) wantHook.SetHost("github.com") wantHook.SetEvent("pull_request") - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -379,7 +379,7 @@ func TestGithub_ProcessWebhook_Deployment(t *testing.T) { wantHook.SetSourceID("7bd477e4-4415-11e9-9359-0d41fdf9567e") wantHook.SetWebhookID(123456) wantHook.SetCreated(time.Now().UTC().Unix()) - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") wantHook.SetHost("github.com") wantHook.SetEvent("deployment") @@ -391,7 +391,7 @@ func TestGithub_ProcessWebhook_Deployment(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://github.com/Codertocat/Hello-World") wantRepo.SetClone("https://github.com/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil) @@ -406,8 +406,8 @@ func TestGithub_ProcessWebhook_Deployment(t *testing.T) { wantBuild.SetSender("Codertocat") wantBuild.SetAuthor("Codertocat") wantBuild.SetEmail("") - wantBuild.SetBranch("master") - wantBuild.SetRef("refs/heads/master") + wantBuild.SetBranch("main") + wantBuild.SetRef("refs/heads/main") type args struct { file string @@ -499,7 +499,7 @@ func TestGithub_ProcessWebhook_Deployment_Commit(t *testing.T) { wantHook.SetSourceID("7bd477e4-4415-11e9-9359-0d41fdf9567e") wantHook.SetWebhookID(123456) wantHook.SetCreated(time.Now().UTC().Unix()) - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") wantHook.SetHost("github.com") wantHook.SetEvent("deployment") @@ -511,7 +511,7 @@ func TestGithub_ProcessWebhook_Deployment_Commit(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://github.com/Codertocat/Hello-World") wantRepo.SetClone("https://github.com/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil) @@ -526,8 +526,8 @@ func TestGithub_ProcessWebhook_Deployment_Commit(t *testing.T) { wantBuild.SetSender("Codertocat") wantBuild.SetAuthor("Codertocat") wantBuild.SetEmail("") - wantBuild.SetBranch("master") - wantBuild.SetRef("refs/heads/master") + wantBuild.SetBranch("main") + wantBuild.SetRef("refs/heads/main") want := &types.Webhook{ Comment: "", @@ -696,7 +696,7 @@ func TestGithub_VerifyWebhook_NoSecret(t *testing.T) { r.SetFullName("Codertocat/Hello-World") r.SetLink("https://github.com/Codertocat/Hello-World") r.SetClone("https://github.com/Codertocat/Hello-World.git") - r.SetBranch("master") + r.SetBranch("main") r.SetPrivate(false) // setup request @@ -768,7 +768,7 @@ func TestGithub_ProcessWebhook_IssueComment_PR(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://github.com/Codertocat/Hello-World") wantRepo.SetClone("https://github.com/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil) @@ -845,7 +845,7 @@ func TestGithub_ProcessWebhook_IssueComment_Created(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://github.com/Codertocat/Hello-World") wantRepo.SetClone("https://github.com/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil) @@ -859,7 +859,7 @@ func TestGithub_ProcessWebhook_IssueComment_Created(t *testing.T) { wantBuild.SetSender("Codertocat") wantBuild.SetAuthor("Codertocat") wantBuild.SetEmail("") - wantBuild.SetRef("refs/heads/master") + wantBuild.SetRef("refs/heads/main") want := &types.Webhook{ Comment: "ok to test", @@ -967,7 +967,7 @@ func TestGitHub_ProcessWebhook_RepositoryRename(t *testing.T) { wantHook.SetHost("github.com") wantHook.SetEvent(constants.EventRepository) wantHook.SetEventAction(constants.ActionRenamed) - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -978,7 +978,7 @@ func TestGitHub_ProcessWebhook_RepositoryRename(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://octocoders.github.io/Codertocat/Hello-World") wantRepo.SetClone("https://octocoders.github.io/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil) @@ -1031,7 +1031,7 @@ func TestGitHub_ProcessWebhook_RepositoryTransfer(t *testing.T) { wantHook.SetHost("github.com") wantHook.SetEvent(constants.EventRepository) wantHook.SetEventAction(constants.ActionTransferred) - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -1042,7 +1042,7 @@ func TestGitHub_ProcessWebhook_RepositoryTransfer(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://octocoders.github.io/Codertocat/Hello-World") wantRepo.SetClone("https://octocoders.github.io/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil) @@ -1095,7 +1095,7 @@ func TestGitHub_ProcessWebhook_RepositoryArchived(t *testing.T) { wantHook.SetHost("github.com") wantHook.SetEvent(constants.EventRepository) wantHook.SetEventAction("archived") - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -1106,7 +1106,7 @@ func TestGitHub_ProcessWebhook_RepositoryArchived(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://octocoders.github.io/Codertocat/Hello-World") wantRepo.SetClone("https://octocoders.github.io/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil) @@ -1223,7 +1223,7 @@ func TestGitHub_ProcessWebhook_Repository(t *testing.T) { wantHook.SetHost("github.com") wantHook.SetEvent(constants.EventRepository) wantHook.SetEventAction("publicized") - wantHook.SetBranch("master") + wantHook.SetBranch("main") wantHook.SetStatus(constants.StatusSuccess) wantHook.SetLink("https://github.com/Codertocat/Hello-World/settings/hooks") @@ -1234,7 +1234,7 @@ func TestGitHub_ProcessWebhook_Repository(t *testing.T) { wantRepo.SetFullName("Codertocat/Hello-World") wantRepo.SetLink("https://octocoders.github.io/Codertocat/Hello-World") wantRepo.SetClone("https://octocoders.github.io/Codertocat/Hello-World.git") - wantRepo.SetBranch("master") + wantRepo.SetBranch("main") wantRepo.SetPrivate(false) wantRepo.SetTopics(nil)