@datadog/datadog-ci-plugin-terraform 5.16.1 → 5.18.0

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/dist/bundle.js CHANGED
@@ -10914,7 +10914,7 @@ var require_glob = /* @__PURE__ */ __commonJSMin(((exports) => {
10914
10914
  var require_package$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10915
10915
  module.exports = {
10916
10916
  "name": "@datadog/datadog-ci-base",
10917
- "version": "5.16.1",
10917
+ "version": "5.18.0",
10918
10918
  "description": "Base package for Datadog CI",
10919
10919
  "license": "Apache-2.0",
10920
10920
  "keywords": ["datadog", "datadog-ci"],
@@ -11009,7 +11009,7 @@ var require_package$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11009
11009
  "datadog-metrics": "^0.9.3",
11010
11010
  "debug": "^4.4.1",
11011
11011
  "deep-extend": "^0.6.0",
11012
- "fast-xml-parser": "^5.5.12",
11012
+ "fast-xml-parser": "^5.7.2",
11013
11013
  "form-data": "^4.0.4",
11014
11014
  "glob": "^13.0.6",
11015
11015
  "inquirer": "^8.2.7",
@@ -65562,8 +65562,8 @@ var require_git = /* @__PURE__ */ __commonJSMin(((exports) => {
65562
65562
  };
65563
65563
  });
65564
65564
  exports.getGitDiff = getGitDiff;
65565
- const getGitFileHash = (git, path) => __awaiter(void 0, void 0, void 0, function* () {
65566
- return git.revparse([`HEAD:${path}`]);
65565
+ const getGitFileHash = (git, path, ref = "HEAD") => __awaiter(void 0, void 0, void 0, function* () {
65566
+ return git.revparse([`${ref}:${path}`]);
65567
65567
  });
65568
65568
  exports.getGitFileHash = getGitFileHash;
65569
65569
  const diffHeaderRegex = /^diff --git a\/.+ b\/(.+)$/;
@@ -75542,8 +75542,6 @@ var require_datadog_route = /* @__PURE__ */ __commonJSMin(((exports) => {
75542
75542
  exports.DATADOG_ROUTE_PATHS = [
75543
75543
  "/api/intake/ci/custom_spans",
75544
75544
  "/api/ui/support/serverless/flare",
75545
- "/api/unstable/deployments/gates/evaluation",
75546
- "/api/unstable/deployments/gates/evaluation/:evaluationId",
75547
75545
  "/api/v1/validate",
75548
75546
  "/api/v2/ci/deployments/correlate-image",
75549
75547
  "/api/v2/ci/deployments/correlate",
@@ -75553,6 +75551,8 @@ var require_datadog_route = /* @__PURE__ */ __commonJSMin(((exports) => {
75553
75551
  "/api/v2/cicovreprt",
75554
75552
  "/api/v2/ciiac",
75555
75553
  "/api/v2/cireport",
75554
+ "/api/v2/deployments/gates/evaluation",
75555
+ "/api/v2/deployments/gates/evaluation/:evaluationId",
75556
75556
  "/api/v2/dora/deployment",
75557
75557
  "/api/v2/git/repository/packfile",
75558
75558
  "/api/v2/git/repository/search_commits",
@@ -76529,6 +76529,7 @@ var require_is_standalone_binary = /* @__PURE__ */ __commonJSMin(((exports) => {
76529
76529
  const { isSea } = yield import("node:sea");
76530
76530
  return isSea();
76531
76531
  } catch (_a) {
76532
+ if (process.pkg !== void 0) return true;
76532
76533
  return false;
76533
76534
  }
76534
76535
  });
@@ -77423,7 +77424,7 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
77423
77424
  return mod && mod.__esModule ? mod : { "default": mod };
77424
77425
  };
77425
77426
  Object.defineProperty(exports, "__esModule", { value: true });
77426
- exports.getTempPath = exports.VERSION_OVERRIDE_REGEX = exports.scopeToPackageName = exports.importInstallPkg = exports.installPlugin = exports.checkPlugin = exports.listAllPlugins = exports.executePluginCommand = void 0;
77427
+ exports.getTempPath = exports.VERSION_OVERRIDE_REGEX = exports.scopeToPackageName = exports.importInstallPkg = exports.installPlugin = exports.checkPlugin = exports.listAllPlugins = exports.normalizePluginSubmodule = exports.executePluginCommand = void 0;
77427
77428
  const node_child_process_1 = require("node:child_process");
77428
77429
  const node_path_1 = __importDefault(require("node:path"));
77429
77430
  const node_url_1 = __importDefault(require("node:url"));
@@ -77464,6 +77465,15 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
77464
77465
  }
77465
77466
  });
77466
77467
  exports.executePluginCommand = executePluginCommand;
77468
+ const normalizePluginSubmodule = (submodule) => {
77469
+ if (isPluginSubmodule(submodule)) return submodule;
77470
+ if (typeof submodule === "object" && submodule && "default" in submodule) {
77471
+ const defaultExport = submodule.default;
77472
+ if (isPluginSubmodule(defaultExport)) return defaultExport;
77473
+ }
77474
+ return submodule;
77475
+ };
77476
+ exports.normalizePluginSubmodule = normalizePluginSubmodule;
77467
77477
  const listAllPlugins = () => {
77468
77478
  return Object.keys(package_json_1.peerDependencies);
77469
77479
  };
@@ -77626,6 +77636,21 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
77626
77636
  }
77627
77637
  patchModulePaths();
77628
77638
  yield handlePluginAutoInstall(scope);
77639
+ const submoduleName = `@datadog/datadog-ci-plugin-${scope}/commands/${command}`;
77640
+ debug("Resolving submodule:", submoduleName);
77641
+ let submoduleResolveError;
77642
+ let resolvedSubmodulePath;
77643
+ try {
77644
+ resolvedSubmodulePath = require.resolve(submoduleName);
77645
+ } catch (error) {
77646
+ debug(`Could not require.resolve() the ${submoduleName} submodule: ${error}`);
77647
+ submoduleResolveError = error;
77648
+ }
77649
+ if (resolvedSubmodulePath) {
77650
+ const submodulePath = node_url_1.default.pathToFileURL(resolvedSubmodulePath).href;
77651
+ debug("Importing submodule:", submodulePath);
77652
+ return (0, exports.normalizePluginSubmodule)(yield import(submodulePath));
77653
+ }
77629
77654
  const pluginPackage = `@datadog/datadog-ci-plugin-${scope}`;
77630
77655
  try {
77631
77656
  const submodule = (_b = require(pluginPackage).commands) === null || _b === void 0 ? void 0 : _b[command];
@@ -77634,19 +77659,9 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
77634
77659
  return submodule;
77635
77660
  }
77636
77661
  } catch (error) {
77637
- debug("Plugin bundle load failed, trying submodule path:", error);
77638
- }
77639
- const submoduleName = `@datadog/datadog-ci-plugin-${scope}/commands/${command}`;
77640
- debug("Resolving submodule:", submoduleName);
77641
- let submodulePath = submoduleName;
77642
- try {
77643
- const resolvedPath = require.resolve(submoduleName);
77644
- submodulePath = node_url_1.default.pathToFileURL(resolvedPath).href;
77645
- } catch (error) {
77646
- debug(`Could not require.resolve() the ${submoduleName} submodule: ${error}`);
77662
+ debug("Plugin bundle load failed:", error);
77647
77663
  }
77648
- debug("Importing submodule:", submodulePath);
77649
- return yield import(submodulePath);
77664
+ throw submoduleResolveError;
77650
77665
  });
77651
77666
  const scopeToPackageName = (scope) => {
77652
77667
  if (scope.match(/^@datadog\/datadog-ci-plugin-[a-z-]+$/)) return scope;
@@ -77666,6 +77681,9 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
77666
77681
  const isValidScope = (scope) => {
77667
77682
  return (0, exports.scopeToPackageName)(scope) in package_json_1.peerDependencies;
77668
77683
  };
77684
+ const isPluginSubmodule = (submodule) => {
77685
+ return typeof submodule === "object" && !!submodule && "PluginCommand" in submodule && typeof submodule.PluginCommand === "function";
77686
+ };
77669
77687
  /**
77670
77688
  * @example "1.2.3"
77671
77689
  * @example "file:./artifacts/@datadog-datadog-ci-base-20.tgz"