@clickview/ship-it 0.0.49 → 0.0.50

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 (66) hide show
  1. package/config.json +5 -0
  2. package/lib/config.json +5 -0
  3. package/lib/src/api-clients/git-lab/GitLabApiClient.js +1 -1
  4. package/lib/src/api-clients/index.js +1 -0
  5. package/lib/src/api-clients/slack/SlackApiClient.js +27 -25
  6. package/lib/src/api-clients/team-city/TeamCityApiClient.js +1 -1
  7. package/lib/src/api-clients/trello/TrelloApiClient.js +1 -1
  8. package/lib/src/commands/BumpPackagesCommand.js +1 -1
  9. package/lib/src/commands/CheckReleaseReadyCommand.js +1 -1
  10. package/lib/src/commands/ConfigureProjectsCommand.js +1 -1
  11. package/lib/src/commands/CreateBranchCommand.js +1 -1
  12. package/lib/src/commands/CreateHotfixCommand.js +1 -1
  13. package/lib/src/commands/CreateMergeRequestCommand.js +1 -1
  14. package/lib/src/commands/CreateNotesAuditCommand.js +1 -1
  15. package/lib/src/commands/CreateReleaseNotesCommand.js +1 -1
  16. package/lib/src/commands/CreateTrelloCardsCommand.js +1 -1
  17. package/lib/src/commands/InstallPackagesCommand.js +1 -1
  18. package/lib/src/commands/JiraTicketsStatusCommand.js +1 -41
  19. package/lib/src/commands/ListProjectsCommand.js +1 -1
  20. package/lib/src/commands/ReleaseCommand.js +1 -1
  21. package/lib/src/commands/StartProjectBuildsCommand.js +1 -1
  22. package/lib/src/commands/StatusCommand.js +1 -1
  23. package/lib/src/commands/TagMasterCommand.js +1 -1
  24. package/lib/src/commands/ToolingReleaseCommand.js +1 -1
  25. package/lib/src/commands/UpdateDescriptionCommand.js +1 -1
  26. package/lib/src/commands/ValidateMergeRequestCommand.js +1 -1
  27. package/lib/src/commands/VersionCommand.js +1 -1
  28. package/lib/src/commands/index.js +2 -0
  29. package/lib/src/constants/CommandTypeMapping.js +2 -0
  30. package/lib/src/inversify.config.js +7 -0
  31. package/lib/src/services/GitLabService.js +9 -4
  32. package/lib/src/services/SlackService.js +3 -7
  33. package/lib/src/services/TrelloService.js +1 -1
  34. package/lib/src/services/index.js +1 -0
  35. package/lib/src/startup/AddMilestoneCommand.js +1 -1
  36. package/lib/src/startup/GetAction.js +1 -1
  37. package/lib/src/startup/SetupCommands.js +3 -1
  38. package/lib/src/tasks/BumpPackagesTask.js +1 -1
  39. package/lib/src/tasks/BumpVersionTxtTask.js +1 -1
  40. package/lib/src/tasks/ChangeMilestoneTask.js +1 -1
  41. package/lib/src/tasks/CheckReleaseReadyTask.js +29 -17
  42. package/lib/src/tasks/CreateBranchTask.js +1 -1
  43. package/lib/src/tasks/CreateHotfixTask.js +1 -1
  44. package/lib/src/tasks/CreateMergeRequestTask.js +1 -1
  45. package/lib/src/tasks/CreateNotesAuditTask.js +40 -16
  46. package/lib/src/tasks/CreateReleaseNotesTask.js +1 -1
  47. package/lib/src/tasks/InstallPackagesTask.js +1 -1
  48. package/lib/src/tasks/ListProjectsTask.js +1 -1
  49. package/lib/src/tasks/PopulateTrelloBoardTask.js +1 -1
  50. package/lib/src/tasks/StartMonorepoBuildTask.js +1 -1
  51. package/lib/src/tasks/StartProjectBuildsTask.js +1 -1
  52. package/lib/src/tasks/TagMasterTask.js +1 -1
  53. package/lib/src/tasks/UpdateMergeRequestDescriptionTask.js +1 -1
  54. package/lib/src/tasks/ValidateCommitsTask.js +1 -1
  55. package/lib/src/tasks/ValidateDescriptionsTask.js +1 -1
  56. package/lib/src/tasks/ValidateMergeRequestTask.js +1 -1
  57. package/lib/src/tasks/ValidateTask.js +23 -20
  58. package/lib/src/tasks/VersionTask.js +1 -1
  59. package/lib/src/tasks/configure-projects/AddApprovalRulesTask.js +1 -1
  60. package/lib/src/tasks/configure-projects/CreateToolingBranchTask.js +1 -1
  61. package/lib/src/tasks/configure-projects/EnsureApprovalRulesTask.js +1 -1
  62. package/lib/src/tasks/configure-projects/primitives/BaseConfigureProjectsTask.js +2 -2
  63. package/lib/src/tasks/index.js +2 -0
  64. package/lib/src/types.js +7 -0
  65. package/lib/src/utils/Descriptions.js +38 -10
  66. package/package.json +6 -5
package/config.json CHANGED
@@ -16,5 +16,10 @@
16
16
  "apiKey": "6e887685d44e94ae9a680c010c4b622d",
17
17
  "apiToken": "ATTA558c8969ce04b46fb9c9d6f645aa51be7f1c9dbb9b6f5f6f85ae6da2a209c1f39AAC612F",
18
18
  "boardId": "3edi3xiO"
19
+ },
20
+ "jira": {
21
+ "url": "https://clickview.atlassian.net",
22
+ "email": "zoomroomadmin@clickview.com.au",
23
+ "apiToken": "ATATT3xFfGF0BZem0LYP2b557qk190iNVjwJnFSHfW8lnTHMKwrrqWo3t2O3tXG6UUh7U4IYpoIdGhcU_mGmzD1ku8_pzKExw18JgNJpuF15bYBZX8opwnSnpEtwXSgnP5DA2I1idIYIslSwCQh5yOvGww6Po_l0BnnFEnkxBXnYZa5LjEvVEhs=DD045334"
19
24
  }
20
25
  }
package/lib/config.json CHANGED
@@ -16,5 +16,10 @@
16
16
  "apiKey": "6e887685d44e94ae9a680c010c4b622d",
17
17
  "apiToken": "ATTA558c8969ce04b46fb9c9d6f645aa51be7f1c9dbb9b6f5f6f85ae6da2a209c1f39AAC612F",
18
18
  "boardId": "3edi3xiO"
19
+ },
20
+ "jira": {
21
+ "url": "https://clickview.atlassian.net",
22
+ "email": "zoomroomadmin@clickview.com.au",
23
+ "apiToken": "ATATT3xFfGF0BZem0LYP2b557qk190iNVjwJnFSHfW8lnTHMKwrrqWo3t2O3tXG6UUh7U4IYpoIdGhcU_mGmzD1ku8_pzKExw18JgNJpuF15bYBZX8opwnSnpEtwXSgnP5DA2I1idIYIslSwCQh5yOvGww6Po_l0BnnFEnkxBXnYZa5LjEvVEhs=DD045334"
19
24
  }
20
25
  }
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./git-lab/GitLabApiClient"), exports);
18
+ __exportStar(require("./jira/JiraApiClient"), exports);
18
19
  __exportStar(require("./team-city/TeamCityApiClient"), exports);
19
20
  __exportStar(require("./slack/SlackApiClient"), exports);
20
21
  __exportStar(require("./trello/TrelloApiClient"), exports);
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -108,17 +108,18 @@ var SlackApiClient = /** @class */ (function () {
108
108
  });
109
109
  });
110
110
  };
111
- SlackApiClient.prototype.replyInThread = function (message, threadTs) {
111
+ SlackApiClient.prototype.replyInThread = function (message, threadTs, sendAsFile) {
112
112
  return __awaiter(this, void 0, void 0, function () {
113
- var response, uploadResponse, error_3;
113
+ var formatedMessage, response, uploadResponse, error_3;
114
114
  return __generator(this, function (_a) {
115
115
  switch (_a.label) {
116
116
  case 0:
117
117
  _a.trys.push([0, 4, , 5]);
118
- if (!(message.length <= MAX_MESSAGE_LENGTH)) return [3 /*break*/, 2];
118
+ if (!(message.length <= MAX_MESSAGE_LENGTH && !sendAsFile)) return [3 /*break*/, 2];
119
+ formatedMessage = this.createTextFileMessage(message);
119
120
  return [4 /*yield*/, this.client.chat.postMessage({
120
121
  channel: this.config.channelId,
121
- text: message,
122
+ text: formatedMessage,
122
123
  thread_ts: threadTs,
123
124
  })];
124
125
  case 1:
@@ -127,7 +128,7 @@ var SlackApiClient = /** @class */ (function () {
127
128
  case 2: return [4 /*yield*/, this.client.files.uploadV2({
128
129
  channel_id: this.config.channelId,
129
130
  content: message,
130
- filename: 'statusData.txt',
131
+ filename: 'releaseData.md',
131
132
  thread_ts: threadTs,
132
133
  })];
133
134
  case 3:
@@ -170,32 +171,33 @@ var SlackApiClient = /** @class */ (function () {
170
171
  });
171
172
  };
172
173
  SlackApiClient.prototype.getUsersList = function (emailIds) {
174
+ var _a, _b, _c;
173
175
  return __awaiter(this, void 0, void 0, function () {
174
- var promises, results, error_5;
176
+ var results, userIds, i, result;
175
177
  var _this = this;
176
- return __generator(this, function (_a) {
177
- switch (_a.label) {
178
- case 0:
179
- _a.trys.push([0, 2, , 3]);
180
- promises = emailIds.map(function (email) { return _this.client.users.lookupByEmail({ email: email }); });
181
- return [4 /*yield*/, Promise.all(promises)];
178
+ return __generator(this, function (_d) {
179
+ switch (_d.label) {
180
+ case 0: return [4 /*yield*/, Promise.allSettled(emailIds.map(function (email) { return _this.client.users.lookupByEmail({ email: email }); }))];
182
181
  case 1:
183
- results = _a.sent();
184
- return [2 /*return*/, results.map(function (result) {
185
- var _a, _b;
186
- if (!result.ok || !((_a = result.user) === null || _a === void 0 ? void 0 : _a.id))
187
- throw new Error("Failed to fetch usernames. Slack error message: ".concat(result.error));
188
- return (_b = result.user) === null || _b === void 0 ? void 0 : _b.id;
189
- })];
190
- case 2:
191
- error_5 = _a.sent();
192
- utils_1.Logger.logError('Error:', error_5.message);
193
- throw error_5;
194
- case 3: return [2 /*return*/];
182
+ results = _d.sent();
183
+ userIds = [];
184
+ for (i = 0; i < results.length; i++) {
185
+ result = results[i];
186
+ if (result.status === 'rejected') {
187
+ utils_1.Logger.logError("Error looking up Slack user for ".concat(emailIds[i], ":"), (_b = (_a = result.reason) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : result.reason);
188
+ continue;
189
+ }
190
+ if (result.value.ok && ((_c = result.value.user) === null || _c === void 0 ? void 0 : _c.id))
191
+ userIds.push(result.value.user.id);
192
+ }
193
+ return [2 /*return*/, userIds];
195
194
  }
196
195
  });
197
196
  });
198
197
  };
198
+ SlackApiClient.prototype.createTextFileMessage = function (fileContent) {
199
+ return "```\n".concat(fileContent, "\n```");
200
+ };
199
201
  SlackApiClient = __decorate([
200
202
  (0, inversify_1.injectable)(),
201
203
  __param(0, (0, inversify_1.inject)(types_1.MISC.SlackConfig)),
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -11,42 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- var __generator = (this && this.__generator) || function (thisArg, body) {
24
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
- function verb(n) { return function (v) { return step([n, v]); }; }
27
- function step(op) {
28
- if (f) throw new TypeError("Generator is already executing.");
29
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
- 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;
31
- if (y = 0, t) op = [op[0] & 2, t.value];
32
- switch (op[0]) {
33
- case 0: case 1: t = op; break;
34
- case 4: _.label++; return { value: op[1], done: false };
35
- case 5: _.label++; y = op[1]; op = [0]; continue;
36
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
- default:
38
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
- if (t[2]) _.ops.pop();
43
- _.trys.pop(); continue;
44
- }
45
- op = body.call(thisArg, _);
46
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
- }
49
- };
50
14
  Object.defineProperty(exports, "__esModule", { value: true });
51
15
  exports.JiraTicketsStatusCommand = void 0;
52
16
  require("reflect-metadata");
@@ -57,11 +21,7 @@ var JiraTicketsStatusCommand = /** @class */ (function () {
57
21
  this.jiraTicketsStatusTask = jiraTicketsStatusTask;
58
22
  }
59
23
  JiraTicketsStatusCommand.prototype.run = function (options) {
60
- return __awaiter(this, void 0, void 0, function () {
61
- return __generator(this, function (_a) {
62
- return [2 /*return*/, this.jiraTicketsStatusTask.run(options)];
63
- });
64
- });
24
+ return this.jiraTicketsStatusTask.run(options);
65
25
  };
66
26
  JiraTicketsStatusCommand = __decorate([
67
27
  (0, inversify_1.injectable)(),
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -21,6 +21,7 @@ __exportStar(require("./CreateMergeRequestCommand"), exports);
21
21
  __exportStar(require("./ListProjectsCommand"), exports);
22
22
  __exportStar(require("./CreateReleaseNotesCommand"), exports);
23
23
  __exportStar(require("./CreateNotesAuditCommand"), exports);
24
+ __exportStar(require("./JiraTicketsStatusCommand"), exports);
24
25
  __exportStar(require("./InstallPackagesCommand"), exports);
25
26
  __exportStar(require("./ReleaseCommand"), exports);
26
27
  __exportStar(require("./ToolingReleaseCommand"), exports);
@@ -30,5 +31,6 @@ __exportStar(require("./TagMasterCommand"), exports);
30
31
  __exportStar(require("./ValidateMergeRequestCommand"), exports);
31
32
  __exportStar(require("./VersionCommand"), exports);
32
33
  __exportStar(require("./CreateTrelloCardsCommand"), exports);
34
+ __exportStar(require("./CheckReleaseReadyCommand"), exports);
33
35
  __exportStar(require("./CreateHotfixCommand"), exports);
34
36
  __exportStar(require("./UpdateDescriptionCommand"), exports);
@@ -11,6 +11,7 @@ exports.CommandTypeMapping = {
11
11
  'create-mrs': types_1.COMMANDS.CreateMergeRequestCommand,
12
12
  'create-notes': types_1.COMMANDS.CreateReleaseNotesCommand,
13
13
  'create-notes-audit': types_1.COMMANDS.CreateNotesAuditCommand,
14
+ 'testing-status': types_1.COMMANDS.JiraTicketsStatusCommand,
14
15
  'install-packages': types_1.COMMANDS.InstallPackagesCommand,
15
16
  'bump-packages': types_1.COMMANDS.BumpPackagesCommand,
16
17
  'validate-mr': types_1.COMMANDS.ValidateMergeRequestCommand,
@@ -19,6 +20,7 @@ exports.CommandTypeMapping = {
19
20
  'list-projects': types_1.COMMANDS.ListProjectsCommand,
20
21
  'create-trello-cards': types_1.COMMANDS.CreateTrelloCardsCommand,
21
22
  'configure-projects': types_1.COMMANDS.ConfigureProjectsCommand,
23
+ 'check-release-ready': types_1.COMMANDS.CheckReleaseReadyCommand,
22
24
  'create-hotfix': types_1.COMMANDS.CreateHotfixCommand,
23
25
  'update-description': types_1.COMMANDS.UpdateDescriptionCommand
24
26
  };
@@ -15,6 +15,7 @@ function createContainer(config) {
15
15
  * Misc
16
16
  */
17
17
  container.bind(types_1.MISC.GitLabConfig).toConstantValue(config.gitLab);
18
+ container.bind(types_1.MISC.JiraConfig).toConstantValue(config.jira);
18
19
  container.bind(types_1.MISC.TeamCityConfig).toConstantValue(config.teamCity);
19
20
  container.bind(types_1.MISC.SlackConfig).toConstantValue(config.slack);
20
21
  container.bind(types_1.MISC.TrelloConfig).toConstantValue(config.trello);
@@ -22,6 +23,7 @@ function createContainer(config) {
22
23
  * Clients
23
24
  */
24
25
  container.bind(types_1.API_CLIENTS.GitLabApiClient).to(api_clients_1.GitLabApiClient);
26
+ container.bind(types_1.API_CLIENTS.JiraApiClient).to(api_clients_1.JiraApiClient);
25
27
  container.bind(types_1.API_CLIENTS.TeamCityApiClient).to(api_clients_1.TeamCityApiClient);
26
28
  container.bind(types_1.API_CLIENTS.SlackApiClient).to(api_clients_1.SlackApiClient);
27
29
  container.bind(types_1.API_CLIENTS.TrelloApiClient).to(api_clients_1.TrelloApiClient);
@@ -29,6 +31,7 @@ function createContainer(config) {
29
31
  * Services
30
32
  */
31
33
  container.bind(types_1.SERVICES.GitLabService).to(services_1.GitLabService).inSingletonScope();
34
+ container.bind(types_1.SERVICES.JiraService).to(services_1.JiraService).inSingletonScope();
32
35
  container.bind(types_1.SERVICES.TeamCityService).to(services_1.TeamCityService).inSingletonScope();
33
36
  container.bind(types_1.SERVICES.SlackService).to(services_1.SlackService).inSingletonScope();
34
37
  container.bind(types_1.SERVICES.TrelloService).to(services_1.TrelloService).inSingletonScope();
@@ -44,6 +47,7 @@ function createContainer(config) {
44
47
  container.bind(types_1.TASKS.ValidateDescriptionsTask).to(tasks_1.ValidateDescriptionsTask);
45
48
  container.bind(types_1.TASKS.CreateReleaseNotesTask).to(tasks_1.CreateReleaseNotesTask);
46
49
  container.bind(types_1.TASKS.CreateNotesAuditTask).to(tasks_1.CreateNotesAuditTask);
50
+ container.bind(types_1.TASKS.JiraTicketsStatusTask).to(tasks_1.JiraTicketsStatusTask);
47
51
  container.bind(types_1.TASKS.InstallPackagesTask).to(tasks_1.InstallPackagesTask);
48
52
  container.bind(types_1.TASKS.BumpPackagesTask).to(tasks_1.BumpPackagesTask);
49
53
  container.bind(types_1.TASKS.ValidateMergeRequestTask).to(tasks_1.ValidateMergeRequestTask);
@@ -56,6 +60,7 @@ function createContainer(config) {
56
60
  container.bind(types_1.TASKS.AddApprovalRulesTask).to(tasks_1.AddApprovalRulesTask);
57
61
  container.bind(types_1.TASKS.EnsureApprovalRulesTask).to(EnsureApprovalRulesTask_1.EnsureApprovalRulesTask);
58
62
  container.bind(types_1.TASKS.CreateToolingBranchTask).to(tasks_1.CreateToolingBranchTask);
63
+ container.bind(types_1.TASKS.CheckReleaseReadyTask).to(tasks_1.CheckReleaseReadyTask);
59
64
  container.bind(types_1.TASKS.CreateHotfixTask).to(tasks_1.CreateHotfixTask);
60
65
  container.bind(types_1.TASKS.ChangeMilestoneTask).to(ChangeMilestoneTask_1.ChangeMilestoneTask);
61
66
  container
@@ -72,6 +77,7 @@ function createContainer(config) {
72
77
  container.bind(types_1.COMMANDS.ToolingReleaseCommand).to(commands_1.ToolingReleaseCommand);
73
78
  container.bind(types_1.COMMANDS.CreateReleaseNotesCommand).to(commands_1.CreateReleaseNotesCommand);
74
79
  container.bind(types_1.COMMANDS.CreateNotesAuditCommand).to(commands_1.CreateNotesAuditCommand);
80
+ container.bind(types_1.COMMANDS.JiraTicketsStatusCommand).to(commands_1.JiraTicketsStatusCommand);
75
81
  container.bind(types_1.COMMANDS.InstallPackagesCommand).to(commands_1.InstallPackagesCommand);
76
82
  container.bind(types_1.COMMANDS.BumpPackagesCommand).to(commands_1.BumpPackagesCommand);
77
83
  container.bind(types_1.COMMANDS.ValidateMergeRequestCommand).to(commands_1.ValidateMergeRequestCommand);
@@ -81,6 +87,7 @@ function createContainer(config) {
81
87
  container.bind(types_1.COMMANDS.StartProjectBuildsCommand)
82
88
  .to(commands_1.StartProjectBuildsCommand);
83
89
  container.bind(types_1.COMMANDS.ConfigureProjectsCommand).to(commands_1.ConfigureProjectsCommand);
90
+ container.bind(types_1.COMMANDS.CheckReleaseReadyCommand).to(commands_1.CheckReleaseReadyCommand);
84
91
  container.bind(types_1.COMMANDS.CreateHotfixCommand).to(commands_1.CreateHotfixCommand);
85
92
  container.bind(types_1.COMMANDS.UpdateDescriptionCommand).to(commands_1.UpdateDescriptionCommand);
86
93
  return container;
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  function verb(n) { return function (v) { return step([n, v]); }; }
38
38
  function step(op) {
39
39
  if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
41
  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;
42
42
  if (y = 0, t) op = [op[0] & 2, t.value];
43
43
  switch (op[0]) {
@@ -88,7 +88,7 @@ var GitLabService = /** @class */ (function () {
88
88
  if (omittedProjectIds === void 0) { omittedProjectIds = []; }
89
89
  var _b = _a === void 0 ? {} : _a, _c = _b.invalidateCache, invalidateCache = _c === void 0 ? false : _c;
90
90
  return __awaiter(this, void 0, void 0, function () {
91
- var allMergeRequests, mergeRequests, releaseProjectIds, projects, mappedProjects, _i, mappedProjects_1, mappedProject, extraProjects;
91
+ var allMergeRequests, mergeRequests, releaseIgnoreLabel, releasableMergeRequests, releaseProjectIds, projects, mappedProjects, _i, mappedProjects_1, mappedProject, extraProjects;
92
92
  return __generator(this, function (_d) {
93
93
  switch (_d.label) {
94
94
  case 0:
@@ -101,13 +101,18 @@ var GitLabService = /** @class */ (function () {
101
101
  mergeRequests = allMergeRequests.filter(function (mr) { return mr.targetBranch !== 'master'; });
102
102
  if (!(mergeRequests === null || mergeRequests === void 0 ? void 0 : mergeRequests.length))
103
103
  throw new errors_1.ShipItError('Could not find any merge requests for the specified options');
104
- releaseProjectIds = lodash_1.default.uniqBy(mergeRequests, function (m) { return m.projectId; }).map(function (m) { return m.projectId; });
104
+ releaseIgnoreLabel = 'shipit::release_ignore';
105
+ releasableMergeRequests = mergeRequests.filter(function (mr) {
106
+ var _a;
107
+ return !((_a = mr.labels) !== null && _a !== void 0 ? _a : []).includes(releaseIgnoreLabel);
108
+ });
109
+ releaseProjectIds = lodash_1.default.uniqBy(releasableMergeRequests, function (m) { return m.projectId; }).map(function (m) { return m.projectId; });
105
110
  return [4 /*yield*/, this.apiClient.getProjectsByIds(releaseProjectIds)];
106
111
  case 2:
107
112
  projects = _d.sent();
108
113
  if (!(projects === null || projects === void 0 ? void 0 : projects.length) || projects.length !== releaseProjectIds.length)
109
114
  throw new errors_1.ShipItError('Could not find all projects for the found merge requests');
110
- mappedProjects = projects.map(function (p) { return (__assign(__assign({}, p), { mergeRequests: mergeRequests.filter(function (mr) { return mr.projectId === p.id; }) })); });
115
+ mappedProjects = projects.map(function (p) { return (__assign(__assign({}, p), { mergeRequests: releasableMergeRequests.filter(function (mr) { return mr.projectId === p.id; }) })); });
111
116
  _i = 0, mappedProjects_1 = mappedProjects;
112
117
  _d.label = 3;
113
118
  case 3:
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -89,7 +89,7 @@ var SlackService = /** @class */ (function () {
89
89
  SlackService.prototype.sendSlackStatusMessage = function (options) {
90
90
  var _a, _b;
91
91
  return __awaiter(this, void 0, void 0, function () {
92
- var threadTs, _c, formatedMessage, authorList, userList, mentionUserString;
92
+ var threadTs, _c, authorList, userList, mentionUserString;
93
93
  return __generator(this, function (_d) {
94
94
  switch (_d.label) {
95
95
  case 0: return [4 /*yield*/, this.apiClient.findLatestMessageTs(options.threadLabel)];
@@ -105,8 +105,7 @@ var SlackService = /** @class */ (function () {
105
105
  threadTs = _c;
106
106
  if (!options.statusMessage)
107
107
  options.statusMessage = options.statusCleanMessage;
108
- formatedMessage = this.createTextFileMessage(options.statusMessage);
109
- return [4 /*yield*/, this.apiClient.replyInThread(formatedMessage, threadTs)];
108
+ return [4 /*yield*/, this.apiClient.replyInThread(options.statusMessage, threadTs, options.sendAsFile)];
110
109
  case 5:
111
110
  _d.sent();
112
111
  if (!((_b = options.emailList) === null || _b === void 0 ? void 0 : _b.length))
@@ -129,9 +128,6 @@ var SlackService = /** @class */ (function () {
129
128
  SlackService.prototype.formatMentionUsers = function (usernames) {
130
129
  return usernames.map(function (username) { return "<@".concat(username, ">"); }).join(' ');
131
130
  };
132
- SlackService.prototype.createTextFileMessage = function (fileContent) {
133
- return "```\n".concat(fileContent, "\n```");
134
- };
135
131
  SlackService = __decorate([
136
132
  (0, inversify_1.injectable)(),
137
133
  __param(0, (0, inversify_1.inject)(types_1.API_CLIENTS.SlackApiClient)),
@@ -26,7 +26,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
26
26
  function verb(n) { return function (v) { return step([n, v]); }; }
27
27
  function step(op) {
28
28
  if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
29
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
30
  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;
31
31
  if (y = 0, t) op = [op[0] & 2, t.value];
32
32
  switch (op[0]) {
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./GitLabService"), exports);
18
+ __exportStar(require("./JiraService"), exports);
18
19
  __exportStar(require("./TeamCityService"), exports);
19
20
  __exportStar(require("./TrelloService"), exports);
20
21
  __exportStar(require("./SlackService"), exports);
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
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
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {