@clickview/ship-it 0.0.40 → 0.0.42-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/Dockerfile +33 -33
  2. package/README.md +48 -48
  3. package/config.json +19 -19
  4. package/dist/I3/I3 Notes Audit.csv +127 -0
  5. package/dist/J1/J1 Notes Audit.csv +38 -0
  6. package/dist/J2/J2 Notes Audit.csv +52 -0
  7. package/dist/L1/L1 Notes Audit.csv +139 -0
  8. package/lib/config.json +20 -20
  9. package/lib/src/api-clients/git-lab/GitLabApiClient.js +564 -557
  10. package/lib/src/api-clients/git-lab/GitLabMapper.js +122 -122
  11. package/lib/src/api-clients/index.js +20 -20
  12. package/lib/src/api-clients/slack/SlackApiClient.js +206 -206
  13. package/lib/src/api-clients/team-city/TeamCityApiClient.js +100 -100
  14. package/lib/src/api-clients/trello/TrelloApiClient.js +145 -145
  15. package/lib/src/commands/BumpPackagesCommand.js +76 -76
  16. package/lib/src/commands/ConfigureProjectsCommand.js +84 -84
  17. package/lib/src/commands/CreateBranchCommand.js +100 -100
  18. package/lib/src/commands/CreateMergeRequestCommand.js +107 -107
  19. package/lib/src/commands/CreateNotesAuditCommand.js +84 -84
  20. package/lib/src/commands/CreateReleaseNotesCommand.js +95 -95
  21. package/lib/src/commands/CreateTrelloCardsCommand.js +76 -77
  22. package/lib/src/commands/InstallPackagesCommand.js +76 -76
  23. package/lib/src/commands/ListProjectsCommand.js +76 -76
  24. package/lib/src/commands/ReleaseCommand.js +136 -136
  25. package/lib/src/commands/StartProjectBuildsCommand.js +76 -76
  26. package/lib/src/commands/StatusCommand.js +93 -93
  27. package/lib/src/commands/TagMasterCommand.js +76 -76
  28. package/lib/src/commands/ValidateMergeRequestCommand.js +76 -76
  29. package/lib/src/commands/VersionCommand.js +76 -76
  30. package/lib/src/commands/index.js +31 -31
  31. package/lib/src/constants/CommandTypeMapping.js +21 -21
  32. package/lib/src/constants/GitLabMemberIds.js +6 -6
  33. package/lib/src/constants/MonorepoPackageJsonFiles.js +41 -41
  34. package/lib/src/constants/MonorepoProjectNames.js +16 -16
  35. package/lib/src/constants/ProjectNames.js +69 -69
  36. package/lib/src/constants/SlackUserEmailList.js +13 -13
  37. package/lib/src/constants/TeamCityBuildIDs.js +46 -46
  38. package/lib/src/constants/index.js +19 -19
  39. package/lib/src/errors/ShipItError.js +32 -32
  40. package/lib/src/errors/index.js +17 -17
  41. package/lib/src/index.js +18 -18
  42. package/lib/src/interfaces/Config.js +2 -2
  43. package/lib/src/interfaces/MergeRequestState.js +2 -2
  44. package/lib/src/interfaces/ProjectNames.js +2 -2
  45. package/lib/src/interfaces/ShipItCommand.js +2 -2
  46. package/lib/src/interfaces/ShipItTask.js +2 -2
  47. package/lib/src/interfaces/VersionType.js +2 -2
  48. package/lib/src/interfaces/command-cli-options/DockerMilestoneCommandCliOptions.js +2 -0
  49. package/lib/src/interfaces/command-cli-options/MilestoneCommandCliOptions.js +2 -2
  50. package/lib/src/interfaces/command-cli-options/ReleaseCommandCliOptions.js +2 -2
  51. package/lib/src/interfaces/command-cli-options/StatusCommandCliOptions.js +2 -2
  52. package/lib/src/interfaces/command-cli-options/index.js +19 -19
  53. package/lib/src/interfaces/command-options/BaseCommandOptions.js +2 -2
  54. package/lib/src/interfaces/command-options/BumpPackagesCommandOptions.js +2 -2
  55. package/lib/src/interfaces/command-options/ConfigureProjectsOptions.js +2 -2
  56. package/lib/src/interfaces/command-options/DockerMilestoneCommandOptions.js +2 -2
  57. package/lib/src/interfaces/command-options/MilestoneCommandOptions.js +2 -2
  58. package/lib/src/interfaces/command-options/ReleaseCommandOptions.js +2 -2
  59. package/lib/src/interfaces/command-options/StatusCommandOptions.js +2 -2
  60. package/lib/src/interfaces/command-options/ValidateMRCommandOptions.js +2 -2
  61. package/lib/src/interfaces/command-options/index.js +23 -23
  62. package/lib/src/interfaces/index.js +26 -26
  63. package/lib/src/interfaces/models/ApprovalRule.js +2 -2
  64. package/lib/src/interfaces/models/ApprovalRuleConfiguration.js +2 -2
  65. package/lib/src/interfaces/models/Branch.js +2 -2
  66. package/lib/src/interfaces/models/Commit.js +2 -2
  67. package/lib/src/interfaces/models/CommitFile.js +2 -2
  68. package/lib/src/interfaces/models/CreateApprovalRuleRequest.js +2 -2
  69. package/lib/src/interfaces/models/File.js +2 -2
  70. package/lib/src/interfaces/models/Group.js +2 -2
  71. package/lib/src/interfaces/models/Label.js +2 -2
  72. package/lib/src/interfaces/models/MergeRequest.js +2 -2
  73. package/lib/src/interfaces/models/Milestone.js +2 -2
  74. package/lib/src/interfaces/models/Project.js +2 -2
  75. package/lib/src/interfaces/models/ProjectConfig.js +9 -9
  76. package/lib/src/interfaces/models/ProtectedBranch.js +2 -2
  77. package/lib/src/interfaces/models/Release.js +2 -2
  78. package/lib/src/interfaces/models/Tag.js +2 -2
  79. package/lib/src/interfaces/models/index.js +32 -32
  80. package/lib/src/interfaces/view-models/MilestoneProject.js +2 -2
  81. package/lib/src/interfaces/view-models/index.js +17 -17
  82. package/lib/src/inversify.config.js +79 -79
  83. package/lib/src/services/GitLabService.js +553 -544
  84. package/lib/src/services/SlackService.js +142 -142
  85. package/lib/src/services/TeamCityService.js +37 -37
  86. package/lib/src/services/TrelloService.js +84 -84
  87. package/lib/src/services/index.js +20 -20
  88. package/lib/src/startup/AddMilestoneCommand.js +88 -96
  89. package/lib/src/startup/GetAction.js +68 -68
  90. package/lib/src/startup/SetupCommands.js +191 -180
  91. package/lib/src/tasks/BumpPackagesTask.js +230 -230
  92. package/lib/src/tasks/BumpVersionTxtTask.js +110 -110
  93. package/lib/src/tasks/CommitPackageVersionsTask.js +116 -0
  94. package/lib/src/tasks/CreateBranchTask.js +104 -104
  95. package/lib/src/tasks/CreateMergeRequestTask.js +126 -118
  96. package/lib/src/tasks/CreateNotesAuditTask.js +140 -140
  97. package/lib/src/tasks/CreateReleaseNotesTask.js +144 -144
  98. package/lib/src/tasks/InstallPackagesTask.js +409 -415
  99. package/lib/src/tasks/ListProjectsTask.js +87 -87
  100. package/lib/src/tasks/PopulateTrelloBoardTask.js +140 -140
  101. package/lib/src/tasks/StartMonorepoBuildTask.js +109 -109
  102. package/lib/src/tasks/StartProjectBuildsTask.js +164 -170
  103. package/lib/src/tasks/TagMasterTask.js +196 -189
  104. package/lib/src/tasks/ValidateCommitsTask.js +210 -143
  105. package/lib/src/tasks/ValidateDescriptionsTask.js +178 -178
  106. package/lib/src/tasks/ValidateMergeRequestTask.js +115 -115
  107. package/lib/src/tasks/ValidateTask.js +419 -419
  108. package/lib/src/tasks/VersionTask.js +98 -98
  109. package/lib/src/tasks/configure-projects/AddApprovalRulesTask.js +199 -182
  110. package/lib/src/tasks/configure-projects/CreateToolingBranchTask.js +138 -136
  111. package/lib/src/tasks/configure-projects/EnsureApprovalRulesTask.js +106 -106
  112. package/lib/src/tasks/configure-projects/index.js +18 -18
  113. package/lib/src/tasks/configure-projects/primitives/BaseConfigureProjectsTask.js +98 -98
  114. package/lib/src/tasks/index.js +34 -34
  115. package/lib/src/types.js +60 -60
  116. package/lib/src/utils/BranchNames.js +11 -11
  117. package/lib/src/utils/Commits.js +82 -55
  118. package/lib/src/utils/Csv.js +54 -54
  119. package/lib/src/utils/Descriptions.js +274 -274
  120. package/lib/src/utils/GroupIds.js +6 -6
  121. package/lib/src/utils/Logger.js +62 -62
  122. package/lib/src/utils/ProjectIds.js +48 -47
  123. package/lib/src/utils/Versions.js +20 -20
  124. package/lib/src/utils/index.js +22 -22
  125. package/package.json +50 -50
@@ -1,180 +1,191 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.setupCommands = void 0;
40
- var utils_1 = require("../utils");
41
- var AddMilestoneCommand_1 = require("./AddMilestoneCommand");
42
- var GetAction_1 = require("./GetAction");
43
- function setupCommands(program, container) {
44
- var _this = this;
45
- var getAction = (0, GetAction_1.getActionBuilder)(program, container);
46
- var addMilestoneCommand = (0, AddMilestoneCommand_1.getAddMilestoneCommand)(program, getAction);
47
- // All commands below accept the same options
48
- addMilestoneCommand('version', 'Display the versions that will be used for the release');
49
- addMilestoneCommand('create-branches', 'Create release branches for all projects that are part of a milestone');
50
- addMilestoneCommand('create-mrs', 'Create merge requests for all projects that are part of a milestone');
51
- addMilestoneCommand('create-notes-audit', 'Builds a spreadsheet of all the customer changes and who wrote them.');
52
- addMilestoneCommand('tag-master', 'Tags master for all release MRs that are part of a milestone');
53
- addMilestoneCommand('create-trello-cards', 'Creates the cards on the ship-it trello board for all projects that are part of a milestone');
54
- program.command('status')
55
- .description('Get the status of all MRs in a milestone')
56
- .requiredOption('-m, --milestone <milestone>')
57
- .option('-p, --projectIds <projectIds...>')
58
- .option('-o, --omit <omittedProjectIds...>')
59
- .option('--slack-notifier')
60
- .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
61
- var options;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0:
65
- options = (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts);
66
- return [4 /*yield*/, getAction('status')(options)];
67
- case 1:
68
- _a.sent();
69
- return [2 /*return*/];
70
- }
71
- });
72
- }); });
73
- program.command('create-notes')
74
- .description('Get the status of all MRs in a milestone')
75
- .requiredOption('-m, --milestone <milestone>')
76
- .option('-p, --projectIds <projectIds...>')
77
- .option('-o, --omit <omittedProjectIds...>')
78
- .option('--slack-notifier')
79
- .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
80
- var options;
81
- return __generator(this, function (_a) {
82
- switch (_a.label) {
83
- case 0:
84
- options = (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts);
85
- return [4 /*yield*/, getAction('create-notes')(options)];
86
- case 1:
87
- _a.sent();
88
- return [2 /*return*/];
89
- }
90
- });
91
- }); });
92
- program.command('release')
93
- .description('Create releases for all projects that are part of a milestone')
94
- .requiredOption('-m, --milestone <milestone>')
95
- .option('-p, --projectIds <projectIds...>')
96
- .option('-o, --omit <omittedProjectIds...>')
97
- .option('-nm, --nextMilestone <nextMilestone>')
98
- .option('--hotfix')
99
- .option('--major')
100
- .option('--trigger-monorepo-build')
101
- .option('--slack-notifier')
102
- .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
103
- var options;
104
- return __generator(this, function (_a) {
105
- switch (_a.label) {
106
- case 0:
107
- options = (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts);
108
- return [4 /*yield*/, getAction('release')(options)];
109
- case 1:
110
- _a.sent();
111
- return [2 /*return*/];
112
- }
113
- });
114
- }); });
115
- program.command('bump-packages')
116
- .description('Bump clickview npm package versions in monorepo to their next version')
117
- .requiredOption('-b, --branchName <branchName>')
118
- .option('-p, --preId <preId>')
119
- .action(getAction('bump-packages'));
120
- program.command('install-packages')
121
- .description('Install the latest clickview npm packages in all consuming projects that are part of a milestone')
122
- .option('-m, --milestone <milestone>')
123
- .option('-b, --monorepoBranchName <monorepoBranchName>')
124
- .option('-p, --projectIds <projectIds...>')
125
- .option('-o, --omit <omittedProjectIds...>')
126
- .option('-t, --targetBranchName <targetBranchName>')
127
- .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
128
- var options;
129
- return __generator(this, function (_a) {
130
- switch (_a.label) {
131
- case 0:
132
- options = (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts);
133
- return [4 /*yield*/, getAction('install-packages')(options)];
134
- case 1:
135
- _a.sent();
136
- return [2 /*return*/];
137
- }
138
- });
139
- }); });
140
- program.command('validate-mr')
141
- .description('Validate a merge request in a single project, ensuring it has a milestone and valid description')
142
- .option('-p, --projectId <projectId>')
143
- .option('-b, --branchName <branchName>')
144
- .action(getAction('validate-mr'));
145
- program.command('start-project-builds')
146
- .description('Trigger TeamCity builds in all projects that are a part of a milestone')
147
- .option('-m, --milestone <milestone>')
148
- .option('--monorepoBranchName <monorepoBranchName>')
149
- .option('-p, --projectIds <projectIds...>')
150
- .option('-o, --omit <omittedProjectIds...>')
151
- .option('-t, --targetBranchName <targetBranchName>')
152
- .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
153
- var options;
154
- return __generator(this, function (_a) {
155
- switch (_a.label) {
156
- case 0:
157
- options = (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts);
158
- return [4 /*yield*/, getAction('start-project-builds')(options)];
159
- case 1:
160
- _a.sent();
161
- return [2 /*return*/];
162
- }
163
- });
164
- }); });
165
- program.command('list-projects')
166
- .description('Displays a list of all project names that can be used with the -p argument')
167
- .action(getAction('list-projects'));
168
- program.command('configure-projects')
169
- .description('Configures all projects using Gitlab\'s API')
170
- .option('-p, --projectIds <projectIds...>')
171
- .option('--allProjects')
172
- .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
173
- return __generator(this, function (_a) {
174
- if (opts.projectIds)
175
- opts.projectIds = utils_1.ProjectIds.getProjectIds(opts.projectIds);
176
- return [2 /*return*/, getAction('configure-projects')(opts)];
177
- });
178
- }); });
179
- }
180
- exports.setupCommands = setupCommands;
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.setupCommands = void 0;
51
+ var utils_1 = require("../utils");
52
+ var AddMilestoneCommand_1 = require("./AddMilestoneCommand");
53
+ var GetAction_1 = require("./GetAction");
54
+ function setupCommands(program, container) {
55
+ var _this = this;
56
+ var getAction = (0, GetAction_1.getActionBuilder)(program, container);
57
+ var addMilestoneCommand = (0, AddMilestoneCommand_1.getAddMilestoneCommand)(program, getAction);
58
+ // All commands below accept the same options
59
+ addMilestoneCommand('version', 'Display the versions that will be used for the release');
60
+ addMilestoneCommand('create-branches', 'Create release branches for all projects that are part of a milestone');
61
+ addMilestoneCommand('create-mrs', 'Create merge requests for all projects that are part of a milestone');
62
+ addMilestoneCommand('create-notes-audit', 'Builds a spreadsheet of all the customer changes and who wrote them.');
63
+ addMilestoneCommand('tag-master', 'Tags master for all release MRs that are part of a milestone');
64
+ addMilestoneCommand('create-trello-cards', 'Creates the cards on the ship-it trello board for all projects that are part of a milestone');
65
+ program.command('status')
66
+ .description('Get the status of all MRs in a milestone')
67
+ .requiredOption('-m, --milestone <milestone>')
68
+ .option('-p, --projectIds <projectIds...>')
69
+ .option('-o, --omit <omittedProjectIds...>')
70
+ .option('--slack-notifier')
71
+ .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
72
+ var options;
73
+ return __generator(this, function (_a) {
74
+ switch (_a.label) {
75
+ case 0:
76
+ options = (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts);
77
+ return [4 /*yield*/, getAction('status')(options)];
78
+ case 1:
79
+ _a.sent();
80
+ return [2 /*return*/];
81
+ }
82
+ });
83
+ }); });
84
+ program.command('create-notes')
85
+ .description('Get the status of all MRs in a milestone')
86
+ .requiredOption('-m, --milestone <milestone>')
87
+ .option('-p, --projectIds <projectIds...>')
88
+ .option('-o, --omit <omittedProjectIds...>')
89
+ .option('--slack-notifier')
90
+ .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
91
+ var options;
92
+ return __generator(this, function (_a) {
93
+ switch (_a.label) {
94
+ case 0:
95
+ options = (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts);
96
+ return [4 /*yield*/, getAction('create-notes')(options)];
97
+ case 1:
98
+ _a.sent();
99
+ return [2 /*return*/];
100
+ }
101
+ });
102
+ }); });
103
+ program.command('release')
104
+ .description('Create releases for all projects that are part of a milestone')
105
+ .requiredOption('-m, --milestone <milestone>')
106
+ .option('-p, --projectIds <projectIds...>')
107
+ .option('-o, --omit <omittedProjectIds...>')
108
+ .option('-nm, --nextMilestone <nextMilestone>')
109
+ .option('--hotfix')
110
+ .option('--major')
111
+ .option('--trigger-monorepo-build')
112
+ .option('--slack-notifier')
113
+ .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
114
+ var options;
115
+ return __generator(this, function (_a) {
116
+ switch (_a.label) {
117
+ case 0:
118
+ options = __assign(__assign({}, (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts)), { triggerMonorepoBuild: opts.triggerMonorepoBuild || false });
119
+ return [4 /*yield*/, getAction('release')(options)];
120
+ case 1:
121
+ _a.sent();
122
+ return [2 /*return*/];
123
+ }
124
+ });
125
+ }); });
126
+ program.command('bump-packages')
127
+ .description('Bump clickview npm package versions in monorepo to their next version')
128
+ .requiredOption('-b, --branchName <branchName>')
129
+ .option('-p, --preId <preId>')
130
+ .action(getAction('bump-packages'));
131
+ program.command('install-packages')
132
+ .description('Install the latest clickview npm packages in all consuming projects that are part of a milestone')
133
+ .option('-m, --milestone <milestone>')
134
+ .option('-b, --monorepoBranchName <monorepoBranchName>')
135
+ .option('-p, --projectIds <projectIds...>')
136
+ .option('-o, --omit <omittedProjectIds...>')
137
+ .option('-t, --targetBranchName <targetBranchName>')
138
+ .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
139
+ var options;
140
+ return __generator(this, function (_a) {
141
+ switch (_a.label) {
142
+ case 0:
143
+ options = __assign(__assign({}, (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts)), { targetBranchName: opts.targetBranchName || null, monorepoBranchName: opts.monorepoBranchName || null });
144
+ return [4 /*yield*/, getAction('install-packages')(options)];
145
+ case 1:
146
+ _a.sent();
147
+ return [2 /*return*/];
148
+ }
149
+ });
150
+ }); });
151
+ program.command('validate-mr')
152
+ .description('Validate a merge request in a single project, ensuring it has a milestone and valid description')
153
+ .option('-p, --projectId <projectId>')
154
+ .option('-b, --branchName <branchName>')
155
+ .action(getAction('validate-mr'));
156
+ program.command('start-project-builds')
157
+ .description('Trigger TeamCity builds in all projects that are a part of a milestone')
158
+ .option('-m, --milestone <milestone>')
159
+ .option('--monorepoBranchName <monorepoBranchName>')
160
+ .option('-p, --projectIds <projectIds...>')
161
+ .option('-o, --omit <omittedProjectIds...>')
162
+ .option('-t, --targetBranchName <targetBranchName>')
163
+ .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
164
+ var options;
165
+ return __generator(this, function (_a) {
166
+ switch (_a.label) {
167
+ case 0:
168
+ options = __assign(__assign({}, (0, AddMilestoneCommand_1.processMilestoneCommandOptions)(opts)), { targetBranchName: opts.targetBranchName || null, monorepoBranchName: opts.monorepoBranchName || null });
169
+ return [4 /*yield*/, getAction('start-project-builds')(options)];
170
+ case 1:
171
+ _a.sent();
172
+ return [2 /*return*/];
173
+ }
174
+ });
175
+ }); });
176
+ program.command('list-projects')
177
+ .description('Displays a list of all project names that can be used with the -p argument')
178
+ .action(getAction('list-projects'));
179
+ program.command('configure-projects')
180
+ .description('Configures all projects using Gitlab\'s API')
181
+ .option('-p, --projectIds <projectIds...>')
182
+ .option('--allProjects')
183
+ .action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
184
+ return __generator(this, function (_a) {
185
+ if (opts.projectIds)
186
+ opts.projectIds = utils_1.ProjectIds.getProjectIds(opts.projectIds);
187
+ return [2 /*return*/, getAction('configure-projects')(opts)];
188
+ });
189
+ }); });
190
+ }
191
+ exports.setupCommands = setupCommands;