@datadog/datadog-ci-plugin-terraform 5.21.2 → 5.22.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 +27 -13
- package/dist/bundle.js.map +1 -1
- package/package.json +2 -2
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.
|
|
10917
|
+
"version": "5.22.0",
|
|
10918
10918
|
"description": "Base package for Datadog CI",
|
|
10919
10919
|
"license": "Apache-2.0",
|
|
10920
10920
|
"keywords": ["datadog", "datadog-ci"],
|
|
@@ -64513,7 +64513,7 @@ var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
64513
64513
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
64514
64514
|
};
|
|
64515
64515
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64516
|
-
exports.getSpanTags = exports.getMissingRequiredGitTags = exports.REQUIRED_GIT_TAGS = exports.parseMeasuresFile = exports.parseTagsFile = exports.parseMetrics = exports.parseTags = exports.SERVICE = exports.SERVERLESS_CLI_VERSION_TAG_VALUE = exports.SERVERLESS_CLI_VERSION_TAG_NAME = exports.SBOM_TOOL_GENERATOR_VERSION = exports.SBOM_TOOL_GENERATOR_NAME = exports.PR_NUMBER = exports.GIT_PULL_REQUEST_BASE_BRANCH = exports.GIT_PULL_REQUEST_BASE_BRANCH_HEAD_SHA = exports.GIT_PULL_REQUEST_BASE_BRANCH_SHA = exports.GIT_HEAD_SHA = exports.GIT_TAG = exports.GIT_SHA = exports.GIT_COMMIT_MESSAGE = exports.GIT_COMMIT_COMMITTER_NAME = exports.GIT_COMMIT_COMMITTER_EMAIL = exports.GIT_COMMIT_COMMITTER_DATE = exports.GIT_COMMIT_AUTHOR_NAME = exports.GIT_COMMIT_AUTHOR_EMAIL = exports.GIT_COMMIT_AUTHOR_DATE = exports.GIT_BRANCH = exports.CI_ENV_VARS = exports.CI_NODE_LABELS = exports.CI_NODE_NAME = exports.CI_STAGE_NAME = exports.CI_JOB_ID = exports.CI_JOB_NAME = exports.CI_JOB_URL = exports.GIT_REPOSITORY_URL = exports.CI_WORKSPACE_PATH = exports.CI_PIPELINE_NUMBER = exports.CI_PIPELINE_NAME = exports.CI_PIPELINE_ID = exports.CI_PROVIDER_NAME = exports.CI_PIPELINE_URL = void 0;
|
|
64516
|
+
exports.getSpanTags = exports.getMissingRequiredGitTags = exports.REQUIRED_GIT_TAGS = exports.parseMeasuresFile = exports.parseTagsFile = exports.parseMetrics = exports.parseTags = exports.SERVICE = exports.SERVERLESS_CLI_VERSION_TAG_VALUE = exports.SERVERLESS_CLI_VERSION_TAG_NAME = exports.SBOM_TOOL_GENERATOR_VERSION = exports.SBOM_TOOL_GENERATOR_NAME = exports.PR_NUMBER = exports.GIT_PULL_REQUEST_BASE_BRANCH = exports.GIT_PULL_REQUEST_BASE_BRANCH_HEAD_SHA = exports.GIT_PULL_REQUEST_BASE_BRANCH_SHA = exports.GIT_HEAD_SHA = exports.GIT_TAG = exports.GIT_SHA = exports.GIT_COMMIT_MESSAGE = exports.GIT_COMMIT_COMMITTER_NAME = exports.GIT_COMMIT_COMMITTER_EMAIL = exports.GIT_COMMIT_COMMITTER_DATE = exports.GIT_COMMIT_AUTHOR_NAME = exports.GIT_COMMIT_AUTHOR_EMAIL = exports.GIT_COMMIT_AUTHOR_DATE = exports.GIT_BRANCH = exports.CI_ENV_VARS = exports.CI_NODE_LABELS = exports.CI_NODE_NAME = exports.CI_STAGE_NAME = exports.CI_JOB_ID = exports.CI_JOB_NAME = exports.CI_JOB_URL = exports.GIT_REPOSITORY_URL = exports.CI_WORKSPACE_PATH = exports.CI_PIPELINE_NUMBER = exports.CI_PIPELINE_DISPLAY_NAME = exports.CI_PIPELINE_NAME = exports.CI_PIPELINE_ID = exports.CI_PROVIDER_NAME = exports.CI_PIPELINE_URL = void 0;
|
|
64517
64517
|
const fs_1$3 = __importDefault(require("fs"));
|
|
64518
64518
|
const chalk_1 = __importDefault(require_source());
|
|
64519
64519
|
const upath_1 = __importDefault(require_upath());
|
|
@@ -64526,6 +64526,7 @@ var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
64526
64526
|
exports.CI_PROVIDER_NAME = "ci.provider.name";
|
|
64527
64527
|
exports.CI_PIPELINE_ID = "ci.pipeline.id";
|
|
64528
64528
|
exports.CI_PIPELINE_NAME = "ci.pipeline.name";
|
|
64529
|
+
exports.CI_PIPELINE_DISPLAY_NAME = "ci.pipeline.display_name";
|
|
64529
64530
|
exports.CI_PIPELINE_NUMBER = "ci.pipeline.number";
|
|
64530
64531
|
exports.CI_WORKSPACE_PATH = "ci.workspace_path";
|
|
64531
64532
|
exports.GIT_REPOSITORY_URL = "git.repository_url";
|
|
@@ -65097,7 +65098,7 @@ var require_ci = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
65097
65098
|
}
|
|
65098
65099
|
}
|
|
65099
65100
|
if (env.BUILDKITE) {
|
|
65100
|
-
const { BUILDKITE_AGENT_ID, BUILDKITE_BRANCH, BUILDKITE_COMMIT, BUILDKITE_REPO, BUILDKITE_TAG, BUILDKITE_BUILD_ID, BUILDKITE_PIPELINE_SLUG, BUILDKITE_BUILD_NUMBER, BUILDKITE_BUILD_URL, BUILDKITE_JOB_ID, BUILDKITE_BUILD_CHECKOUT_PATH, BUILDKITE_BUILD_AUTHOR, BUILDKITE_BUILD_AUTHOR_EMAIL, BUILDKITE_MESSAGE, BUILDKITE_PULL_REQUEST, BUILDKITE_PULL_REQUEST_BASE_BRANCH } = env;
|
|
65101
|
+
const { BUILDKITE_AGENT_ID, BUILDKITE_BRANCH, BUILDKITE_COMMIT, BUILDKITE_REPO, BUILDKITE_TAG, BUILDKITE_BUILD_ID, BUILDKITE_PIPELINE_SLUG, BUILDKITE_PIPELINE_NAME, BUILDKITE_BUILD_NUMBER, BUILDKITE_BUILD_URL, BUILDKITE_JOB_ID, BUILDKITE_BUILD_CHECKOUT_PATH, BUILDKITE_BUILD_AUTHOR, BUILDKITE_BUILD_AUTHOR_EMAIL, BUILDKITE_MESSAGE, BUILDKITE_PULL_REQUEST, BUILDKITE_PULL_REQUEST_BASE_BRANCH } = env;
|
|
65101
65102
|
const extraTags = Object.keys(env).filter((envVar) => envVar.startsWith("BUILDKITE_AGENT_META_DATA_")).map((metadataKey) => {
|
|
65102
65103
|
return `${metadataKey.replace("BUILDKITE_AGENT_META_DATA_", "").toLowerCase()}:${env[metadataKey]}`;
|
|
65103
65104
|
});
|
|
@@ -65106,6 +65107,7 @@ var require_ci = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
65106
65107
|
[tags_1.CI_PROVIDER_NAME]: exports.CI_ENGINES.BUILDKITE,
|
|
65107
65108
|
[tags_1.CI_PIPELINE_ID]: BUILDKITE_BUILD_ID,
|
|
65108
65109
|
[tags_1.CI_PIPELINE_NAME]: BUILDKITE_PIPELINE_SLUG,
|
|
65110
|
+
[tags_1.CI_PIPELINE_DISPLAY_NAME]: BUILDKITE_PIPELINE_NAME,
|
|
65109
65111
|
[tags_1.CI_PIPELINE_NUMBER]: BUILDKITE_BUILD_NUMBER,
|
|
65110
65112
|
[tags_1.CI_PIPELINE_URL]: BUILDKITE_BUILD_URL,
|
|
65111
65113
|
[tags_1.CI_JOB_URL]: `${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}`,
|
|
@@ -76347,6 +76349,7 @@ var require_gitdb = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
76347
76349
|
const semver_1 = require_semver();
|
|
76348
76350
|
const upath_1 = __importDefault(require_upath());
|
|
76349
76351
|
const get_git_data_1 = require_get_git_data();
|
|
76352
|
+
const request_1 = require_request();
|
|
76350
76353
|
const datadog_route_1 = require_datadog_route();
|
|
76351
76354
|
const retry_1 = require_retry();
|
|
76352
76355
|
const API_TIMEOUT = 15e3;
|
|
@@ -76354,6 +76357,12 @@ var require_gitdb = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
76354
76357
|
maxCommits: 1e3,
|
|
76355
76358
|
oldestCommits: "1 month ago"
|
|
76356
76359
|
};
|
|
76360
|
+
const formatResponseData = (data) => typeof data === "string" ? data : JSON.stringify(data);
|
|
76361
|
+
const formatRequestError = (reqName, error) => {
|
|
76362
|
+
if (!(0, request_1.isRequestError)(error)) return `${reqName} request failed: ${String(error)}`;
|
|
76363
|
+
if (!error.response) return `${reqName} request failed: ${error.message}`;
|
|
76364
|
+
return `${reqName} request failed (status ${[error.response.status, error.response.statusText].filter(Boolean).join(" ")}): ${formatResponseData(error.response.data)}`;
|
|
76365
|
+
};
|
|
76357
76366
|
const getCommitsToInclude = (log, request, git, repositoryURL) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76358
76367
|
let latestCommits;
|
|
76359
76368
|
try {
|
|
@@ -76508,7 +76517,10 @@ var require_gitdb = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
76508
76517
|
timeout: API_TIMEOUT
|
|
76509
76518
|
}));
|
|
76510
76519
|
const commits = response.data;
|
|
76511
|
-
if (!commits || commits.data === void 0)
|
|
76520
|
+
if (!commits || commits.data === void 0) {
|
|
76521
|
+
const status = [response.status, response.statusText].filter(Boolean).join(" ");
|
|
76522
|
+
throw new Error(`Invalid API response from search_commits (status ${status}): ${formatResponseData(response.data)}`);
|
|
76523
|
+
}
|
|
76512
76524
|
return commits.data.map((c) => {
|
|
76513
76525
|
if (c.type !== "commit" || c.id === void 0) throw new Error("Invalid commit type response");
|
|
76514
76526
|
return validateCommit(c.id);
|
|
@@ -76587,15 +76599,17 @@ var require_gitdb = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
76587
76599
|
});
|
|
76588
76600
|
exports.uploadPackfile = uploadPackfile;
|
|
76589
76601
|
const runRequest = (log, reqName, request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76590
|
-
|
|
76591
|
-
|
|
76592
|
-
|
|
76593
|
-
|
|
76594
|
-
|
|
76595
|
-
|
|
76596
|
-
|
|
76597
|
-
|
|
76598
|
-
|
|
76602
|
+
try {
|
|
76603
|
+
return yield (0, retry_1.retryRequest)(request, {
|
|
76604
|
+
retries: 2,
|
|
76605
|
+
onRetry: (error, attempt) => {
|
|
76606
|
+
log.warn(`[attempt ${attempt}] ${formatRequestError(reqName, error)}; retrying`);
|
|
76607
|
+
}
|
|
76608
|
+
});
|
|
76609
|
+
} catch (error) {
|
|
76610
|
+
if ((0, request_1.isRequestError)(error)) error.message = formatRequestError(reqName, error);
|
|
76611
|
+
throw error;
|
|
76612
|
+
}
|
|
76599
76613
|
});
|
|
76600
76614
|
}));
|
|
76601
76615
|
//#endregion
|