|
1 | 1 | ///usr/bin/env jbang "$0" "$@" ; exit $?
|
2 | 2 |
|
3 | 3 | //DEPS info.picocli:picocli:4.6.3
|
4 |
| -//DEPS https://github.com/unblu/gitlab-workitem-graphql-client/commit/f36726404b311bab0d5df41eff8072950fb9f97c |
| 4 | +//DEPS https://github.com/unblu/gitlab-workitem-graphql-client/commit/f98e830badf88a74e459807f14c7db3b4a32c012 |
5 | 5 | //DEPS io.smallrye:smallrye-graphql-client-implementation-vertx:2.11.0
|
6 | 6 | //DEPS org.jboss.logmanager:jboss-logmanager:3.1.1.Final
|
7 | 7 | //JAVA 17
|
@@ -50,9 +50,15 @@ public class LabelGraphQLScript implements Callable<Integer> {
|
50 | 50 | @Option(names = { "-g", "--group" }, description = "group")
|
51 | 51 | private String group;
|
52 | 52 |
|
53 |
| - @Option(names = { "-a", "--includeAncestorGroups" }, description = "include ancestor groups when fetching labels") |
| 53 | + @Option(names = { "-a", "--includeAncestorGroups" }, description = "include ancestor groups when fetching labels in project") |
54 | 54 | private boolean includeAncestorGroups;
|
55 | 55 |
|
| 56 | + @Option(names = { "-d", "--includeDescendantGroups" }, description = "include descendant groups when fetching labels in group") |
| 57 | + private boolean includeDescendantGroups; |
| 58 | + |
| 59 | + @Option(names = { "-o", "--onlyGroupLabels" }, description = "set onlyGroupLabels when fetching labels in group") |
| 60 | + private boolean onlyGroupLabels; |
| 61 | + |
56 | 62 | @Option(names = { "-c", "--config" }, description = "configuration file location")
|
57 | 63 | String configFile;
|
58 | 64 |
|
@@ -95,13 +101,15 @@ private void listLabels(WorkitemClientApi api) {
|
95 | 101 | labels = getLabels(apiCall, lGetter);
|
96 | 102 | } else if (group != null) {
|
97 | 103 | System.out.println("Reading gitlab labels and metadata from group " + group);
|
98 |
| - Function<String, Group> apiCall = (from) -> api.group(group, includeAncestorGroups, from); |
| 104 | + Function<String, Group> apiCall = (from) -> api.group(group, includeDescendantGroups, onlyGroupLabels, from); |
99 | 105 | Function<Group, LabelConnection> lGetter = Group::getLabels;
|
100 | 106 | labels = getLabels(apiCall, lGetter);
|
101 | 107 | } else {
|
102 | 108 | throw new IllegalStateException("Unexpected");
|
103 | 109 | }
|
104 | 110 |
|
| 111 | + System.out.println("---> labels found: " + labels.size()); |
| 112 | + |
105 | 113 | for (Label label : labels) {
|
106 | 114 | System.out.println(label.getId() + " " + label.getTitle());
|
107 | 115 | }
|
|
0 commit comments