@datadog/datadog-ci 5.2.0 → 5.3.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/commands/cli.d.ts +0 -2
- package/dist/commands/cli.js +20 -24
- package/dist/commands/cli.js.map +1 -1
- package/package.json +10 -13
- package/dist/commands/coverage/api.d.ts +0 -8
- package/dist/commands/coverage/api.js +0 -73
- package/dist/commands/coverage/api.js.map +0 -1
- package/dist/commands/coverage/cli.d.ts +0 -2
- package/dist/commands/coverage/cli.js +0 -6
- package/dist/commands/coverage/cli.js.map +0 -1
- package/dist/commands/coverage/interfaces.d.ts +0 -23
- package/dist/commands/coverage/interfaces.js +0 -3
- package/dist/commands/coverage/interfaces.js.map +0 -1
- package/dist/commands/coverage/renderer.d.ts +0 -13
- package/dist/commands/coverage/renderer.js +0 -88
- package/dist/commands/coverage/renderer.js.map +0 -1
- package/dist/commands/coverage/upload.d.ts +0 -36
- package/dist/commands/coverage/upload.js +0 -391
- package/dist/commands/coverage/upload.js.map +0 -1
- package/dist/commands/coverage/utils.d.ts +0 -15
- package/dist/commands/coverage/utils.js +0 -240
- package/dist/commands/coverage/utils.js.map +0 -1
- package/dist/commands/junit/api.d.ts +0 -9
- package/dist/commands/junit/api.js +0 -76
- package/dist/commands/junit/api.js.map +0 -1
- package/dist/commands/junit/cli.d.ts +0 -2
- package/dist/commands/junit/cli.js +0 -6
- package/dist/commands/junit/cli.js.map +0 -1
- package/dist/commands/junit/interfaces.d.ts +0 -16
- package/dist/commands/junit/interfaces.js +0 -3
- package/dist/commands/junit/interfaces.js.map +0 -1
- package/dist/commands/junit/renderer.d.ts +0 -12
- package/dist/commands/junit/renderer.js +0 -82
- package/dist/commands/junit/renderer.js.map +0 -1
- package/dist/commands/junit/upload.d.ts +0 -37
- package/dist/commands/junit/upload.js +0 -370
- package/dist/commands/junit/upload.js.map +0 -1
- package/dist/commands/junit/utils.d.ts +0 -3
- package/dist/commands/junit/utils.js +0 -26
- package/dist/commands/junit/utils.js.map +0 -1
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.CoverageUploadCommand = void 0;
|
|
16
|
-
const os_1 = __importDefault(require("os"));
|
|
17
|
-
const datadog_ci_base_1 = require("@datadog/datadog-ci-base");
|
|
18
|
-
const git_1 = require("@datadog/datadog-ci-base/commands/git-metadata/git");
|
|
19
|
-
const gitdb_1 = require("@datadog/datadog-ci-base/commands/git-metadata/gitdb");
|
|
20
|
-
const library_1 = require("@datadog/datadog-ci-base/commands/git-metadata/library");
|
|
21
|
-
const constants_1 = require("@datadog/datadog-ci-base/constants");
|
|
22
|
-
const ci_1 = require("@datadog/datadog-ci-base/helpers/ci");
|
|
23
|
-
const env_1 = require("@datadog/datadog-ci-base/helpers/env");
|
|
24
|
-
const file_finder_1 = require("@datadog/datadog-ci-base/helpers/file-finder");
|
|
25
|
-
const fips_1 = require("@datadog/datadog-ci-base/helpers/fips");
|
|
26
|
-
const format_git_span_data_1 = require("@datadog/datadog-ci-base/helpers/git/format-git-span-data");
|
|
27
|
-
const glob_1 = require("@datadog/datadog-ci-base/helpers/glob");
|
|
28
|
-
const id_1 = __importDefault(require("@datadog/datadog-ci-base/helpers/id"));
|
|
29
|
-
const logger_1 = require("@datadog/datadog-ci-base/helpers/logger");
|
|
30
|
-
const retry_1 = require("@datadog/datadog-ci-base/helpers/retry");
|
|
31
|
-
const tags_1 = require("@datadog/datadog-ci-base/helpers/tags");
|
|
32
|
-
const user_provided_git_1 = require("@datadog/datadog-ci-base/helpers/user-provided-git");
|
|
33
|
-
const utils_1 = require("@datadog/datadog-ci-base/helpers/utils");
|
|
34
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
35
|
-
const clipanion_1 = require("clipanion");
|
|
36
|
-
const upath_1 = __importDefault(require("upath"));
|
|
37
|
-
const api_1 = require("../junit/api");
|
|
38
|
-
const api_2 = require("./api");
|
|
39
|
-
const renderer_1 = require("./renderer");
|
|
40
|
-
const utils_2 = require("./utils");
|
|
41
|
-
const TRACE_ID_HTTP_HEADER = 'x-datadog-trace-id';
|
|
42
|
-
const PARENT_ID_HTTP_HEADER = 'x-datadog-parent-id';
|
|
43
|
-
const errorCodesStopUpload = [400, 403];
|
|
44
|
-
const MAX_REPORTS_PER_REQUEST = 8; // backend supports 10 attachments, to keep the logic simple we subtract 2: for PR diff and commit diff
|
|
45
|
-
const COVERAGE_CONFIG_PATHS = ['code-coverage.datadog.yml', 'code-coverage.datadog.yaml'];
|
|
46
|
-
const CODEOWNERS_PATHS = ['.github/CODEOWNERS', 'CODEOWNERS', 'docs/CODEOWNERS'];
|
|
47
|
-
class CoverageUploadCommand extends datadog_ci_base_1.BaseCommand {
|
|
48
|
-
constructor() {
|
|
49
|
-
var _a, _b;
|
|
50
|
-
super(...arguments);
|
|
51
|
-
this.reportPaths = clipanion_1.Option.Rest({ required: 1 });
|
|
52
|
-
this.verbose = clipanion_1.Option.Boolean('--verbose', false);
|
|
53
|
-
this.dryRun = clipanion_1.Option.Boolean('--dry-run', false);
|
|
54
|
-
this.measures = clipanion_1.Option.Array('--measures');
|
|
55
|
-
this.tags = clipanion_1.Option.Array('--tags');
|
|
56
|
-
this.format = clipanion_1.Option.String('--format');
|
|
57
|
-
this.uploadGitDiff = clipanion_1.Option.Boolean('--upload-git-diff', true);
|
|
58
|
-
this.skipGitMetadataUpload = clipanion_1.Option.Boolean('--skip-git-metadata-upload', false);
|
|
59
|
-
this.gitRepositoryURL = clipanion_1.Option.String('--git-repository-url');
|
|
60
|
-
this.basePath = clipanion_1.Option.String('--base-path');
|
|
61
|
-
this.ignoredPaths = clipanion_1.Option.String('--ignored-paths');
|
|
62
|
-
this.fips = clipanion_1.Option.Boolean('--fips', false);
|
|
63
|
-
this.fipsIgnoreError = clipanion_1.Option.Boolean('--fips-ignore-error', false);
|
|
64
|
-
this.config = {
|
|
65
|
-
apiKey: process.env.DATADOG_API_KEY || process.env.DD_API_KEY,
|
|
66
|
-
env: process.env.DD_ENV,
|
|
67
|
-
envVarTags: process.env.DD_TAGS,
|
|
68
|
-
envVarMeasures: process.env.DD_MEASURES,
|
|
69
|
-
fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
|
|
70
|
-
fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
|
|
71
|
-
};
|
|
72
|
-
this.logger = new logger_1.Logger((s) => this.context.stdout.write(s), logger_1.LogLevel.INFO);
|
|
73
|
-
this.git = undefined;
|
|
74
|
-
}
|
|
75
|
-
execute() {
|
|
76
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
(0, fips_1.enableFips)(this.fips || this.config.fips, this.fipsIgnoreError || this.config.fipsIgnoreError);
|
|
78
|
-
this.logger.setLogLevel(this.verbose ? logger_1.LogLevel.DEBUG : logger_1.LogLevel.INFO);
|
|
79
|
-
this.logger.setShouldIncludeTime(this.verbose);
|
|
80
|
-
if (!this.reportPaths.length) {
|
|
81
|
-
this.context.stderr.write('Positional arguments must be provided\n');
|
|
82
|
-
return 1;
|
|
83
|
-
}
|
|
84
|
-
if (this.format && !(0, utils_2.isCoverageFormat)(this.format)) {
|
|
85
|
-
this.context.stderr.write(`Unsupported format: ${this.format}, supported values are [${utils_2.coverageFormats.join(', ')}]\n`);
|
|
86
|
-
return 1;
|
|
87
|
-
}
|
|
88
|
-
const isGitRepository = yield (0, library_1.isGitRepo)();
|
|
89
|
-
if (isGitRepository) {
|
|
90
|
-
this.git = yield (0, git_1.newSimpleGit)();
|
|
91
|
-
}
|
|
92
|
-
if (!this.skipGitMetadataUpload) {
|
|
93
|
-
if (isGitRepository) {
|
|
94
|
-
const traceId = (0, id_1.default)();
|
|
95
|
-
const requestBuilder = (0, utils_1.getRequestBuilder)({
|
|
96
|
-
baseUrl: api_1.apiUrl,
|
|
97
|
-
apiKey: this.config.apiKey,
|
|
98
|
-
headers: new Map([
|
|
99
|
-
[TRACE_ID_HTTP_HEADER, traceId],
|
|
100
|
-
[PARENT_ID_HTTP_HEADER, traceId],
|
|
101
|
-
]),
|
|
102
|
-
});
|
|
103
|
-
try {
|
|
104
|
-
this.logger.info(`${this.dryRun ? '[DRYRUN] ' : ''}Syncing git metadata...`);
|
|
105
|
-
let elapsed = 0;
|
|
106
|
-
if (!this.dryRun) {
|
|
107
|
-
elapsed = yield (0, utils_1.timedExecAsync)(this.uploadToGitDB.bind(this), { requestBuilder });
|
|
108
|
-
}
|
|
109
|
-
this.logger.info((0, renderer_1.renderSuccessfulGitDBSync)(this.dryRun, elapsed));
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
this.logger.info((0, renderer_1.renderFailedGitDBSync)(err));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
this.logger.info(`${this.dryRun ? '[DRYRUN] ' : ''}Not syncing git metadata (not a git repo)`);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
this.logger.debug('Not syncing git metadata (skip git upload flag detected)');
|
|
121
|
-
}
|
|
122
|
-
yield this.uploadCodeCoverageReports();
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
uploadToGitDB(opts) {
|
|
126
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
if (!this.git) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
yield (0, gitdb_1.uploadToGitDB)(this.logger, opts.requestBuilder, this.git, this.dryRun, this.gitRepositoryURL);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
uploadCodeCoverageReports() {
|
|
134
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
// Normalizing the report paths to resolve .. and .
|
|
136
|
-
this.reportPaths = this.reportPaths.map((reportPath) => upath_1.default.normalize(reportPath));
|
|
137
|
-
this.logger.info((0, renderer_1.renderCommandInfo)(this.reportPaths, this.dryRun));
|
|
138
|
-
const spanTags = yield this.getSpanTags();
|
|
139
|
-
const api = this.getApiHelper();
|
|
140
|
-
const payloads = yield this.generatePayloads(spanTags);
|
|
141
|
-
let fileCount = 0;
|
|
142
|
-
const initialTime = new Date().getTime();
|
|
143
|
-
for (const payload of payloads) {
|
|
144
|
-
fileCount += payload.paths.length;
|
|
145
|
-
yield this.uploadCodeCoverageReport(api, payload);
|
|
146
|
-
}
|
|
147
|
-
const totalTimeSeconds = (Date.now() - initialTime) / 1000;
|
|
148
|
-
this.logger.info((0, renderer_1.renderSuccessfulUpload)(this.dryRun, fileCount, totalTimeSeconds));
|
|
149
|
-
if (!this.dryRun) {
|
|
150
|
-
this.context.stdout.write((0, renderer_1.renderSuccessfulUploadCommand)(spanTags));
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
getApiHelper() {
|
|
155
|
-
if (!this.config.apiKey) {
|
|
156
|
-
this.logger.error(`Neither ${chalk_1.default.red.bold('DATADOG_API_KEY')} nor ${chalk_1.default.red.bold('DD_API_KEY')} is in your environment.`);
|
|
157
|
-
throw new Error('API key is missing');
|
|
158
|
-
}
|
|
159
|
-
return (0, api_2.apiConstructor)(api_2.intakeUrl, this.config.apiKey);
|
|
160
|
-
}
|
|
161
|
-
generatePayloads(spanTags) {
|
|
162
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
-
const customTags = this.getCustomTags();
|
|
164
|
-
const customMeasures = this.getCustomMeasures();
|
|
165
|
-
if (!!customTags['resolved']) {
|
|
166
|
-
throw new Error('"resolved" is a reserved tag name, please avoid using it in your custom tags');
|
|
167
|
-
}
|
|
168
|
-
const coverageConfig = yield this.getRepoFile(COVERAGE_CONFIG_PATHS);
|
|
169
|
-
const codeowners = yield this.getRepoFile(CODEOWNERS_PATHS);
|
|
170
|
-
const commitDiff = yield this.getCommitDiff(spanTags);
|
|
171
|
-
const prDiff = yield this.getPrDiff(spanTags);
|
|
172
|
-
const reports = this.getMatchingCoverageReportFilesByFormat();
|
|
173
|
-
let payloads = [];
|
|
174
|
-
if (Object.keys(reports).length) {
|
|
175
|
-
payloads = Object.entries(reports).flatMap(([format, paths]) => {
|
|
176
|
-
const numChunks = Math.ceil(paths.length / MAX_REPORTS_PER_REQUEST);
|
|
177
|
-
return Array.from({ length: numChunks }, (_, i) => ({
|
|
178
|
-
format,
|
|
179
|
-
basePath: this.basePath,
|
|
180
|
-
paths: paths.slice(i * MAX_REPORTS_PER_REQUEST, (i + 1) * MAX_REPORTS_PER_REQUEST),
|
|
181
|
-
spanTags,
|
|
182
|
-
customTags,
|
|
183
|
-
customMeasures,
|
|
184
|
-
hostname: os_1.default.hostname(),
|
|
185
|
-
commitDiff,
|
|
186
|
-
prDiff,
|
|
187
|
-
coverageConfig,
|
|
188
|
-
codeowners,
|
|
189
|
-
}));
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
return payloads;
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
getRepoFile(possiblePaths) {
|
|
196
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
-
if (!this.git) {
|
|
198
|
-
return undefined;
|
|
199
|
-
}
|
|
200
|
-
for (const path of possiblePaths) {
|
|
201
|
-
try {
|
|
202
|
-
const sha = yield (0, git_1.getGitFileHash)(this.git, path);
|
|
203
|
-
if (sha) {
|
|
204
|
-
return { path, sha };
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
catch (e) {
|
|
208
|
-
this.logger.debug(`Error while trying to get repo file ${path} details: ${e}`);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return undefined;
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
getPrDiff(spanTags) {
|
|
215
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
-
if (!this.uploadGitDiff || !this.git) {
|
|
217
|
-
return undefined;
|
|
218
|
-
}
|
|
219
|
-
try {
|
|
220
|
-
const pr = yield this.getHeadAndBase(spanTags);
|
|
221
|
-
if (!pr.headSha || !pr.baseSha) {
|
|
222
|
-
return undefined;
|
|
223
|
-
}
|
|
224
|
-
return yield (0, git_1.getGitDiff)(this.git, pr.baseSha, pr.headSha);
|
|
225
|
-
}
|
|
226
|
-
catch (e) {
|
|
227
|
-
this.logger.debug(`Error while trying to calculate PR diff: ${e}`);
|
|
228
|
-
return undefined;
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
getHeadAndBase(spanTags) {
|
|
233
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
-
const headSha = spanTags[tags_1.GIT_HEAD_SHA] || spanTags[tags_1.GIT_SHA];
|
|
235
|
-
if (!headSha) {
|
|
236
|
-
return {};
|
|
237
|
-
}
|
|
238
|
-
if (!this.git) {
|
|
239
|
-
return {};
|
|
240
|
-
}
|
|
241
|
-
const baseSha = spanTags[tags_1.GIT_PULL_REQUEST_BASE_BRANCH_SHA] || spanTags[tags_1.GIT_PULL_REQUEST_BASE_BRANCH_HEAD_SHA];
|
|
242
|
-
if (baseSha) {
|
|
243
|
-
// GitHub incorrectly reports base SHA as the head of the target branch
|
|
244
|
-
// doing a merge-base allows us to get the real base SHA
|
|
245
|
-
// (and if the base SHA was reported correctly, merge-base will not alter it)
|
|
246
|
-
const mergeBase = yield (0, git_1.getMergeBase)(this.git, baseSha, headSha);
|
|
247
|
-
return { headSha, baseSha: mergeBase };
|
|
248
|
-
}
|
|
249
|
-
const baseBranch = spanTags[tags_1.GIT_PULL_REQUEST_BASE_BRANCH];
|
|
250
|
-
if (baseBranch) {
|
|
251
|
-
const mergeBase = yield (0, git_1.getMergeBase)(this.git, baseBranch, headSha);
|
|
252
|
-
return { headSha, baseSha: mergeBase };
|
|
253
|
-
}
|
|
254
|
-
return {};
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
getCommitDiff(spanTags) {
|
|
258
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
-
if (!this.uploadGitDiff) {
|
|
260
|
-
return undefined;
|
|
261
|
-
}
|
|
262
|
-
const commit = spanTags[tags_1.GIT_HEAD_SHA] || spanTags[tags_1.GIT_SHA];
|
|
263
|
-
if (!commit) {
|
|
264
|
-
return undefined;
|
|
265
|
-
}
|
|
266
|
-
if (!this.git) {
|
|
267
|
-
return undefined;
|
|
268
|
-
}
|
|
269
|
-
try {
|
|
270
|
-
return yield (0, git_1.getGitDiff)(this.git, commit + '^', commit);
|
|
271
|
-
}
|
|
272
|
-
catch (e) {
|
|
273
|
-
this.logger.debug(`Error while trying to calculate commit diff: ${e}`);
|
|
274
|
-
return undefined;
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
getSpanTags() {
|
|
279
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
280
|
-
const ciSpanTags = (0, ci_1.getCISpanTags)();
|
|
281
|
-
const gitSpanTags = yield (0, format_git_span_data_1.getGitMetadata)();
|
|
282
|
-
const userGitSpanTags = (0, user_provided_git_1.getUserGitSpanTags)();
|
|
283
|
-
const spanTags = Object.assign(Object.assign(Object.assign(Object.assign({}, gitSpanTags), ciSpanTags), userGitSpanTags), (this.config.env ? { env: this.config.env } : {}));
|
|
284
|
-
if (!spanTags[tags_1.GIT_REPOSITORY_URL]) {
|
|
285
|
-
throw new Error('git repository URL is missing');
|
|
286
|
-
}
|
|
287
|
-
if (!spanTags[tags_1.GIT_SHA]) {
|
|
288
|
-
throw new Error('git commit SHA is missing');
|
|
289
|
-
}
|
|
290
|
-
return spanTags;
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
getCustomTags() {
|
|
294
|
-
const envVarTags = this.config.envVarTags ? (0, tags_1.parseTags)(this.config.envVarTags.split(',')) : {};
|
|
295
|
-
const cliTags = this.tags ? (0, tags_1.parseTags)(this.tags) : {};
|
|
296
|
-
return Object.assign(Object.assign({}, cliTags), envVarTags);
|
|
297
|
-
}
|
|
298
|
-
getCustomMeasures() {
|
|
299
|
-
const envVarMeasures = this.config.envVarMeasures ? (0, tags_1.parseMetrics)(this.config.envVarMeasures.split(',')) : {};
|
|
300
|
-
const cliMeasures = this.measures ? (0, tags_1.parseMetrics)(this.measures) : {};
|
|
301
|
-
return Object.assign(Object.assign({}, cliMeasures), envVarMeasures);
|
|
302
|
-
}
|
|
303
|
-
getMatchingCoverageReportFilesByFormat() {
|
|
304
|
-
return (0, file_finder_1.partitionFiles)(this.reportPaths || ['.'], (0, glob_1.parsePathsList)(this.ignoredPaths), this.getCoverageReportFormat.bind(this));
|
|
305
|
-
}
|
|
306
|
-
getCoverageReportFormat(filePath, strict) {
|
|
307
|
-
const format = (0, utils_2.toCoverageFormat)(this.format) || (0, utils_2.detectFormat)(filePath);
|
|
308
|
-
if (!format) {
|
|
309
|
-
if (strict) {
|
|
310
|
-
this.context.stdout.write((0, renderer_1.renderInvalidFile)(filePath, `format could not be detected`));
|
|
311
|
-
}
|
|
312
|
-
return undefined;
|
|
313
|
-
}
|
|
314
|
-
const validationError = (0, utils_2.validateCoverageReport)(filePath, format);
|
|
315
|
-
if (validationError) {
|
|
316
|
-
this.context.stdout.write((0, renderer_1.renderInvalidFile)(filePath, validationError));
|
|
317
|
-
return undefined;
|
|
318
|
-
}
|
|
319
|
-
return format;
|
|
320
|
-
}
|
|
321
|
-
uploadCodeCoverageReport(api, codeCoverageReport) {
|
|
322
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
-
if (this.dryRun) {
|
|
324
|
-
this.logger.info((0, renderer_1.renderDryRunUpload)(codeCoverageReport));
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
try {
|
|
328
|
-
this.logger.info((0, renderer_1.renderUpload)(codeCoverageReport));
|
|
329
|
-
yield (0, retry_1.retryRequest)(() => api.uploadCodeCoverageReport(codeCoverageReport), {
|
|
330
|
-
onRetry: (e, attempt) => {
|
|
331
|
-
this.context.stderr.write((0, renderer_1.renderRetriedUpload)(codeCoverageReport, e.message, attempt));
|
|
332
|
-
},
|
|
333
|
-
retries: 5,
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
catch (error) {
|
|
337
|
-
this.context.stderr.write((0, renderer_1.renderFailedUpload)(codeCoverageReport, error));
|
|
338
|
-
if (error.response) {
|
|
339
|
-
// If it's an axios error
|
|
340
|
-
if (!errorCodesStopUpload.includes(error.response.status)) {
|
|
341
|
-
// And a status code that should not stop the whole upload, just return
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
throw error;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
exports.CoverageUploadCommand = CoverageUploadCommand;
|
|
351
|
-
CoverageUploadCommand.paths = [['coverage', 'upload']];
|
|
352
|
-
CoverageUploadCommand.usage = clipanion_1.Command.Usage({
|
|
353
|
-
category: 'CI Visibility',
|
|
354
|
-
description: 'Upload code coverage reports files to Datadog.',
|
|
355
|
-
details: `
|
|
356
|
-
This command will upload code coverage report files to Datadog.\n
|
|
357
|
-
See README for details.
|
|
358
|
-
`,
|
|
359
|
-
examples: [
|
|
360
|
-
['Upload all code coverage report files in current directory and its subfolders', 'datadog-ci coverage upload .'],
|
|
361
|
-
[
|
|
362
|
-
'Upload all code coverage report files in current directory and its subfolders, ignoring src/ignored-module-a and src/ignored-module-b',
|
|
363
|
-
'datadog-ci coverage upload --ignored-paths src/ignored-module-a,src/ignored-module-b .',
|
|
364
|
-
],
|
|
365
|
-
[
|
|
366
|
-
'Upload all code coverage report files in src/unit-test-coverage and src/acceptance-test-coverage',
|
|
367
|
-
'datadog-ci coverage upload src/unit-test-coverage src/acceptance-test-coverage',
|
|
368
|
-
],
|
|
369
|
-
[
|
|
370
|
-
'Upload all XML code coverage report files in /coverage/ folders, ignoring src/ignored-module-a',
|
|
371
|
-
'datadog-ci coverage upload **/coverage/*.xml --ignored-paths src/ignored-module-a',
|
|
372
|
-
],
|
|
373
|
-
[
|
|
374
|
-
'Upload all code coverage report files in current directory and add extra tags globally',
|
|
375
|
-
'datadog-ci coverage upload --tags key1:value1 --tags key2:value2 .',
|
|
376
|
-
],
|
|
377
|
-
[
|
|
378
|
-
'Upload all code coverage report files in current directory and add extra measures globally',
|
|
379
|
-
'datadog-ci coverage upload --measures key1:123 --measures key2:321 .',
|
|
380
|
-
],
|
|
381
|
-
[
|
|
382
|
-
'Upload all code coverage report files in current directory to the datadoghq.eu site',
|
|
383
|
-
'DD_SITE=datadoghq.eu datadog-ci coverage upload .',
|
|
384
|
-
],
|
|
385
|
-
[
|
|
386
|
-
'Upload all code coverage report files in current directory with extra verbosity',
|
|
387
|
-
'datadog-ci coverage upload --verbose .',
|
|
388
|
-
],
|
|
389
|
-
],
|
|
390
|
-
});
|
|
391
|
-
//# sourceMappingURL=upload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/commands/coverage/upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAmB;AAEnB,8DAAoD;AACpD,4EAM2D;AAC3D,gFAAkF;AAClF,oFAA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ACzD,uEAAuE;wBACvE,OAAM;qBACP;iBACF;gBACD,MAAM,KAAK,CAAA;aACZ;QACH,CAAC;KAAA;;AAjZH,sDAkZC;AAjZe,2BAAK,GAAG,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,AAA3B,CAA2B;AAEhC,2BAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,eAAe;IACzB,WAAW,EAAE,gDAAgD;IAC7D,OAAO,EAAE;;;KAGR;IACD,QAAQ,EAAE;QACR,CAAC,+EAA+E,EAAE,8BAA8B,CAAC;QACjH;YACE,uIAAuI;YACvI,wFAAwF;SACzF;QACD;YACE,kGAAkG;YAClG,gFAAgF;SACjF;QACD;YACE,gGAAgG;YAChG,mFAAmF;SACpF;QACD;YACE,wFAAwF;YACxF,oEAAoE;SACrE;QACD;YACE,4FAA4F;YAC5F,sEAAsE;SACvE;QACD;YACE,qFAAqF;YACrF,mDAAmD;SACpD;QACD;YACE,iFAAiF;YACjF,wCAAwC;SACzC;KACF;CACF,CAAC,AAtCiB,CAsCjB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SpanTags } from '@datadog/datadog-ci-base/helpers/interfaces';
|
|
2
|
-
export declare const jacocoFormat: "jacoco";
|
|
3
|
-
export declare const lcovFormat: "lcov";
|
|
4
|
-
export declare const opencoverFormat: "opencover";
|
|
5
|
-
export declare const coberturaFormat: "cobertura";
|
|
6
|
-
export declare const simplecovFormat: "simplecov";
|
|
7
|
-
export declare const simplecovInternalFormat: "simplecov-internal";
|
|
8
|
-
export declare const cloverFormat: "clover";
|
|
9
|
-
export declare const coverageFormats: readonly ["jacoco", "lcov", "opencover", "cobertura", "simplecov", "simplecov-internal", "clover"];
|
|
10
|
-
export type CoverageFormat = (typeof coverageFormats)[number];
|
|
11
|
-
export declare const isCoverageFormat: (value: string) => value is "jacoco" | "lcov" | "opencover" | "cobertura" | "simplecov" | "simplecov-internal" | "clover";
|
|
12
|
-
export declare const toCoverageFormat: (value: string | undefined) => CoverageFormat | undefined;
|
|
13
|
-
export declare const detectFormat: (filePath: string) => CoverageFormat | undefined;
|
|
14
|
-
export declare const validateCoverageReport: (filePath: string, format: CoverageFormat) => string | undefined;
|
|
15
|
-
export declare const getCoverageDetailsUrl: (spanTags: SpanTags) => string;
|