bdy 1.19.2-dev-pipeline → 1.19.3-dev-pipeline

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.19.2-dev-pipeline",
4
+ "version": "1.19.3-dev-pipeline",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -22,6 +22,7 @@ var MODE;
22
22
  MODE["RUN"] = "RUN";
23
23
  MODE["ACTION"] = "ACTION";
24
24
  })(MODE || (MODE = {}));
25
+ const LOGS_LIMIT = 1000;
25
26
  class OutputPipeline {
26
27
  static async runLogs(client, workspace, project, pipelineId, runId, runActionId, noWait) {
27
28
  if (output_1.default.isTTY() && !noWait) {
@@ -118,6 +119,9 @@ class OutputPipeline {
118
119
  static _runLogsHeader() {
119
120
  return `${output_1.default.getTermKitBlueColor('/')} ${output_1.default.getTermKitLabelColor('LOGS')}`;
120
121
  }
122
+ static _runOutputHeader() {
123
+ return `${output_1.default.getTermKitBlueColor('/')} ${output_1.default.getTermKitLabelColor('OUTPUT')}`;
124
+ }
121
125
  static _runDetailsStarted(status, started, delayed, tabs) {
122
126
  if (delayed && status === pipeline_1.PIPELINE_RUN_STATUS.ENQUEUED) {
123
127
  let str = ` ${output_1.default.getTermKitDimColor(this._fillString('Scheduled', tabs))}`;
@@ -154,7 +158,7 @@ class OutputPipeline {
154
158
  if (end > logs.length)
155
159
  end = logs.length;
156
160
  for (let i = start; i < end; i += 1) {
157
- str.push(` ${output_1.default.getTermKitDimColor(logs[i])}`);
161
+ str.push(`${output_1.default.getTermKitDimColor(logs[i])}`);
158
162
  }
159
163
  }
160
164
  else {
@@ -670,13 +674,22 @@ class OutputPipeline {
670
674
  return help;
671
675
  }
672
676
  static _drawInteractiveAction(action, actionLogs, put, blank, opts) {
673
- const fullActionLogs = [...actionLogs];
677
+ const fullActionLogs = [...actionLogs.map((str) => ` ${str}`)];
674
678
  if (action?.outputtedVariables.length) {
675
679
  if (actionLogs.length > 0)
676
680
  fullActionLogs.push('');
677
- fullActionLogs.push('Output Variables');
678
- action.outputtedVariables.forEach((v) => {
679
- fullActionLogs.push(`${v.key}="${v.value}"`);
681
+ fullActionLogs.push(this._runOutputHeader());
682
+ action.outputtedVariables.forEach((v, i) => {
683
+ let line = ' ';
684
+ if (i <= 0)
685
+ line += 'Variables ';
686
+ else
687
+ line += ' ';
688
+ line += output_1.default.getTermKitMutedColor(v.key);
689
+ line += ' = "';
690
+ line += output_1.default.getTermKitBlueColor(v.value);
691
+ line += '"';
692
+ fullActionLogs.push(line);
680
693
  });
681
694
  }
682
695
  const tabs = 25;
@@ -1092,7 +1105,7 @@ class OutputPipeline {
1092
1105
  }
1093
1106
  if (drawnStart && logs && !logsEnd) {
1094
1107
  for (; actionLogsStart < logs.length; actionLogsStart += 1) {
1095
- output_1.default.normal(` ${logs[actionLogsStart]}`);
1108
+ output_1.default.normal(output_1.default.getTermKitDimColor(` ${logs[actionLogsStart]}`));
1096
1109
  }
1097
1110
  if (action &&
1098
1111
  [
@@ -1102,7 +1115,7 @@ class OutputPipeline {
1102
1115
  pipeline_1.PIPELINE_RUN_STATUS.SUCCESSFUL,
1103
1116
  pipeline_1.PIPELINE_RUN_STATUS.TERMINATED,
1104
1117
  ].includes(action.status) &&
1105
- actionLogsStart === lastActionLogsStart) {
1118
+ (actionLogsStart === lastActionLogsStart || logs.length < LOGS_LIMIT)) {
1106
1119
  logsEnd = true;
1107
1120
  }
1108
1121
  lastActionLogsStart = actionLogsStart;
@@ -1110,9 +1123,17 @@ class OutputPipeline {
1110
1123
  if (logsEnd || (drawnStart && noWait && logs)) {
1111
1124
  if (logsEnd && action?.outputtedVariables.length) {
1112
1125
  output_1.default.normal('');
1113
- output_1.default.normal(' Output Variables');
1114
- action.outputtedVariables.forEach((v) => {
1115
- output_1.default.normal(` ${v.key}="${v.value}"`);
1126
+ output_1.default.normal(this._runOutputHeader());
1127
+ output_1.default.normal(output_1.default.getTermKitDimColor(' Variables '), false);
1128
+ action.outputtedVariables.forEach((v, i) => {
1129
+ let line = '';
1130
+ if (i > 0)
1131
+ line += ' ';
1132
+ line += output_1.default.getTermKitMutedColor(v.key);
1133
+ line += output_1.default.getTermKitDimColor(` = "`);
1134
+ line += output_1.default.getTermKitBlueColor(v.value);
1135
+ line += output_1.default.getTermKitDimColor('"');
1136
+ output_1.default.normal(line);
1116
1137
  });
1117
1138
  }
1118
1139
  if (logsEnd && action && totalFetchesCount > 1) {
@@ -1208,14 +1229,13 @@ class OutputPipeline {
1208
1229
  static async _actionLogsLoop(client, workspace, project, pipelineId, runId, actionExecutionId, onChange) {
1209
1230
  let logs = [];
1210
1231
  let offset = 0;
1211
- const limit = 1000;
1212
1232
  let shouldCancel = false;
1213
1233
  const cancel = () => {
1214
1234
  shouldCancel = true;
1215
1235
  };
1216
1236
  onChange(logs, cancel);
1217
1237
  const fetchLogs = async () => {
1218
- return await client.getPipelineRunActionLogs(workspace, project, pipelineId, runId, actionExecutionId, offset, limit);
1238
+ return await client.getPipelineRunActionLogs(workspace, project, pipelineId, runId, actionExecutionId, offset, LOGS_LIMIT);
1219
1239
  };
1220
1240
  for (;;) {
1221
1241
  let o = await fetchLogs();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.19.2-dev-pipeline",
4
+ "version": "1.19.3-dev-pipeline",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {