-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathGitLabSCMNavigator.java
More file actions
626 lines (581 loc) · 25.8 KB
/
GitLabSCMNavigator.java
File metadata and controls
626 lines (581 loc) · 25.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
package io.jenkins.plugins.gitlabbranchsource;
import static com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials;
import static com.cloudbees.plugins.credentials.domains.URIRequirementBuilder.fromUri;
import static io.jenkins.plugins.gitlabbranchsource.helpers.GitLabHelper.apiBuilder;
import static io.jenkins.plugins.gitlabbranchsource.helpers.GitLabHelper.getPrivateTokenAsPlainText;
import static io.jenkins.plugins.gitlabbranchsource.helpers.GitLabHelper.getProxyConfig;
import static io.jenkins.plugins.gitlabbranchsource.helpers.GitLabHelper.getServerUrl;
import static io.jenkins.plugins.gitlabbranchsource.helpers.GitLabHelper.getServerUrlFromName;
import static io.jenkins.plugins.gitlabbranchsource.helpers.GitLabIcons.ICON_GITLAB;
import static io.jenkins.plugins.gitlabbranchsource.helpers.GitLabIcons.iconFilePathPattern;
import com.cloudbees.plugins.credentials.CredentialsMatchers;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.common.StandardCredentials;
import com.cloudbees.plugins.credentials.common.StandardListBoxModel;
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.Util;
import hudson.console.HyperlinkNote;
import hudson.model.Action;
import hudson.model.Item;
import hudson.model.Queue;
import hudson.model.TaskListener;
import hudson.security.ACL;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatar;
import io.jenkins.plugins.gitlabbranchsource.helpers.GitLabGroup;
import io.jenkins.plugins.gitlabbranchsource.helpers.GitLabLink;
import io.jenkins.plugins.gitlabbranchsource.helpers.GitLabOwner;
import io.jenkins.plugins.gitlabbranchsource.helpers.GitLabUser;
import io.jenkins.plugins.gitlabserverconfig.credentials.helpers.GitLabCredentialMatcher;
import io.jenkins.plugins.gitlabserverconfig.servers.GitLabServer;
import io.jenkins.plugins.gitlabserverconfig.servers.GitLabServers;
import jakarta.inject.Inject;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import jenkins.model.Jenkins;
import jenkins.plugins.git.traits.GitBrowserSCMSourceTrait;
import jenkins.scm.api.SCMHeadObserver;
import jenkins.scm.api.SCMNavigator;
import jenkins.scm.api.SCMNavigatorDescriptor;
import jenkins.scm.api.SCMNavigatorEvent;
import jenkins.scm.api.SCMNavigatorOwner;
import jenkins.scm.api.SCMSourceObserver;
import jenkins.scm.api.SCMSourceOwner;
import jenkins.scm.api.metadata.ObjectMetadataAction;
import jenkins.scm.api.trait.SCMNavigatorRequest.Witness;
import jenkins.scm.api.trait.SCMNavigatorTrait;
import jenkins.scm.api.trait.SCMNavigatorTraitDescriptor;
import jenkins.scm.api.trait.SCMSourceTrait;
import jenkins.scm.api.trait.SCMTrait;
import jenkins.scm.api.trait.SCMTraitDescriptor;
import jenkins.scm.impl.form.NamedArrayList;
import jenkins.scm.impl.trait.Discovery;
import jenkins.scm.impl.trait.Selection;
import org.apache.commons.lang.StringUtils;
import org.gitlab4j.api.GitLabApi;
import org.gitlab4j.api.GitLabApiException;
import org.gitlab4j.api.models.GroupProjectsFilter;
import org.gitlab4j.api.models.Project;
import org.gitlab4j.api.models.ProjectFilter;
import org.jenkins.ui.icon.IconSpec;
import org.jenkinsci.Symbol;
import org.jenkinsci.plugins.gitclient.GitClient;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
public class GitLabSCMNavigator extends SCMNavigator {
public static final Logger LOGGER = Logger.getLogger(GitLabSCMNavigator.class.getName());
/**
* The owner of the projects to navigate.
*/
private final String projectOwner;
/**
* The GitLab server name configured in Jenkins.
*/
private String serverName;
/**
* The full version of the GitLab server.
*/
private String serverVersion;
/**
* The default credentials to use for checking out).
*/
private String credentialsId;
/**
* The behavioral traits to apply.
*/
private List<SCMTrait<? extends SCMTrait<?>>> traits;
/**
* The path with namespace of Navigator projects.
*/
private HashSet<String> navigatorProjects = new HashSet<>();
/**
* To store if project owner is group
*/
private boolean isGroup;
/**
* To store if navigator should include subgroup projects
*/
private boolean wantSubGroupProjects;
private transient GitLabOwner gitlabOwner; // TODO check if a better data structure can be used
@DataBoundConstructor
public GitLabSCMNavigator(String projectOwner) {
this.projectOwner = projectOwner;
this.traits = new ArrayList<>();
}
public static String getProjectOwnerFromNamespace(String projectPathWithNamespace) {
int namespaceLength = projectPathWithNamespace.lastIndexOf("/");
return projectPathWithNamespace.substring(0, namespaceLength);
}
public HashSet<String> getNavigatorProjects() {
return navigatorProjects;
}
public boolean isGroup() {
return isGroup;
}
public boolean isWantSubGroupProjects() {
return wantSubGroupProjects;
}
public String getCredentialsId() {
return credentialsId;
}
@DataBoundSetter
public void setCredentialsId(String credentialsId) {
this.credentialsId = credentialsId;
}
public String getServerName() {
return serverName;
}
@DataBoundSetter
public void setServerName(String serverName) {
this.serverName = serverName;
}
public String getProjectOwner() {
return projectOwner;
}
/**
* Gets the behavioral traits that are applied to this navigator and any {@link
* GitLabSCMSource} instances it discovers.
*
* @return the behavioral traits.
*/
@NonNull
public List<SCMTrait<? extends SCMTrait<?>>> getTraits() {
return Collections.unmodifiableList(traits);
}
/**
* Sets the behavioral traits that are applied to this navigator and any {@link
* GitLabSCMSource} instances it discovers. The new traits will take affect on
* the next
* navigation through any of the {@link #visitSources(SCMSourceObserver)}
* overloads or {@link
* #visitSource(String, SCMSourceObserver)}.
*
* @param traits the new behavioral traits.
*/
@DataBoundSetter
public void setTraits(@CheckForNull SCMTrait[] traits) {
this.traits = new ArrayList<>();
if (traits != null) {
for (SCMTrait trait : traits) {
this.traits.add(trait);
}
}
}
private GitLabOwner getGitlabOwner(SCMNavigatorOwner owner) {
if (gitlabOwner == null) {
getGitlabOwner(apiBuilder(owner, serverName));
}
return gitlabOwner;
}
private GitLabOwner getGitlabOwner(GitLabApi gitLabApi) {
if (gitlabOwner == null) {
gitlabOwner = GitLabOwner.fetchOwner(gitLabApi, projectOwner);
try {
serverVersion = gitLabApi.getVersion().getVersion();
} catch (GitLabApiException e) {
serverVersion = "0.0";
}
}
return gitlabOwner;
}
/**
* Sets the behavioral traits that are applied to this navigator and any {@link
* GitLabSCMSource} instances it discovers. The new traits will take affect on
* the next
* navigation through any of the {@link #visitSources(SCMSourceObserver)}
* overloads or {@link
* #visitSource(String, SCMSourceObserver)}.
*
* @param traits the new behavioral traits.
*/
@Override
public void setTraits(@CheckForNull List<SCMTrait<? extends SCMTrait<?>>> traits) {
this.traits = traits != null ? new ArrayList<>(traits) : new ArrayList<>();
}
@NonNull
@Override
protected String id() {
return getServerUrlFromName(serverName) + "::" + projectOwner;
}
@Override
public void visitSources(@NonNull final SCMSourceObserver observer) throws IOException, InterruptedException {
GitLabSCMNavigatorContext context = new GitLabSCMNavigatorContext().withTraits(traits);
try (GitLabSCMNavigatorRequest request = context.newRequest(this, observer)) {
GitLabApi gitLabApi = apiBuilder(observer.getContext(), serverName);
getGitlabOwner(gitLabApi);
List<Project> projects;
if (gitlabOwner instanceof GitLabUser) {
// Even returns the group projects owned by the user
projects = gitLabApi.getProjectApi().getUserProjects(projectOwner, new ProjectFilter().withOwned(true));
} else {
isGroup = true;
GroupProjectsFilter groupProjectsFilter = new GroupProjectsFilter();
wantSubGroupProjects = request.wantSubgroupProjects();
groupProjectsFilter.withIncludeSubGroups(wantSubGroupProjects);
groupProjectsFilter.withShared(request.wantSharedProjects());
// If projectOwner is a subgroup, it will only return projects in the subgroup
projects = gitLabApi.getGroupApi().getProjects(projectOwner, groupProjectsFilter);
}
int count = 0;
observer.getListener().getLogger().format("%nChecking projects...%n");
StandardCredentials webHookCredentials = getWebHookCredentials(observer.getContext());
GitLabApi webhookGitLabApi = null;
String webHookUrl = null;
if (webHookCredentials != null) {
GitLabServer server = GitLabServers.get().findServer(serverName);
String serverUrl = getServerUrl(server);
webhookGitLabApi = new GitLabApi(
serverUrl, getPrivateTokenAsPlainText(webHookCredentials), null, getProxyConfig(serverUrl));
webHookUrl = GitLabHookCreator.getHookUrl(server, true);
}
projects = projects.stream().filter(Objects::nonNull).collect(Collectors.toList());
for (Project p : projects) {
count++;
String projectPathWithNamespace = p.getPathWithNamespace();
String projectOwner = getProjectOwnerFromNamespace(projectPathWithNamespace);
String projectName = getProjectName(gitLabApi, request.withProjectNamingStrategy(), p);
getNavigatorProjects().add(projectPathWithNamespace);
if (StringUtils.isEmpty(p.getDefaultBranch())) {
observer.getListener()
.getLogger()
.format(
"%nIgnoring project with empty repository %s%n",
HyperlinkNote.encodeTo(p.getWebUrl(), p.getName()));
continue;
}
if (p.getArchived() && context.isExcludeArchivedRepositories()) {
observer.getListener()
.getLogger()
.format(
"%nIgnoring archived project %s%n",
HyperlinkNote.encodeTo(p.getWebUrl(), p.getName()));
continue;
}
observer.getListener()
.getLogger()
.format("%nChecking project %s%n", HyperlinkNote.encodeTo(p.getWebUrl(), projectName));
try {
GitLabServer server = GitLabServers.get().findServer(serverName);
if (webhookGitLabApi != null && webHookUrl != null) {
String secretToken = server.getSecretTokenAsPlainText();
if (secretToken == null) {
// sending 'null' to GitLab will ignore the value, when we want to update it to be empty.
secretToken = "";
}
observer.getListener()
.getLogger()
.format(
"Web hook %s%n",
GitLabHookCreator.createWebHookWhenMissing(
webhookGitLabApi, projectPathWithNamespace, webHookUrl, secretToken));
}
} catch (GitLabApiException e) {
observer.getListener().getLogger().format("Cannot set web hook: %s%n", e.getReason());
}
if (request.process(
projectName,
name -> new GitLabSCMSourceBuilder(
getId() + "::" + projectPathWithNamespace,
serverName,
credentialsId,
projectOwner,
projectPathWithNamespace,
name)
.withTraits(traits)
.build(),
null,
(Witness) (name, isMatch) -> {
if (isMatch) {
observer.getListener().getLogger().format("Proposing %s%n", name);
} else {
observer.getListener().getLogger().format("Ignoring %s%n", name);
}
})) {
observer.getListener().getLogger().format("%n%d projects were processed (query complete)%n", count);
return;
}
}
observer.getListener().getLogger().format("%n%d projects were processed%n", count);
} catch (GitLabApiException | URISyntaxException e) {
LOGGER.log(Level.WARNING, "Exception caught:" + e, e);
throw new IOException("Failed to visit SCM source", e);
}
}
@NonNull
private String getProjectName(GitLabApi gitLabApi, int projectNamingStrategy, Project project)
throws URISyntaxException {
String fullPath = project.getPathWithNamespace();
String projectName;
switch (projectNamingStrategy) {
default:
// for legacy reasons default naming strategy is set to Full Project path
case 1:
projectName = fullPath;
break;
case 2:
// Project name
projectName = project.getNameWithNamespace()
.replace(
String.format("%s / ", getGitlabOwner(gitLabApi).getFullName()), "");
break;
case 3:
// Contextual project path
URI ownerPathUri = new URI(projectOwner);
URI fullPathUri = new URI(fullPath);
projectName = ownerPathUri.relativize(fullPathUri).toString();
break;
case 4:
// Simple project path
projectName = fullPath.substring(fullPath.lastIndexOf('/') + 1);
break;
}
return projectName;
}
private StandardCredentials getWebHookCredentials(SCMSourceOwner owner) {
StandardCredentials credentials = null;
GitLabServer server = GitLabServers.get().findServer(getServerName());
if (server == null) {
return null;
}
GitLabSCMNavigatorContext navigatorContext = new GitLabSCMNavigatorContext().withTraits(traits);
GitLabSCMSourceContext ctx =
new GitLabSCMSourceContext(null, SCMHeadObserver.none()).withTraits(navigatorContext.traits());
GitLabHookRegistration webhookMode = ctx.webhookRegistration();
switch (webhookMode) {
case DISABLE:
break;
case SYSTEM:
if (!server.isManageWebHooks()) {
break;
}
credentials = server.getCredentials(owner);
if (credentials == null) {
LOGGER.log(Level.WARNING, "No System credentials added, cannot create web hook");
}
break;
case ITEM:
credentials = credentials(owner);
if (credentials == null) {
LOGGER.log(Level.WARNING, "No Item credentials added, cannot create web hook");
}
break;
default:
return null;
}
return credentials;
}
@NonNull
@Override
protected List<Action> retrieveActions(
@NonNull SCMNavigatorOwner owner, SCMNavigatorEvent event, @NonNull TaskListener listener)
throws IOException, InterruptedException {
getGitlabOwner(owner);
String fullName = gitlabOwner.getFullName();
String webUrl = gitlabOwner.getWebUrl();
String avatarUrl = gitlabOwner.getAvatarUrl();
String description = null;
if (gitlabOwner instanceof GitLabGroup) {
description = ((GitLabGroup) gitlabOwner).getDescription();
}
List<Action> result = new ArrayList<>();
result.add(new ObjectMetadataAction(Util.fixEmpty(fullName), description, webUrl));
if (StringUtils.isNotBlank(avatarUrl)) {
if (GitLabServer.groupAvatarsApiAvailable(serverVersion)) {
result.add(new GitLabAvatar(avatarUrl, serverName, projectOwner, false));
} else {
result.add(new GitLabAvatar(avatarUrl));
}
}
result.add(GitLabLink.toGroup(webUrl));
if (StringUtils.isBlank(webUrl)) {
listener.getLogger().println("Web URL unspecified");
} else {
listener.getLogger()
.printf(
"%s URL: %s%n",
gitlabOwner.getWord(),
HyperlinkNote.encodeTo(webUrl, StringUtils.defaultIfBlank(fullName, webUrl)));
}
return result;
}
@Override
public void afterSave(@NonNull SCMNavigatorOwner owner) {
GitLabSCMNavigatorContext navigatorContext = new GitLabSCMNavigatorContext().withTraits(traits);
GitLabSCMSourceContext ctx =
new GitLabSCMSourceContext(null, SCMHeadObserver.none()).withTraits(navigatorContext.traits());
GitLabHookRegistration systemhookMode = ctx.systemhookRegistration();
GitLabHookCreator.register(owner, this, systemhookMode);
}
public StandardCredentials credentials(SCMSourceOwner owner) {
return CredentialsMatchers.firstOrNull(
lookupCredentials(
StandardCredentials.class,
owner,
Jenkins.getAuthentication(),
fromUri(getServerUrlFromName(serverName)).build()),
new GitLabCredentialMatcher());
}
@Symbol("gitlab")
@Extension
public static class DescriptorImpl extends SCMNavigatorDescriptor implements IconSpec {
@Inject
private GitLabSCMSource.DescriptorImpl delegate;
public static FormValidation doCheckProjectOwner(
@AncestorInPath SCMSourceOwner context,
@QueryParameter String projectOwner,
@QueryParameter String serverName) {
if (projectOwner.equals("")) {
return FormValidation.ok();
}
GitLabApi gitLabApi = null;
try {
gitLabApi = apiBuilder(context, serverName);
GitLabOwner gitLabOwner = GitLabOwner.fetchOwner(gitLabApi, projectOwner);
return FormValidation.ok(projectOwner + " is a valid " + gitLabOwner.getWord());
} catch (IllegalStateException e) {
return FormValidation.error(e, e.getMessage());
}
}
@NonNull
@Override
public String getDisplayName() {
return "GitLab Group";
}
@Override
public String getPronoun() {
return "GitLab Group";
}
@NonNull
@Override
public String getDescription() {
return "Scans a GitLab Group (or GitLab User) for all projects matching some defined markers.";
}
@Override
public String getIconClassName() {
return ICON_GITLAB;
}
@Override
public String getIconFilePathPattern() {
return iconFilePathPattern(getIconClassName());
}
@Override
public SCMNavigator newInstance(String name) {
GitLabSCMNavigator navigator = new GitLabSCMNavigator("");
navigator.setTraits(getTraitsDefaults());
return navigator;
}
public ListBoxModel doFillServerNameItems(
@AncestorInPath SCMSourceOwner context, @QueryParameter String serverName) {
if (context == null) {
if (!Jenkins.get().hasPermission(Jenkins.MANAGE)) {
// must have admin if you want the list without a context
ListBoxModel result = new ListBoxModel();
result.add(serverName);
return result;
}
} else {
if (!context.hasPermission(Item.EXTENDED_READ)) {
// must be able to read the configuration the list
ListBoxModel result = new ListBoxModel();
result.add(serverName);
return result;
}
}
return GitLabServers.get().getServerItems();
}
public ListBoxModel doFillCredentialsIdItems(
@AncestorInPath SCMSourceOwner context,
@QueryParameter String serverName,
@QueryParameter String credentialsId) {
StandardListBoxModel result = new StandardListBoxModel();
if (context == null) {
if (!Jenkins.get().hasPermission(Jenkins.MANAGE)) {
// must have admin if you want the list without a context
result.includeCurrentValue(credentialsId);
return result;
}
} else {
if (!context.hasPermission(Item.EXTENDED_READ)
&& !context.hasPermission(CredentialsProvider.USE_ITEM)) {
// must be able to read the configuration or use the item credentials if you
// want the list
result.includeCurrentValue(credentialsId);
return result;
}
}
result.includeEmptyValue();
result.includeMatchingAs(
context instanceof Queue.Task ? ((Queue.Task) context).getDefaultAuthentication() : ACL.SYSTEM,
context,
StandardUsernameCredentials.class,
fromUri(getServerUrlFromName(serverName)).build(),
GitClient.CREDENTIALS_MATCHER);
return result;
}
@SuppressWarnings("unused") // jelly
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() {
GitLabSCMSource.DescriptorImpl sourceDescriptor =
Jenkins.get().getDescriptorByType(GitLabSCMSource.DescriptorImpl.class);
List<SCMTraitDescriptor<?>> all = new ArrayList<>();
all.addAll(SCMNavigatorTrait._for(this, GitLabSCMNavigatorContext.class, GitLabSCMSourceBuilder.class));
all.addAll(SCMSourceTrait._for(sourceDescriptor, GitLabSCMSourceContext.class, null));
all.addAll(SCMSourceTrait._for(sourceDescriptor, null, GitLabSCMBuilder.class));
Set<SCMTraitDescriptor<?>> dedup = new HashSet<>();
for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) {
SCMTraitDescriptor<?> d = iterator.next();
if (dedup.contains(d) || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) {
// remove any we have seen already and ban the browser configuration as it will
// always be github
iterator.remove();
} else {
dedup.add(d);
}
}
List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>();
NamedArrayList.select(
all,
"Projects",
new NamedArrayList.Predicate<SCMTraitDescriptor<?>>() {
@Override
public boolean test(SCMTraitDescriptor<?> scmTraitDescriptor) {
return scmTraitDescriptor instanceof SCMNavigatorTraitDescriptor;
}
},
true,
result);
NamedArrayList.select(
all,
"Within project",
NamedArrayList.anyOf(
NamedArrayList.withAnnotation(Discovery.class),
NamedArrayList.withAnnotation(Selection.class)),
true,
result);
NamedArrayList.select(all, "Additional", null, true, result);
return result;
}
@Override
@NonNull
@SuppressWarnings("unused") // jelly
public List<SCMTrait<? extends SCMTrait<?>>> getTraitsDefaults() {
return new ArrayList<>(delegate.getTraitsDefaults());
}
}
}