@firestartr/cli 1.55.1-snapshot-4 → 1.56.0-snapshot-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.
package/build/index.js CHANGED
@@ -371904,19 +371904,23 @@ if (process.env.RUN_PROVISIONER) {
371904
371904
 
371905
371905
 
371906
371906
  const LAST_STATE_PR_ANNOTATION = 'firestartr.dev/last-state-pr';
371907
- async function tryPublishApply(item, planOutput, kind, isSuccess = true) {
371907
+ async function tryPublishApply(item, planOutput, isSuccess = true) {
371908
+ const kind = item.kind;
371909
+ const metadataName = item.metadata?.name ?? 'unknown';
371908
371910
  try {
371909
- if (!(LAST_STATE_PR_ANNOTATION in item.metadata.annotations)) {
371910
- operator_src_logger.debug(`The user feedback for the '${kind}/${item.metadata.name}' apply operation could not be published because the last state was not found.`);
371911
+ const annotations = item.metadata?.annotations;
371912
+ if (!annotations || !(LAST_STATE_PR_ANNOTATION in annotations)) {
371913
+ operator_src_logger.debug(`The user feedback for the '${kind}/${metadataName}' apply operation could not be published because the last state was not found.`);
371911
371914
  return;
371912
371915
  }
371913
- await publishApply(item, planOutput, kind, isSuccess);
371916
+ await publishApply(item, planOutput, isSuccess);
371914
371917
  }
371915
371918
  catch (e) {
371916
- operator_src_logger.error(`The user feedback for the '${kind}/${item.metadata.name}' apply operation failed to publish due to an error: '${e}'.`);
371919
+ operator_src_logger.error(`The user feedback for the '${kind}/${metadataName}' apply operation failed to publish due to an error: '${e}'.`);
371917
371920
  }
371918
371921
  }
371919
371922
  async function tryPublishDestroy(item, destroyOutput, isSuccess = true) {
371923
+ const kind = item.kind;
371920
371924
  let lastPr = null;
371921
371925
  try {
371922
371926
  const { repo, org } = extractPrInfo(item);
@@ -371943,7 +371947,7 @@ async function tryPublishDestroy(item, destroyOutput, isSuccess = true) {
371943
371947
  return `<h1>
371944
371948
  <img width="25" src="https://raw.githubusercontent.com/firestartr-pro/docs/refs/heads/main/logos/square-nobg.png"> Destroy ${statusText} ${statusEmoji}
371945
371949
  </h1>
371946
- <p><b>TFWorkspace: </b>${item.metadata.name}</p>
371950
+ <p><b>${kind}: </b>${item.metadata.name}</p>
371947
371951
 
371948
371952
  <details id=github>
371949
371953
  <summary>DESTROY LOGS${partIndicator}</summary>
@@ -371960,7 +371964,7 @@ ${commentContent}
371960
371964
  owner: org,
371961
371965
  repo,
371962
371966
  pullNumber: lastPr.number,
371963
- baseKind: 'tfworkspace:destroy',
371967
+ baseKind: `${kind.toLowerCase()}:destroy`,
371964
371968
  bodies: commentBodies,
371965
371969
  });
371966
371970
  operator_src_logger.debug(`The user feedback for the '${item.kind}/${item.metadata.name}' destroy operation has been published as a comment on pull request '${lastPr.number}'.`);
@@ -371969,7 +371973,8 @@ ${commentContent}
371969
371973
  operator_src_logger.error(`An error occurred while publishing user feedback for item '${item.kind}/${item.metadata.name}': '${e}'.`);
371970
371974
  }
371971
371975
  }
371972
- async function publishApply(item, applyOutput, kind, isSuccess = true) {
371976
+ async function publishApply(item, applyOutput, isSuccess = true) {
371977
+ const kind = item.kind;
371973
371978
  const { prNumber, repo, org } = extractPrInfo(item);
371974
371979
  const dividedOutput = github_0.pulls.divideCommentIntoChunks(applyOutput, 250);
371975
371980
  const statusEmoji = isSuccess ? '✅' : '❌';
@@ -372465,7 +372470,7 @@ async function* doApply(item, op, handler) {
372465
372470
  message: 'doApply',
372466
372471
  };
372467
372472
  await handler.writeTerraformOutputInTfResult(item, output);
372468
- await tryPublishApply(item, applyOutput?.data?.output, item.kind, true);
372473
+ await tryPublishApply(item, applyOutput?.data?.output, true);
372469
372474
  void handler.success();
372470
372475
  }
372471
372476
  catch (e) {
@@ -372477,7 +372482,7 @@ async function* doApply(item, op, handler) {
372477
372482
  else {
372478
372483
  errorMsg = e;
372479
372484
  }
372480
- await tryPublishApply(item, errorMsg, item.kind);
372485
+ await tryPublishApply(item, errorMsg, false);
372481
372486
  // if there is a current checkRun working
372482
372487
  // we close it with an error
372483
372488
  if (checkRunCtl)
@@ -374200,7 +374205,7 @@ async function* process_operation_doApply(item, op, handler) {
374200
374205
  message: 'doApply',
374201
374206
  };
374202
374207
  await handler.writeTerraformOutputInTfResult(item, output);
374203
- await tryPublishApply(item, applyOutput, 'TFWorkspace', true);
374208
+ await tryPublishApply(item, applyOutput, true);
374204
374209
  handler.success();
374205
374210
  }
374206
374211
  catch (e) {
@@ -374214,7 +374219,7 @@ async function* process_operation_doApply(item, op, handler) {
374214
374219
  }
374215
374220
  checkRunCtl.fnOnError(errorMsg);
374216
374221
  console.error(e);
374217
- await tryPublishApply(item, errorMsg, 'TFWorkspace', false);
374222
+ await tryPublishApply(item, errorMsg, false);
374218
374223
  operator_src_logger.error(`The Terraform processor encountered an error during operation '${op}' for item '${item.kind}/${item.metadata.name}': '${e}'.`);
374219
374224
  handler.error();
374220
374225
  if (errorMsg) {
@@ -376320,9 +376325,9 @@ const crs_analyzerSubcommand = {
376320
376325
  };
376321
376326
 
376322
376327
  ;// CONCATENATED MODULE: ./package.json
376323
- const package_namespaceObject = JSON.parse('{"i8":"1.55.1-snapshot-4"}');
376328
+ const package_namespaceObject = JSON.parse('{"i8":"1.56.0-snapshot-1"}');
376324
376329
  ;// CONCATENATED MODULE: ../../package.json
376325
- const package_namespaceObject_1 = {"i8":"1.55.0"};
376330
+ const package_namespaceObject_1 = {"i8":"1.56.0"};
376326
376331
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
376327
376332
 
376328
376333
 
@@ -1,6 +1,6 @@
1
- export declare function tryPublishApply(item: any, planOutput: string, kind: string, isSuccess?: boolean): Promise<void>;
1
+ export declare function tryPublishApply(item: any, planOutput: string, isSuccess?: boolean): Promise<void>;
2
2
  export declare function tryPublishDestroy(item: any, destroyOutput: string, isSuccess?: boolean): Promise<void>;
3
- export declare function publishApply(item: any, applyOutput: string, kind: string, isSuccess?: boolean): Promise<void>;
3
+ export declare function publishApply(item: any, applyOutput: string, isSuccess?: boolean): Promise<void>;
4
4
  export declare function tryCreateErrorSummary(title: string, errorMsg: string): string;
5
5
  export declare function extractPrInfo(item: any, annotation?: 'firestartr.dev/last-state-pr' | 'firestartr.dev/pull-request-plan'): {
6
6
  prNumber: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.55.1-snapshot-4",
3
+ "version": "1.56.0-snapshot-1",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",