Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update main to be default #324

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions database/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ func TestDatabase_Build_ToLibrary(t *testing.T) {
want.SetAuthor("OctoKitty")
want.SetEmail("[email protected]")
want.SetLink("https://example.company.com/github/octocat/1")
want.SetBranch("master")
want.SetRef("refs/heads/master")
want.SetBranch("main")
want.SetRef("refs/heads/main")
want.SetBaseRef("")
want.SetHeadRef("")
want.SetHost("example.company.com")
Expand Down Expand Up @@ -220,8 +220,8 @@ func TestDatabase_BuildFromLibrary(t *testing.T) {
b.SetAuthor("OctoKitty")
b.SetEmail("[email protected]")
b.SetLink("https://example.company.com/github/octocat/1")
b.SetBranch("master")
b.SetRef("refs/heads/master")
b.SetBranch("main")
b.SetRef("refs/heads/main")
b.SetBaseRef("")
b.SetHeadRef("")
b.SetHost("example.company.com")
Expand Down Expand Up @@ -279,8 +279,8 @@ func testBuild() *Build {
Author: sql.NullString{String: "OctoKitty", Valid: true},
Email: sql.NullString{String: "[email protected]", Valid: true},
Link: sql.NullString{String: "https://example.company.com/github/octocat/1", Valid: true},
Branch: sql.NullString{String: "master", Valid: true},
Ref: sql.NullString{String: "refs/heads/master", Valid: true},
Branch: sql.NullString{String: "main", Valid: true},
Ref: sql.NullString{String: "refs/heads/main", Valid: true},
BaseRef: sql.NullString{String: "", Valid: false},
HeadRef: sql.NullString{String: "", Valid: false},
Host: sql.NullString{String: "example.company.com", Valid: true},
Expand Down
10 changes: 5 additions & 5 deletions database/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestDatabase_Hook_ToLibrary(t *testing.T) {
want.SetHost("github.com")
want.SetEvent("push")
want.SetEventAction("")
want.SetBranch("master")
want.SetBranch("main")
want.SetError("")
want.SetStatus("success")
want.SetLink("https://github.com/github/octocat/settings/hooks/1")
Expand All @@ -89,7 +89,7 @@ func TestDatabase_Hook_ToLibrary(t *testing.T) {
Host: sql.NullString{String: "github.com", Valid: true},
Event: sql.NullString{String: "push", Valid: true},
EventAction: sql.NullString{String: "", Valid: true},
Branch: sql.NullString{String: "master", Valid: true},
Branch: sql.NullString{String: "main", Valid: true},
Error: sql.NullString{String: "", Valid: true},
Status: sql.NullString{String: "success", Valid: true},
Link: sql.NullString{String: "https://github.com/github/octocat/settings/hooks/1", Valid: true},
Expand Down Expand Up @@ -182,7 +182,7 @@ func TestDatabase_HookFromLibrary(t *testing.T) {
Host: sql.NullString{String: "github.com", Valid: true},
Event: sql.NullString{String: "pull_request", Valid: true},
EventAction: sql.NullString{String: "opened", Valid: true},
Branch: sql.NullString{String: "master", Valid: true},
Branch: sql.NullString{String: "main", Valid: true},
Error: sql.NullString{String: "", Valid: false},
Status: sql.NullString{String: "success", Valid: true},
Link: sql.NullString{String: "https://github.com/github/octocat/settings/hooks/1", Valid: true},
Expand All @@ -199,7 +199,7 @@ func TestDatabase_HookFromLibrary(t *testing.T) {
h.SetHost("github.com")
h.SetEvent("pull_request")
h.SetEventAction("opened")
h.SetBranch("master")
h.SetBranch("main")
h.SetError("")
h.SetStatus("success")
h.SetLink("https://github.com/github/octocat/settings/hooks/1")
Expand All @@ -226,7 +226,7 @@ func testHook() *Hook {
Host: sql.NullString{String: "github.com", Valid: true},
Event: sql.NullString{String: "push", Valid: true},
EventAction: sql.NullString{String: "", Valid: false},
Branch: sql.NullString{String: "master", Valid: true},
Branch: sql.NullString{String: "main", Valid: true},
Error: sql.NullString{String: "", Valid: false},
Status: sql.NullString{String: "success", Valid: true},
Link: sql.NullString{String: "https://github.com/github/octocat/settings/hooks/1", Valid: true},
Expand Down
14 changes: 7 additions & 7 deletions database/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func TestDatabase_Pipeline_ToLibrary(t *testing.T) {
want.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163")
want.SetFlavor("large")
want.SetPlatform("docker")
want.SetRef("refs/heads/master")
want.SetRef("refs/heads/main")
want.SetType(constants.PipelineTypeYAML)
want.SetVersion("1")
want.SetExternalSecrets(false)
Expand Down Expand Up @@ -310,7 +310,7 @@ func TestDatabase_Pipeline_Validate(t *testing.T) {
pipeline: &Pipeline{
ID: sql.NullInt64{Int64: 1, Valid: true},
RepoID: sql.NullInt64{Int64: 1, Valid: true},
Ref: sql.NullString{String: "refs/heads/master", Valid: true},
Ref: sql.NullString{String: "refs/heads/main", Valid: true},
Type: sql.NullString{String: constants.PipelineTypeYAML, Valid: true},
Version: sql.NullString{String: "1", Valid: true},
},
Expand All @@ -330,7 +330,7 @@ func TestDatabase_Pipeline_Validate(t *testing.T) {
pipeline: &Pipeline{
ID: sql.NullInt64{Int64: 1, Valid: true},
Commit: sql.NullString{String: "48afb5bdc41ad69bf22588491333f7cf71135163", Valid: true},
Ref: sql.NullString{String: "refs/heads/master", Valid: true},
Ref: sql.NullString{String: "refs/heads/main", Valid: true},
Type: sql.NullString{String: constants.PipelineTypeYAML, Valid: true},
Version: sql.NullString{String: "1", Valid: true},
},
Expand All @@ -341,7 +341,7 @@ func TestDatabase_Pipeline_Validate(t *testing.T) {
ID: sql.NullInt64{Int64: 1, Valid: true},
RepoID: sql.NullInt64{Int64: 1, Valid: true},
Commit: sql.NullString{String: "48afb5bdc41ad69bf22588491333f7cf71135163", Valid: true},
Ref: sql.NullString{String: "refs/heads/master", Valid: true},
Ref: sql.NullString{String: "refs/heads/main", Valid: true},
Version: sql.NullString{String: "1", Valid: true},
},
},
Expand All @@ -351,7 +351,7 @@ func TestDatabase_Pipeline_Validate(t *testing.T) {
ID: sql.NullInt64{Int64: 1, Valid: true},
RepoID: sql.NullInt64{Int64: 1, Valid: true},
Commit: sql.NullString{String: "48afb5bdc41ad69bf22588491333f7cf71135163", Valid: true},
Ref: sql.NullString{String: "refs/heads/master", Valid: true},
Ref: sql.NullString{String: "refs/heads/main", Valid: true},

Type: sql.NullString{String: constants.PipelineTypeYAML, Valid: true},
},
Expand Down Expand Up @@ -385,7 +385,7 @@ func TestDatabase_PipelineFromLibrary(t *testing.T) {
p.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163")
p.SetFlavor("large")
p.SetPlatform("docker")
p.SetRef("refs/heads/master")
p.SetRef("refs/heads/main")
p.SetType(constants.PipelineTypeYAML)
p.SetVersion("1")
p.SetExternalSecrets(false)
Expand Down Expand Up @@ -415,7 +415,7 @@ func testPipeline() *Pipeline {
Commit: sql.NullString{String: "48afb5bdc41ad69bf22588491333f7cf71135163", Valid: true},
Flavor: sql.NullString{String: "large", Valid: true},
Platform: sql.NullString{String: "docker", Valid: true},
Ref: sql.NullString{String: "refs/heads/master", Valid: true},
Ref: sql.NullString{String: "refs/heads/main", Valid: true},
Type: sql.NullString{String: constants.PipelineTypeYAML, Valid: true},
Version: sql.NullString{String: "1", Valid: true},
ExternalSecrets: sql.NullBool{Bool: false, Valid: true},
Expand Down
6 changes: 3 additions & 3 deletions database/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func TestDatabase_Repo_ToLibrary(t *testing.T) {
want.SetFullName("github/octocat")
want.SetLink("https://github.com/github/octocat")
want.SetClone("https://github.com/github/octocat.git")
want.SetBranch("master")
want.SetBranch("main")
want.SetTopics([]string{"cloud", "security"})
want.SetBuildLimit(10)
want.SetTimeout(30)
Expand Down Expand Up @@ -314,7 +314,7 @@ func TestDatabase_RepoFromLibrary(t *testing.T) {
r.SetFullName("github/octocat")
r.SetLink("https://github.com/github/octocat")
r.SetClone("https://github.com/github/octocat.git")
r.SetBranch("master")
r.SetBranch("main")
r.SetTopics([]string{"cloud", "security"})
r.SetBuildLimit(10)
r.SetTimeout(30)
Expand Down Expand Up @@ -353,7 +353,7 @@ func testRepo() *Repo {
FullName: sql.NullString{String: "github/octocat", Valid: true},
Link: sql.NullString{String: "https://github.com/github/octocat", Valid: true},
Clone: sql.NullString{String: "https://github.com/github/octocat.git", Valid: true},
Branch: sql.NullString{String: "master", Valid: true},
Branch: sql.NullString{String: "main", Valid: true},
Topics: []string{"cloud", "security"},
BuildLimit: sql.NullInt64{Int64: 10, Valid: true},
Timeout: sql.NullInt64{Int64: 30, Valid: true},
Expand Down
36 changes: 18 additions & 18 deletions library/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"VELA_BUILD_AUTHOR": "OctoKitty",
"VELA_BUILD_AUTHOR_EMAIL": "[email protected]",
"VELA_BUILD_BASE_REF": "",
"VELA_BUILD_BRANCH": "master",
"VELA_BUILD_BRANCH": "main",
"VELA_BUILD_CHANNEL": "TODO",
"VELA_BUILD_CLONE": "https://github.com/github/octocat.git",
"VELA_BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand All @@ -103,7 +103,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"VELA_BUILD_MESSAGE": "First commit...",
"VELA_BUILD_NUMBER": "1",
"VELA_BUILD_PARENT": "1",
"VELA_BUILD_REF": "refs/heads/master",
"VELA_BUILD_REF": "refs/heads/main",
"VELA_BUILD_RUNTIME": "docker",
"VELA_BUILD_SENDER": "OctoKitty",
"VELA_BUILD_STARTED": "1563474078",
Expand All @@ -114,7 +114,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"BUILD_AUTHOR": "OctoKitty",
"BUILD_AUTHOR_EMAIL": "[email protected]",
"BUILD_BASE_REF": "",
"BUILD_BRANCH": "master",
"BUILD_BRANCH": "main",
"BUILD_CHANNEL": "TODO",
"BUILD_CLONE": "https://github.com/github/octocat.git",
"BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand All @@ -126,7 +126,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"BUILD_MESSAGE": "First commit...",
"BUILD_NUMBER": "1",
"BUILD_PARENT": "1",
"BUILD_REF": "refs/heads/master",
"BUILD_REF": "refs/heads/main",
"BUILD_SENDER": "OctoKitty",
"BUILD_STARTED": "1563474078",
"BUILD_SOURCE": "https://github.com/github/octocat/48afb5bdc41ad69bf22588491333f7cf71135163",
Expand All @@ -141,7 +141,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"VELA_BUILD_AUTHOR": "OctoKitty",
"VELA_BUILD_AUTHOR_EMAIL": "[email protected]",
"VELA_BUILD_BASE_REF": "",
"VELA_BUILD_BRANCH": "master",
"VELA_BUILD_BRANCH": "main",
"VELA_BUILD_CHANNEL": "TODO",
"VELA_BUILD_CLONE": "https://github.com/github/octocat.git",
"VELA_BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand All @@ -168,7 +168,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"BUILD_AUTHOR": "OctoKitty",
"BUILD_AUTHOR_EMAIL": "[email protected]",
"BUILD_BASE_REF": "",
"BUILD_BRANCH": "master",
"BUILD_BRANCH": "main",
"BUILD_CHANNEL": "TODO",
"BUILD_CLONE": "https://github.com/github/octocat.git",
"BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand Down Expand Up @@ -196,7 +196,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"VELA_BUILD_AUTHOR": "OctoKitty",
"VELA_BUILD_AUTHOR_EMAIL": "[email protected]",
"VELA_BUILD_BASE_REF": "",
"VELA_BUILD_BRANCH": "master",
"VELA_BUILD_BRANCH": "main",
"VELA_BUILD_CHANNEL": "TODO",
"VELA_BUILD_CLONE": "https://github.com/github/octocat.git",
"VELA_BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand All @@ -210,7 +210,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"VELA_BUILD_MESSAGE": "First commit...",
"VELA_BUILD_NUMBER": "1",
"VELA_BUILD_PARENT": "1",
"VELA_BUILD_REF": "refs/heads/master",
"VELA_BUILD_REF": "refs/heads/main",
"VELA_BUILD_RUNTIME": "docker",
"VELA_BUILD_SENDER": "OctoKitty",
"VELA_BUILD_STARTED": "1563474078",
Expand All @@ -224,7 +224,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"BUILD_AUTHOR": "OctoKitty",
"BUILD_AUTHOR_EMAIL": "[email protected]",
"BUILD_BASE_REF": "",
"BUILD_BRANCH": "master",
"BUILD_BRANCH": "main",
"BUILD_CHANNEL": "TODO",
"BUILD_CLONE": "https://github.com/github/octocat.git",
"BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand All @@ -236,7 +236,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"BUILD_MESSAGE": "First commit...",
"BUILD_NUMBER": "1",
"BUILD_PARENT": "1",
"BUILD_REF": "refs/heads/master",
"BUILD_REF": "refs/heads/main",
"BUILD_SENDER": "OctoKitty",
"BUILD_STARTED": "1563474078",
"BUILD_SOURCE": "https://github.com/github/octocat/48afb5bdc41ad69bf22588491333f7cf71135163",
Expand All @@ -253,7 +253,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"VELA_BUILD_AUTHOR": "OctoKitty",
"VELA_BUILD_AUTHOR_EMAIL": "[email protected]",
"VELA_BUILD_BASE_REF": "",
"VELA_BUILD_BRANCH": "master",
"VELA_BUILD_BRANCH": "main",
"VELA_BUILD_CHANNEL": "TODO",
"VELA_BUILD_CLONE": "https://github.com/github/octocat.git",
"VELA_BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand Down Expand Up @@ -281,7 +281,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"BUILD_AUTHOR": "OctoKitty",
"BUILD_AUTHOR_EMAIL": "[email protected]",
"BUILD_BASE_REF": "",
"BUILD_BRANCH": "master",
"BUILD_BRANCH": "main",
"BUILD_CHANNEL": "TODO",
"BUILD_CLONE": "https://github.com/github/octocat.git",
"BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand Down Expand Up @@ -312,7 +312,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"VELA_BUILD_AUTHOR": "OctoKitty",
"VELA_BUILD_AUTHOR_EMAIL": "[email protected]",
"VELA_BUILD_BASE_REF": "",
"VELA_BUILD_BRANCH": "master",
"VELA_BUILD_BRANCH": "main",
"VELA_BUILD_CHANNEL": "TODO",
"VELA_BUILD_CLONE": "https://github.com/github/octocat.git",
"VELA_BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand Down Expand Up @@ -341,7 +341,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"BUILD_AUTHOR": "OctoKitty",
"BUILD_AUTHOR_EMAIL": "[email protected]",
"BUILD_BASE_REF": "",
"BUILD_BRANCH": "master",
"BUILD_BRANCH": "main",
"BUILD_CHANNEL": "TODO",
"BUILD_CLONE": "https://github.com/github/octocat.git",
"BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand Down Expand Up @@ -369,7 +369,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"VELA_BUILD_AUTHOR": "OctoKitty",
"VELA_BUILD_AUTHOR_EMAIL": "[email protected]",
"VELA_BUILD_BASE_REF": "",
"VELA_BUILD_BRANCH": "master",
"VELA_BUILD_BRANCH": "main",
"VELA_BUILD_CHANNEL": "TODO",
"VELA_BUILD_CLONE": "https://github.com/github/octocat.git",
"VELA_BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand All @@ -395,7 +395,7 @@ func TestLibrary_Build_Environment(t *testing.T) {
"BUILD_AUTHOR": "OctoKitty",
"BUILD_AUTHOR_EMAIL": "[email protected]",
"BUILD_BASE_REF": "",
"BUILD_BRANCH": "master",
"BUILD_BRANCH": "main",
"BUILD_CHANNEL": "TODO",
"BUILD_CLONE": "https://github.com/github/octocat.git",
"BUILD_COMMIT": "48afb5bdc41ad69bf22588491333f7cf71135163",
Expand Down Expand Up @@ -858,8 +858,8 @@ func testBuild() *Build {
b.SetAuthor("OctoKitty")
b.SetEmail("[email protected]")
b.SetLink("https://example.company.com/github/octocat/1")
b.SetBranch("master")
b.SetRef("refs/heads/master")
b.SetBranch("main")
b.SetRef("refs/heads/main")
b.SetBaseRef("")
b.SetHeadRef("changes")
b.SetHost("example.company.com")
Expand Down
2 changes: 1 addition & 1 deletion library/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func testDeployment() *Deployment {
d.SetURL("https://api.github.com/repos/github/octocat/deployments/1")
d.SetUser("octocat")
d.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163")
d.SetRef("refs/heads/master")
d.SetRef("refs/heads/main")
d.SetTask("vela-deploy")
d.SetTarget("production")
d.SetDescription("Deployment request from Vela")
Expand Down
2 changes: 1 addition & 1 deletion library/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func testHook() *Hook {
h.SetHost("github.com")
h.SetEvent("push")
h.SetEventAction("")
h.SetBranch("master")
h.SetBranch("main")
h.SetError("")
h.SetStatus("success")
h.SetLink("https://github.com/github/octocat/settings/hooks/1")
Expand Down
2 changes: 1 addition & 1 deletion library/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func testPipeline() *Pipeline {
p.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163")
p.SetFlavor("large")
p.SetPlatform("docker")
p.SetRef("refs/heads/master")
p.SetRef("refs/heads/main")
p.SetRef("yaml")
p.SetVersion("1")
p.SetExternalSecrets(false)
Expand Down
6 changes: 3 additions & 3 deletions library/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestLibrary_Repo_Environment(t *testing.T) {
"VELA_REPO_ALLOW_PULL": "false",
"VELA_REPO_ALLOW_PUSH": "true",
"VELA_REPO_ALLOW_TAG": "false",
"VELA_REPO_BRANCH": "master",
"VELA_REPO_BRANCH": "main",
"VELA_REPO_TOPICS": "cloud,security",
"VELA_REPO_BUILD_LIMIT": "10",
"VELA_REPO_CLONE": "https://github.com/github/octocat.git",
Expand All @@ -36,7 +36,7 @@ func TestLibrary_Repo_Environment(t *testing.T) {
"REPOSITORY_ALLOW_PULL": "false",
"REPOSITORY_ALLOW_PUSH": "true",
"REPOSITORY_ALLOW_TAG": "false",
"REPOSITORY_BRANCH": "master",
"REPOSITORY_BRANCH": "main",
"REPOSITORY_CLONE": "https://github.com/github/octocat.git",
"REPOSITORY_FULL_NAME": "github/octocat",
"REPOSITORY_LINK": "https://github.com/github/octocat",
Expand Down Expand Up @@ -381,7 +381,7 @@ func testRepo() *Repo {
r.SetFullName("github/octocat")
r.SetLink("https://github.com/github/octocat")
r.SetClone("https://github.com/github/octocat.git")
r.SetBranch("master")
r.SetBranch("main")
r.SetTopics([]string{"cloud", "security"})
r.SetBuildLimit(10)
r.SetTimeout(30)
Expand Down
4 changes: 2 additions & 2 deletions pipeline/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ func TestPipeline_Build_Purge(t *testing.T) {
// run tests
for _, test := range tests {
r := &RuleData{
Branch: "master",
Branch: "main",
Event: "pull_request",
Path: []string{},
Repo: "foo/bar",
Tag: "refs/heads/master",
Tag: "refs/heads/main",
}

got := test.pipeline.Purge(r)
Expand Down
Loading