Skip to content

Commit 8a3929c

Browse files
author
Nick Griffiths
committed
Use "ExcludeArchivedRepositories"
More descriptive that "ExcludeArchived".
1 parent bcff70f commit 8a3929c

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

src/main/java/org/jenkinsci/plugins/github_branch_source/ExcludeArchivedTrait.java renamed to src/main/java/org/jenkinsci/plugins/github_branch_source/ExcludeArchivedRepositoriesTrait.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
/**
1414
* A {@link Selection} trait that will restrict the discovery of repositories that have been archived.
1515
*/
16-
public class ExcludeArchivedTrait extends SCMNavigatorTrait {
16+
public class ExcludeArchivedRepositoriesTrait extends SCMNavigatorTrait {
1717

1818
/**
1919
* Constructor for stapler.
2020
*/
2121
@DataBoundConstructor
22-
public ExcludeArchivedTrait() {
22+
public ExcludeArchivedRepositoriesTrait() {
2323
}
2424

2525
/**
@@ -29,13 +29,13 @@ public ExcludeArchivedTrait() {
2929
protected void decorateContext(SCMNavigatorContext<?, ?> context) {
3030
super.decorateContext(context);
3131
GitHubSCMNavigatorContext ctx = (GitHubSCMNavigatorContext) context;
32-
ctx.setExcludeArchived(true);
32+
ctx.setExcludeArchivedRepositories(true);
3333
}
3434

3535
/**
36-
* Excluded archived repositories filter
36+
* Exclude archived repositories filter
3737
*/
38-
@Symbol("archivedRepositoriesFilter")
38+
@Symbol("gitHubExcludeArchivedRepositories")
3939
@Extension
4040
@Selection
4141
public static class DescriptorImpl extends SCMNavigatorTraitDescriptor {
@@ -48,7 +48,7 @@ public Class<? extends SCMNavigatorContext> getContextClass() {
4848
@Nonnull
4949
@Override
5050
public String getDisplayName() {
51-
return Messages.ExcludeArchivedTrait_displayName();
51+
return Messages.ExcludeArchivedRepositoriesTrait_displayName();
5252
}
5353
}
5454
}

src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ public void visitSources(SCMSourceObserver observer) throws IOException, Interru
952952
continue; // ignore repos in other orgs when using GHMyself
953953
}
954954

955-
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchived()) {
955+
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchivedRepositories()) {
956956
witness.record(repo.getName(), false);
957957
listener.getLogger()
958958
.println(GitHubConsoleNote.create(System.currentTimeMillis(), String.format(
@@ -987,7 +987,7 @@ public void visitSources(SCMSourceObserver observer) throws IOException, Interru
987987
for (GHRepository repo : repositories) {
988988
Connector.checkApiRateLimit(listener, github);
989989

990-
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchived()) {
990+
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchivedRepositories()) {
991991
witness.record(repo.getName(), false);
992992
listener.getLogger()
993993
.println(GitHubConsoleNote.create(System.currentTimeMillis(), String.format(
@@ -1018,7 +1018,7 @@ public void visitSources(SCMSourceObserver observer) throws IOException, Interru
10181018
for (GHRepository repo : user.listRepositories(100)) {
10191019
Connector.checkApiRateLimit(listener, github);
10201020

1021-
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchived()) {
1021+
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchivedRepositories()) {
10221022
witness.record(repo.getName(), false);
10231023
listener.getLogger()
10241024
.println(GitHubConsoleNote.create(System.currentTimeMillis(), String.format(
@@ -1116,7 +1116,7 @@ public void visitSource(String sourceName, SCMSourceObserver observer)
11161116
GHRepository repo = myself.getRepository(sourceName);
11171117
if (repo != null && repo.getOwnerName().equals(repoOwner)) {
11181118

1119-
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchived()) {
1119+
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchivedRepositories()) {
11201120
witness.record(repo.getName(), false);
11211121
listener.getLogger()
11221122
.println(GitHubConsoleNote.create(System.currentTimeMillis(), String.format(
@@ -1146,7 +1146,7 @@ public void visitSource(String sourceName, SCMSourceObserver observer)
11461146
GHRepository repo = org.getRepository(sourceName);
11471147
if (repo != null) {
11481148

1149-
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchived()) {
1149+
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchivedRepositories()) {
11501150
witness.record(repo.getName(), false);
11511151
listener.getLogger()
11521152
.println(GitHubConsoleNote.create(System.currentTimeMillis(), String.format(
@@ -1178,7 +1178,7 @@ public void visitSource(String sourceName, SCMSourceObserver observer)
11781178
GHRepository repo = user.getRepository(sourceName);
11791179
if (repo != null) {
11801180

1181-
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchived()) {
1181+
if (repo.isArchived() && gitHubSCMNavigatorContext.isExcludeArchivedRepositories()) {
11821182
witness.record(repo.getName(), false);
11831183
listener.getLogger()
11841184
.println(GitHubConsoleNote.create(System.currentTimeMillis(), String.format(

src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigatorContext.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class GitHubSCMNavigatorContext extends SCMNavigatorContext<GitHubSCMNavi
4343
/**
4444
* If true, archived repositories will be ignored.
4545
*/
46-
private boolean excludeArchived;
46+
private boolean excludeArchivedRepositories;
4747

4848
/**
4949
* {@inheritDoc}
@@ -72,14 +72,14 @@ public String getTeamSlug() {
7272
/**
7373
* @return True if archived repositories should be ignored, false if they should be included.
7474
*/
75-
public boolean isExcludeArchived() {
76-
return excludeArchived;
75+
public boolean isExcludeArchivedRepositories() {
76+
return excludeArchivedRepositories;
7777
}
7878

7979
/**
80-
* @param excludeArchived Set true to exclude archived repositories
80+
* @param excludeArchivedRepositories Set true to exclude archived repositories
8181
*/
82-
public void setExcludeArchived(boolean excludeArchived) {
83-
this.excludeArchived = excludeArchived;
82+
public void setExcludeArchivedRepositories(boolean excludeArchivedRepositories) {
83+
this.excludeArchivedRepositories = excludeArchivedRepositories;
8484
}
8585
}

src/main/resources/org/jenkinsci/plugins/github_branch_source/Messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ SSHCheckoutTrait.missingCredentials=The currently configured credentials cannot
6262
SSHCheckoutTrait.useAgentKey=- use build agent''s key -
6363
TagDiscoveryTrait.authorityDisplayName=Trust origin tags
6464
TagDiscoveryTrait.displayName=Discover tags
65-
ExcludeArchivedTrait.displayName=Exclude archived repositories
65+
ExcludeArchivedRepositoriesTrait.displayName=Exclude archived repositories
6666

6767
GitHubSCMNavigator.general=General
6868
GitHubSCMNavigator.withinRepository=Within repository

src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigatorTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public void fetchOneRepo_BelongingToAuthenticatedUser() throws Exception {
211211
public void fetchOneRepo_BelongingToAuthenticatedUser_ExcludingArchived() throws Exception {
212212
setCredentials(Collections.singletonList(credentials));
213213
navigator = navigatorForRepoOwner("stephenc", credentials.getId());
214-
navigator.setTraits(Collections.singletonList(new ExcludeArchivedTrait()));
214+
navigator.setTraits(Collections.singletonList(new ExcludeArchivedRepositoriesTrait()));
215215
final Set<String> projectNames = new HashSet<>();
216216
final SCMSourceObserver observer = getObserver(projectNames);
217217

@@ -232,7 +232,7 @@ public void fetchOneRepo_BelongingToOrg() throws Exception {
232232

233233
@Test
234234
public void fetchOneRepo_BelongingToOrg_ExcludingArchived() throws Exception {
235-
navigator.setTraits(Collections.singletonList(new ExcludeArchivedTrait()));
235+
navigator.setTraits(Collections.singletonList(new ExcludeArchivedRepositoriesTrait()));
236236
final Set<String> projectNames = new HashSet<>();
237237
final SCMSourceObserver observer = getObserver(projectNames);
238238

@@ -255,7 +255,7 @@ public void fetchOneRepo_BelongingToUser() throws Exception {
255255
@Test
256256
public void fetchOneRepo_BelongingToUser_ExcludingArchived() throws Exception {
257257
navigator = navigatorForRepoOwner("stephenc", null);
258-
navigator.setTraits(Collections.singletonList(new ExcludeArchivedTrait()));
258+
navigator.setTraits(Collections.singletonList(new ExcludeArchivedRepositoriesTrait()));
259259
final Set<String> projectNames = new HashSet<>();
260260
final SCMSourceObserver observer = getObserver(projectNames);
261261

@@ -280,7 +280,7 @@ public void fetchRepos_BelongingToAuthenticatedUser() throws Exception {
280280
public void fetchRepos_BelongingToAuthenticatedUser_ExcludingArchived() throws Exception {
281281
setCredentials(Collections.singletonList(credentials));
282282
navigator = navigatorForRepoOwner("stephenc", credentials.getId());
283-
navigator.setTraits(Collections.singletonList(new ExcludeArchivedTrait()));
283+
navigator.setTraits(Collections.singletonList(new ExcludeArchivedRepositoriesTrait()));
284284
final Set<String> projectNames = new HashSet<>();
285285
final SCMSourceObserver observer = getObserver(projectNames);
286286

@@ -302,7 +302,7 @@ public void fetchRepos_BelongingToOrg() throws Exception {
302302

303303
@Test
304304
public void fetchRepos_BelongingToOrg_ExcludingArchived() throws Exception {
305-
navigator.setTraits(Collections.singletonList(new ExcludeArchivedTrait()));
305+
navigator.setTraits(Collections.singletonList(new ExcludeArchivedRepositoriesTrait()));
306306
final Set<String> projectNames = new HashSet<>();
307307
final SCMSourceObserver observer = getObserver(projectNames);
308308

@@ -326,7 +326,7 @@ public void fetchRepos_BelongingToUser() throws Exception {
326326
@Test
327327
public void fetchRepos_BelongingToUser_ExcludingArchived() throws Exception {
328328
navigator = navigatorForRepoOwner("stephenc", null);
329-
navigator.setTraits(Collections.singletonList(new ExcludeArchivedTrait()));
329+
navigator.setTraits(Collections.singletonList(new ExcludeArchivedRepositoriesTrait()));
330330
final Set<String> projectNames = new HashSet<>();
331331
final SCMSourceObserver observer = getObserver(projectNames);
332332

0 commit comments

Comments
 (0)