@datadog/datadog-ci-plugin-synthetics 5.17.0 → 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
@@ -5761,7 +5761,7 @@ var require_glob = /* @__PURE__ */ __commonJSMin(((exports) => {
5761
5761
  var require_package$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5762
5762
  module.exports = {
5763
5763
  "name": "@datadog/datadog-ci-base",
5764
- "version": "5.17.0",
5764
+ "version": "5.18.0",
5765
5765
  "description": "Base package for Datadog CI",
5766
5766
  "license": "Apache-2.0",
5767
5767
  "keywords": ["datadog", "datadog-ci"],
@@ -65363,8 +65363,6 @@ var require_datadog_route = /* @__PURE__ */ __commonJSMin(((exports) => {
65363
65363
  exports.DATADOG_ROUTE_PATHS = [
65364
65364
  "/api/intake/ci/custom_spans",
65365
65365
  "/api/ui/support/serverless/flare",
65366
- "/api/unstable/deployments/gates/evaluation",
65367
- "/api/unstable/deployments/gates/evaluation/:evaluationId",
65368
65366
  "/api/v1/validate",
65369
65367
  "/api/v2/ci/deployments/correlate-image",
65370
65368
  "/api/v2/ci/deployments/correlate",
@@ -65374,6 +65372,8 @@ var require_datadog_route = /* @__PURE__ */ __commonJSMin(((exports) => {
65374
65372
  "/api/v2/cicovreprt",
65375
65373
  "/api/v2/ciiac",
65376
65374
  "/api/v2/cireport",
65375
+ "/api/v2/deployments/gates/evaluation",
65376
+ "/api/v2/deployments/gates/evaluation/:evaluationId",
65377
65377
  "/api/v2/dora/deployment",
65378
65378
  "/api/v2/git/repository/packfile",
65379
65379
  "/api/v2/git/repository/search_commits",
@@ -137482,6 +137482,7 @@ var require_is_standalone_binary = /* @__PURE__ */ __commonJSMin(((exports) => {
137482
137482
  const { isSea } = yield import("node:sea");
137483
137483
  return isSea();
137484
137484
  } catch (_a) {
137485
+ if (process.pkg !== void 0) return true;
137485
137486
  return false;
137486
137487
  }
137487
137488
  });
@@ -138376,7 +138377,7 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
138376
138377
  return mod && mod.__esModule ? mod : { "default": mod };
138377
138378
  };
138378
138379
  Object.defineProperty(exports, "__esModule", { value: true });
138379
- exports.getTempPath = exports.VERSION_OVERRIDE_REGEX = exports.scopeToPackageName = exports.importInstallPkg = exports.installPlugin = exports.checkPlugin = exports.listAllPlugins = exports.executePluginCommand = void 0;
138380
+ exports.getTempPath = exports.VERSION_OVERRIDE_REGEX = exports.scopeToPackageName = exports.importInstallPkg = exports.installPlugin = exports.checkPlugin = exports.listAllPlugins = exports.normalizePluginSubmodule = exports.executePluginCommand = void 0;
138380
138381
  const node_child_process_1 = require("node:child_process");
138381
138382
  const node_path_1 = __importDefault(require("node:path"));
138382
138383
  const node_url_1 = __importDefault(require("node:url"));
@@ -138417,6 +138418,15 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
138417
138418
  }
138418
138419
  });
138419
138420
  exports.executePluginCommand = executePluginCommand;
138421
+ const normalizePluginSubmodule = (submodule) => {
138422
+ if (isPluginSubmodule(submodule)) return submodule;
138423
+ if (typeof submodule === "object" && submodule && "default" in submodule) {
138424
+ const defaultExport = submodule.default;
138425
+ if (isPluginSubmodule(defaultExport)) return defaultExport;
138426
+ }
138427
+ return submodule;
138428
+ };
138429
+ exports.normalizePluginSubmodule = normalizePluginSubmodule;
138420
138430
  const listAllPlugins = () => {
138421
138431
  return Object.keys(package_json_1.peerDependencies);
138422
138432
  };
@@ -138579,6 +138589,21 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
138579
138589
  }
138580
138590
  patchModulePaths();
138581
138591
  yield handlePluginAutoInstall(scope);
138592
+ const submoduleName = `@datadog/datadog-ci-plugin-${scope}/commands/${command}`;
138593
+ debug("Resolving submodule:", submoduleName);
138594
+ let submoduleResolveError;
138595
+ let resolvedSubmodulePath;
138596
+ try {
138597
+ resolvedSubmodulePath = require.resolve(submoduleName);
138598
+ } catch (error) {
138599
+ debug(`Could not require.resolve() the ${submoduleName} submodule: ${error}`);
138600
+ submoduleResolveError = error;
138601
+ }
138602
+ if (resolvedSubmodulePath) {
138603
+ const submodulePath = node_url_1.default.pathToFileURL(resolvedSubmodulePath).href;
138604
+ debug("Importing submodule:", submodulePath);
138605
+ return (0, exports.normalizePluginSubmodule)(yield import(submodulePath));
138606
+ }
138582
138607
  const pluginPackage = `@datadog/datadog-ci-plugin-${scope}`;
138583
138608
  try {
138584
138609
  const submodule = (_b = require(pluginPackage).commands) === null || _b === void 0 ? void 0 : _b[command];
@@ -138587,19 +138612,9 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
138587
138612
  return submodule;
138588
138613
  }
138589
138614
  } catch (error) {
138590
- debug("Plugin bundle load failed, trying submodule path:", error);
138591
- }
138592
- const submoduleName = `@datadog/datadog-ci-plugin-${scope}/commands/${command}`;
138593
- debug("Resolving submodule:", submoduleName);
138594
- let submodulePath = submoduleName;
138595
- try {
138596
- const resolvedPath = require.resolve(submoduleName);
138597
- submodulePath = node_url_1.default.pathToFileURL(resolvedPath).href;
138598
- } catch (error) {
138599
- debug(`Could not require.resolve() the ${submoduleName} submodule: ${error}`);
138615
+ debug("Plugin bundle load failed:", error);
138600
138616
  }
138601
- debug("Importing submodule:", submodulePath);
138602
- return yield import(submodulePath);
138617
+ throw submoduleResolveError;
138603
138618
  });
138604
138619
  const scopeToPackageName = (scope) => {
138605
138620
  if (scope.match(/^@datadog\/datadog-ci-plugin-[a-z-]+$/)) return scope;
@@ -138619,6 +138634,9 @@ var require_plugin = /* @__PURE__ */ __commonJSMin(((exports) => {
138619
138634
  const isValidScope = (scope) => {
138620
138635
  return (0, exports.scopeToPackageName)(scope) in package_json_1.peerDependencies;
138621
138636
  };
138637
+ const isPluginSubmodule = (submodule) => {
138638
+ return typeof submodule === "object" && !!submodule && "PluginCommand" in submodule && typeof submodule.PluginCommand === "function";
138639
+ };
138622
138640
  /**
138623
138641
  * @example "1.2.3"
138624
138642
  * @example "file:./artifacts/@datadog-datadog-ci-base-20.tgz"