Skip to content

Commit 4d77f25

Browse files
authored
Merge pull request #603 from RahulSurwade08/main
Branch changes from Master to Main
2 parents ce0f412 + 6425065 commit 4d77f25

File tree

10 files changed

+39
-39
lines changed

10 files changed

+39
-39
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ on:
77
- 'README.md'
88
- 'SECURITY.md'
99
branches:
10-
- master
10+
- main
1111
pull_request:
1212
branches:
13-
- master
13+
- main
1414
jobs:
1515
build-test:
1616
runs-on: ubuntu-latest
1717
if: startsWith(github.ref, 'dockerfile-image-update-') == false
1818
steps:
1919
- name: checkout
20-
uses: actions/checkout@master
20+
uses: actions/checkout@main
2121
with:
2222
ref: ${{ github.ref }}
2323
- name: docker build
@@ -52,7 +52,7 @@ jobs:
5252
needs: [build-test, get-next-version]
5353
steps:
5454
- name: checkout
55-
uses: actions/checkout@master
55+
uses: actions/checkout@main
5656
with:
5757
ref: ${{ github.ref }}
5858
- name: Download itest dir
@@ -84,7 +84,7 @@ jobs:
8484
needs: build-test
8585
steps:
8686
- name: checkout
87-
uses: actions/checkout@master
87+
uses: actions/checkout@main
8888
with:
8989
ref: ${{ github.ref }}
9090
- name: Download main project dir

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: "Code scanning - action"
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88
branches:
9-
- master
9+
- main
1010
schedule:
1111
# ┌───────────── minute (0 - 59)
1212
# │ ┌───────────── hour (0 - 23)

.github/workflows/label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# To use this workflow, you will need to set up a .github/labeler.yml
55
# file with configuration. For more information, see:
6-
# https://github.com/actions/labeler/blob/master/README.md
6+
# https://github.com/actions/labeler/blob/main/README.md
77
#
88
# Runs on `pull_request_target` to get a write token. This is safe since we're not checking
99
# out any arbitrary git repos.
@@ -14,7 +14,7 @@ name: "Pull Request Labeler"
1414
on:
1515
pull_request_target:
1616
branches:
17-
- master
17+
- main
1818

1919
jobs:
2020
triage:

.github/workflows/release-drafter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- master
7+
- main
88

99
jobs:
1010
update_release_draft:
1111
runs-on: ubuntu-latest
1212
steps:
13-
# Drafts your next Release notes as Pull Requests are merged into "master"
13+
# Drafts your next Release notes as Pull Requests are merged into "main"
1414
- uses: release-drafter/release-drafter@v5
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
if: startsWith(github.ref, 'dockerfile-image-update-') == false
88
steps:
99
- name: checkout
10-
uses: actions/checkout@master
10+
uses: actions/checkout@main
1111
with:
1212
ref: ${{ github.ref }}
1313
- name: docker build
@@ -42,7 +42,7 @@ jobs:
4242
needs: [build-test, get-next-version]
4343
steps:
4444
- name: checkout
45-
uses: actions/checkout@master
45+
uses: actions/checkout@main
4646
with:
4747
ref: ${{ github.ref }}
4848
- name: Download itest dir
@@ -56,10 +56,10 @@ jobs:
5656
deploy:
5757
needs: [ integration-test, get-next-version ]
5858
runs-on: ubuntu-latest
59-
if: github.ref == 'refs/heads/master'
59+
if: github.ref == 'refs/heads/main'
6060
steps:
6161
- name: checkout
62-
uses: actions/checkout@master
62+
uses: actions/checkout@main
6363
with:
6464
ref: ${{ github.ref }}
6565
- name: Download main project dir

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ This Code of Conduct is licensed under the [Creative Commons Attribution 3.0 Lic
100100

101101
[contributor-covenant-home]: https://www.contributor-covenant.org (https://www.contributor-covenant.org/)
102102
[golang-coc]: https://golang.org/conduct
103-
[cncf-coc]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md
103+
[cncf-coc]: https://github.com/cncf/foundation/blob/main/code-of-conduct.md
104104
[microsoft-coc]: https://opensource.microsoft.com/codeofconduct/
105105
[cc-by-3-us]: https://creativecommons.org/licenses/by/3.0/us/

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
![Multi-Module Maven Build / Deploy](https://github.com/salesforce/dockerfile-image-update/workflows/Multi-Module%20Maven%20Build%20/%20Deploy/badge.svg)
2-
[![codecov](https://codecov.io/gh/salesforce/dockerfile-image-update/branch/master/graph/badge.svg)](https://codecov.io/gh/salesforce/dockerfile-image-update)
2+
[![codecov](https://codecov.io/gh/salesforce/dockerfile-image-update/branch/main/graph/badge.svg)](https://codecov.io/gh/salesforce/dockerfile-image-update)
33
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.salesforce.dockerfile-image-update/dockerfile-image-update/badge.svg?maxAge=3600)](https://maven-badges.herokuapp.com/maven-central/com.salesforce.dockerfile-image-update/dockerfile-image-update)
44
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/salesforce/dockerfile-image-update?label=Docker%20version&sort=semver)](https://hub.docker.com/r/salesforce/dockerfile-image-update/tags)
55

@@ -129,7 +129,7 @@ named arguments:
129129
limit the search results for github api (default: 1000)
130130
-o ORG, --org ORG search within specific organization (default: all of github)
131131
-b BRANCH, --branch BRANCH
132-
make pull requests for given branch name (default: master)
132+
make pull requests for given branch name (default: main)
133133
-g GHAPI, --ghapi GHAPI
134134
link to github api; overrides environment variable
135135
-f, --auto-merge NOT IMPLEMENTED / set to automatically merge pull requests if available
@@ -232,7 +232,7 @@ java -jar dockerfile-image-update-1.0-SNAPSHOT.jar <COMMAND> <PARAMETERS>
232232

233233
### Creating a new feature
234234

235-
Under [dockerfile-image-update/src/main/java/com/salesforce/dva/dockerfileimageupdate/subcommands/impl](https://github.com/salesforce/dockerfile-image-update/tree/master/dockerfile-image-update/src/main/java/com/salesforce/dockerfileimageupdate/subcommands/impl),
235+
Under [dockerfile-image-update/src/main/java/com/salesforce/dva/dockerfileimageupdate/subcommands/impl](https://github.com/salesforce/dockerfile-image-update/tree/main/dockerfile-image-update/src/main/java/com/salesforce/dockerfileimageupdate/subcommands/impl),
236236
create a new class `YOUR_FEATURE.java`.
237237
Make sure it implements `ExecutableWithNamespace` and has the `SubCommand`
238238
annotation with a `help`, `requiredParams`, and `optionalParams`.
@@ -247,7 +247,7 @@ Run unit tests by running `mvn test`.
247247
Before you run the integration tests (locally):
248248

249249
1. Make sure that you have access to the github orgs specified in
250-
[TestCommon.ORGS](https://github.com/salesforce/dockerfile-image-update/blob/master/dockerfile-image-update-itest/src/main/java/com/salesforce/dockerfileimageupdate/itest/tests/TestCommon.java#L33).
250+
[TestCommon.ORGS](https://github.com/salesforce/dockerfile-image-update/blob/main/dockerfile-image-update-itest/src/main/java/com/salesforce/dockerfileimageupdate/itest/tests/TestCommon.java#L33).
251251
You likely will need to change it to three orgs where you have permissions
252252
to create repositories.
253253
1. Make sure you have `git_api_url=https://api.github.com` in `/dockerfile-image-update-itest/itest.env`,
@@ -282,7 +282,7 @@ to manually trigger the release process. For now, that looks like the following:
282282
#### 1. Versioned Git Tag
283283

284284
* Decide what version you desire to have. If you want to bump the major or minor
285-
version then you need to bump the `MVN_SNAPSHOT_VERSION` in the [Makefile](https://github.com/salesforce/dockerfile-image-update/blob/master/Makefile#L5)
285+
version then you need to bump the `MVN_SNAPSHOT_VERSION` in the [Makefile](https://github.com/salesforce/dockerfile-image-update/blob/main/Makefile#L5)
286286
and in the
287287
[Dockerfile](https://github.com/salesforce/dockerfile-image-update/blob/afalko-maj-minor/Dockerfile#L4)
288288
before proceeding to the next steps. For example

dockerfile-image-update/src/main/java/com/salesforce/dockerfileimageupdate/CommandLine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static ArgumentParser getArgumentParser() {
6464
.help("search within specific organization (default: all of github)");
6565
/* Currently, because of argument passing reasons, you can only specify one branch. */
6666
parser.addArgument("-b", "--" + Constants.GIT_BRANCH)
67-
.help("make pull requests for given branch name (default: master)");
67+
.help("make pull requests for given branch name (default: main)");
6868
parser.addArgument("-g", "--" + Constants.GIT_API)
6969
.help("link to github api; overrides environment variable");
7070
parser.addArgument("-f", "--auto-merge").action(Arguments.storeTrue())

dockerfile-image-update/src/test/java/com/salesforce/dockerfileimageupdate/utils/DockerfileGitHubUtilTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,17 +430,17 @@ public void testTryRetrievingBlobException() throws IOException {
430430
@DataProvider
431431
public Object[][] inputBranchesImagesAndTags() {
432432
return new Object[][] {
433-
{"master", "image1", "image1", "6", "7", 1},
433+
{"main", "image1", "image1", "6", "7", 1},
434434
{"branch", "image1", "image2", "7", "7", 0},
435-
{"master", "image1", "image1", "6", "7", 1},
435+
{"main", "image1", "image1", "6", "7", 1},
436436
{"branch2", "image1", "image2", "6", "7", 0},
437-
{"master", "image1", "image1", "6", "7", 1},
437+
{"main", "image1", "image1", "6", "7", 1},
438438
{"branch", "image1", "image1", "7", "7", 0},
439-
{"master", "image1", "image2", "6", "7", 0},
439+
{"main", "image1", "image2", "6", "7", 0},
440440
{"branch3", "image1", "image1", "6", "7", 1},
441-
{"master", "image1", "image1", "6", "7", 1},
441+
{"main", "image1", "image1", "6", "7", 1},
442442
{"branch", "image1", "image1", "7", "7", 0},
443-
{"master", "image1", "image1", "6", "7", 1},
443+
{"main", "image1", "image1", "6", "7", 1},
444444
{"branch5", "image1", "image1", "6", "7", 1},
445445
};
446446
}

dockerfile-image-update/src/test/java/com/salesforce/dockerfileimageupdate/utils/GitHubUtilTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,53 +85,53 @@ public void testCreatePullReq_correctCallToPullRequest() throws Exception {
8585
GitHub github = mock(GitHub.class);
8686
GitHubUtil gitHubUtil = new GitHubUtil(github);
8787
GHRepository origRepo = mock(GHRepository.class);
88-
when(origRepo.getDefaultBranch()).thenReturn("master");
88+
when(origRepo.getDefaultBranch()).thenReturn("main");
8989
when(origRepo.createPullRequest(any(), any(), any(), any())).thenReturn(mock(GHPullRequest.class));
9090
GHRepository forkRepo = mock(GHRepository.class);
9191
when(forkRepo.getOwnerName()).thenReturn("owner");
9292
assertEquals(gitHubUtil.createPullReq(origRepo, "branch", forkRepo, "title", "body"), 0);
93-
verify(origRepo, times(1)).createPullRequest(eq("title"), eq("owner:branch"), eq("master"), eq("body"));
93+
verify(origRepo, times(1)).createPullRequest(eq("title"), eq("owner:branch"), eq("main"), eq("body"));
9494
}
9595

9696
@Test
9797
public void testCreatePullReq_errorCase0() throws Exception {
9898
GitHub github = mock(GitHub.class);
9999
GitHubUtil gitHubUtil = new GitHubUtil(github);
100100
GHRepository origRepo = mock(GHRepository.class);
101-
when(origRepo.getDefaultBranch()).thenReturn("master");
102-
when(origRepo.createPullRequest(eq("title"), eq("owner:branch"), eq("master"), eq("body")))
101+
when(origRepo.getDefaultBranch()).thenReturn("main");
102+
when(origRepo.createPullRequest(eq("title"), eq("owner:branch"), eq("main"), eq("body")))
103103
.thenThrow(new IOException("{\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"PullRequest\",\"code\":\"custom\",\"message\":\"A pull request already exists for someone:somebranch.\"}],\"documentation_url\":\"https://developer.github.com/enterprise/2.6/v3/pulls/#create-a-pull-request\"}"));
104104
GHRepository forkRepo = mock(GHRepository.class);
105105
when(forkRepo.getOwnerName()).thenReturn("owner");
106106
assertEquals(gitHubUtil.createPullReq(origRepo, "branch", forkRepo, "title", "body"), 0);
107-
verify(origRepo, times(1)).createPullRequest(eq("title"), eq("owner:branch"), eq("master"), eq("body"));
107+
verify(origRepo, times(1)).createPullRequest(eq("title"), eq("owner:branch"), eq("main"), eq("body"));
108108
}
109109

110110
@Test
111111
public void testCreatePullReq_errorCase1() throws Exception {
112112
GitHub github = mock(GitHub.class);
113113
GitHubUtil gitHubUtil = new GitHubUtil(github);
114114
GHRepository origRepo = mock(GHRepository.class);
115-
when(origRepo.getDefaultBranch()).thenReturn("master");
116-
when(origRepo.createPullRequest(eq("title"), eq("owner:branch"), eq("master"), eq("body")))
115+
when(origRepo.getDefaultBranch()).thenReturn("main");
116+
when(origRepo.createPullRequest(eq("title"), eq("owner:branch"), eq("main"), eq("body")))
117117
.thenThrow(new IOException("{\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"PullRequest\",\"code\":\"custom\",\"message\":\"No commits between thisrepo and thatrepo.\"}],\"documentation_url\":\"https://developer.github.com/enterprise/2.6/v3/pulls/#create-a-pull-request\"}"));
118118
GHRepository forkRepo = mock(GHRepository.class);
119119
when(forkRepo.getOwnerName()).thenReturn("owner");
120120
assertEquals(gitHubUtil.createPullReq(origRepo, "branch", forkRepo, "title", "body"), 1);
121-
verify(origRepo, times(1)).createPullRequest(eq("title"), eq("owner:branch"), eq("master"), eq("body"));
121+
verify(origRepo, times(1)).createPullRequest(eq("title"), eq("owner:branch"), eq("main"), eq("body"));
122122
}
123123
@Test
124124
public void testCreatePullReq_errorCase1_withInvalidCode() throws Exception {
125125
GitHub github = mock(GitHub.class);
126126
GitHubUtil gitHubUtil = new GitHubUtil(github);
127127
GHRepository origRepo = mock(GHRepository.class);
128-
when(origRepo.getDefaultBranch()).thenReturn("master");
129-
when(origRepo.createPullRequest(eq("title"), eq("owner:branch"), eq("master"), eq("body")))
128+
when(origRepo.getDefaultBranch()).thenReturn("main");
129+
when(origRepo.createPullRequest(eq("title"), eq("owner:branch"), eq("main"), eq("body")))
130130
.thenThrow(new IOException("{\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"PullRequest\",\"field\":\"head\",\"code\":\"invalid\"}],\"documentation_url\":\"https://developer.github.com/enterprise/2.6/v3/pulls/#create-a-pull-request\"}"));
131131
GHRepository forkRepo = mock(GHRepository.class);
132132
when(forkRepo.getOwnerName()).thenReturn("owner");
133133
assertEquals(gitHubUtil.createPullReq(origRepo, "branch", forkRepo, "title", "body"), 1);
134-
verify(origRepo).createPullRequest(eq("title"), eq("owner:branch"), eq("master"), eq("body"));
134+
verify(origRepo).createPullRequest(eq("title"), eq("owner:branch"), eq("main"), eq("body"));
135135
}
136136

137137
@Test

0 commit comments

Comments
 (0)