@datadog/datadog-ci 5.8.0 → 5.9.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.
Files changed (163) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.js +1 -2
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +10 -16
  5. package/dist/commands/cli.d.ts +0 -32
  6. package/dist/commands/cli.js +0 -27
  7. package/dist/commands/cli.js.map +0 -1
  8. package/dist/commands/elf-symbols/cli.d.ts +0 -2
  9. package/dist/commands/elf-symbols/cli.js +0 -6
  10. package/dist/commands/elf-symbols/cli.js.map +0 -1
  11. package/dist/commands/elf-symbols/elf-constants.d.ts +0 -256
  12. package/dist/commands/elf-symbols/elf-constants.js +0 -465
  13. package/dist/commands/elf-symbols/elf-constants.js.map +0 -1
  14. package/dist/commands/elf-symbols/elf.d.ts +0 -105
  15. package/dist/commands/elf-symbols/elf.js +0 -431
  16. package/dist/commands/elf-symbols/elf.js.map +0 -1
  17. package/dist/commands/elf-symbols/helpers.d.ts +0 -4
  18. package/dist/commands/elf-symbols/helpers.js +0 -29
  19. package/dist/commands/elf-symbols/helpers.js.map +0 -1
  20. package/dist/commands/elf-symbols/interfaces.d.ts +0 -18
  21. package/dist/commands/elf-symbols/interfaces.js +0 -7
  22. package/dist/commands/elf-symbols/interfaces.js.map +0 -1
  23. package/dist/commands/elf-symbols/renderer.d.ts +0 -19
  24. package/dist/commands/elf-symbols/renderer.js +0 -87
  25. package/dist/commands/elf-symbols/renderer.js.map +0 -1
  26. package/dist/commands/elf-symbols/upload.d.ts +0 -31
  27. package/dist/commands/elf-symbols/upload.js +0 -412
  28. package/dist/commands/elf-symbols/upload.js.map +0 -1
  29. package/dist/commands/flutter-symbols/cli.d.ts +0 -2
  30. package/dist/commands/flutter-symbols/cli.js +0 -6
  31. package/dist/commands/flutter-symbols/cli.js.map +0 -1
  32. package/dist/commands/flutter-symbols/helpers.d.ts +0 -8
  33. package/dist/commands/flutter-symbols/helpers.js +0 -51
  34. package/dist/commands/flutter-symbols/helpers.js.map +0 -1
  35. package/dist/commands/flutter-symbols/interfaces.d.ts +0 -17
  36. package/dist/commands/flutter-symbols/interfaces.js +0 -10
  37. package/dist/commands/flutter-symbols/interfaces.js.map +0 -1
  38. package/dist/commands/flutter-symbols/renderer.d.ts +0 -23
  39. package/dist/commands/flutter-symbols/renderer.js +0 -106
  40. package/dist/commands/flutter-symbols/renderer.js.map +0 -1
  41. package/dist/commands/flutter-symbols/upload.d.ts +0 -44
  42. package/dist/commands/flutter-symbols/upload.js +0 -510
  43. package/dist/commands/flutter-symbols/upload.js.map +0 -1
  44. package/dist/commands/measure/cli.d.ts +0 -2
  45. package/dist/commands/measure/cli.js +0 -6
  46. package/dist/commands/measure/cli.js.map +0 -1
  47. package/dist/commands/measure/measure.d.ts +0 -18
  48. package/dist/commands/measure/measure.js +0 -171
  49. package/dist/commands/measure/measure.js.map +0 -1
  50. package/dist/commands/pe-symbols/breakpad.d.ts +0 -2
  51. package/dist/commands/pe-symbols/breakpad.js +0 -159
  52. package/dist/commands/pe-symbols/breakpad.js.map +0 -1
  53. package/dist/commands/pe-symbols/cli.d.ts +0 -2
  54. package/dist/commands/pe-symbols/cli.js +0 -6
  55. package/dist/commands/pe-symbols/cli.js.map +0 -1
  56. package/dist/commands/pe-symbols/helpers.d.ts +0 -4
  57. package/dist/commands/pe-symbols/helpers.js +0 -30
  58. package/dist/commands/pe-symbols/helpers.js.map +0 -1
  59. package/dist/commands/pe-symbols/interfaces.d.ts +0 -17
  60. package/dist/commands/pe-symbols/interfaces.js +0 -7
  61. package/dist/commands/pe-symbols/interfaces.js.map +0 -1
  62. package/dist/commands/pe-symbols/pe-constants.d.ts +0 -51
  63. package/dist/commands/pe-symbols/pe-constants.js +0 -160
  64. package/dist/commands/pe-symbols/pe-constants.js.map +0 -1
  65. package/dist/commands/pe-symbols/pe.d.ts +0 -40
  66. package/dist/commands/pe-symbols/pe.js +0 -249
  67. package/dist/commands/pe-symbols/pe.js.map +0 -1
  68. package/dist/commands/pe-symbols/renderer.d.ts +0 -19
  69. package/dist/commands/pe-symbols/renderer.js +0 -87
  70. package/dist/commands/pe-symbols/renderer.js.map +0 -1
  71. package/dist/commands/pe-symbols/upload.d.ts +0 -34
  72. package/dist/commands/pe-symbols/upload.js +0 -457
  73. package/dist/commands/pe-symbols/upload.js.map +0 -1
  74. package/dist/commands/react-native/cli.d.ts +0 -5
  75. package/dist/commands/react-native/cli.js +0 -14
  76. package/dist/commands/react-native/cli.js.map +0 -1
  77. package/dist/commands/react-native/codepush.d.ts +0 -29
  78. package/dist/commands/react-native/codepush.js +0 -176
  79. package/dist/commands/react-native/codepush.js.map +0 -1
  80. package/dist/commands/react-native/errors.d.ts +0 -9
  81. package/dist/commands/react-native/errors.js +0 -34
  82. package/dist/commands/react-native/errors.js.map +0 -1
  83. package/dist/commands/react-native/injectDebugId.d.ts +0 -42
  84. package/dist/commands/react-native/injectDebugId.js +0 -252
  85. package/dist/commands/react-native/injectDebugId.js.map +0 -1
  86. package/dist/commands/react-native/interfaces.d.ts +0 -20
  87. package/dist/commands/react-native/interfaces.js +0 -93
  88. package/dist/commands/react-native/interfaces.js.map +0 -1
  89. package/dist/commands/react-native/renderer.d.ts +0 -20
  90. package/dist/commands/react-native/renderer.js +0 -111
  91. package/dist/commands/react-native/renderer.js.map +0 -1
  92. package/dist/commands/react-native/upload.d.ts +0 -30
  93. package/dist/commands/react-native/upload.js +0 -317
  94. package/dist/commands/react-native/upload.js.map +0 -1
  95. package/dist/commands/react-native/utils.d.ts +0 -4
  96. package/dist/commands/react-native/utils.js +0 -35
  97. package/dist/commands/react-native/utils.js.map +0 -1
  98. package/dist/commands/react-native/validation.d.ts +0 -6
  99. package/dist/commands/react-native/validation.js +0 -24
  100. package/dist/commands/react-native/validation.js.map +0 -1
  101. package/dist/commands/react-native/xcode.d.ts +0 -58
  102. package/dist/commands/react-native/xcode.js +0 -561
  103. package/dist/commands/react-native/xcode.js.map +0 -1
  104. package/dist/commands/sourcemaps/cli.d.ts +0 -2
  105. package/dist/commands/sourcemaps/cli.js +0 -6
  106. package/dist/commands/sourcemaps/cli.js.map +0 -1
  107. package/dist/commands/sourcemaps/interfaces.d.ts +0 -18
  108. package/dist/commands/sourcemaps/interfaces.js +0 -59
  109. package/dist/commands/sourcemaps/interfaces.js.map +0 -1
  110. package/dist/commands/sourcemaps/renderer.d.ts +0 -13
  111. package/dist/commands/sourcemaps/renderer.js +0 -93
  112. package/dist/commands/sourcemaps/renderer.js.map +0 -1
  113. package/dist/commands/sourcemaps/upload.d.ts +0 -29
  114. package/dist/commands/sourcemaps/upload.js +0 -342
  115. package/dist/commands/sourcemaps/upload.js.map +0 -1
  116. package/dist/commands/sourcemaps/utils.d.ts +0 -3
  117. package/dist/commands/sourcemaps/utils.js +0 -73
  118. package/dist/commands/sourcemaps/utils.js.map +0 -1
  119. package/dist/commands/sourcemaps/validation.d.ts +0 -7
  120. package/dist/commands/sourcemaps/validation.js +0 -41
  121. package/dist/commands/sourcemaps/validation.js.map +0 -1
  122. package/dist/commands/span/cli.d.ts +0 -2
  123. package/dist/commands/span/cli.js +0 -6
  124. package/dist/commands/span/cli.js.map +0 -1
  125. package/dist/commands/span/span.d.ts +0 -10
  126. package/dist/commands/span/span.js +0 -112
  127. package/dist/commands/span/span.js.map +0 -1
  128. package/dist/commands/trace/api.d.ts +0 -6
  129. package/dist/commands/trace/api.js +0 -38
  130. package/dist/commands/trace/api.js.map +0 -1
  131. package/dist/commands/trace/cli.d.ts +0 -2
  132. package/dist/commands/trace/cli.js +0 -6
  133. package/dist/commands/trace/cli.js.map +0 -1
  134. package/dist/commands/trace/helper.d.ts +0 -16
  135. package/dist/commands/trace/helper.js +0 -125
  136. package/dist/commands/trace/helper.js.map +0 -1
  137. package/dist/commands/trace/interfaces.d.ts +0 -18
  138. package/dist/commands/trace/interfaces.js +0 -14
  139. package/dist/commands/trace/interfaces.js.map +0 -1
  140. package/dist/commands/trace/test-utils.d.ts +0 -4
  141. package/dist/commands/trace/test-utils.js +0 -156
  142. package/dist/commands/trace/test-utils.js.map +0 -1
  143. package/dist/commands/trace/trace.d.ts +0 -10
  144. package/dist/commands/trace/trace.js +0 -110
  145. package/dist/commands/trace/trace.js.map +0 -1
  146. package/dist/commands/unity-symbols/cli.d.ts +0 -2
  147. package/dist/commands/unity-symbols/cli.js +0 -6
  148. package/dist/commands/unity-symbols/cli.js.map +0 -1
  149. package/dist/commands/unity-symbols/helpers.d.ts +0 -4
  150. package/dist/commands/unity-symbols/helpers.js +0 -29
  151. package/dist/commands/unity-symbols/helpers.js.map +0 -1
  152. package/dist/commands/unity-symbols/interfaces.d.ts +0 -14
  153. package/dist/commands/unity-symbols/interfaces.js +0 -9
  154. package/dist/commands/unity-symbols/interfaces.js.map +0 -1
  155. package/dist/commands/unity-symbols/renderer.d.ts +0 -19
  156. package/dist/commands/unity-symbols/renderer.js +0 -88
  157. package/dist/commands/unity-symbols/renderer.js.map +0 -1
  158. package/dist/commands/unity-symbols/upload.d.ts +0 -32
  159. package/dist/commands/unity-symbols/upload.js +0 -392
  160. package/dist/commands/unity-symbols/upload.js.map +0 -1
  161. package/dist/commands/version/cli.d.ts +0 -8
  162. package/dist/commands/version/cli.js +0 -31
  163. package/dist/commands/version/cli.js.map +0 -1
@@ -1,457 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.PeSymbolsUploadCommand = void 0;
39
- const fs_1 = __importDefault(require("fs"));
40
- const datadog_ci_base_1 = require("@datadog/datadog-ci-base");
41
- const constants_1 = require("@datadog/datadog-ci-base/constants");
42
- const apikey_1 = require("@datadog/datadog-ci-base/helpers/apikey");
43
- const concurrency_1 = require("@datadog/datadog-ci-base/helpers/concurrency");
44
- const env_1 = require("@datadog/datadog-ci-base/helpers/env");
45
- const fips_1 = require("@datadog/datadog-ci-base/helpers/fips");
46
- const format_git_sourcemaps_data_1 = require("@datadog/datadog-ci-base/helpers/git/format-git-sourcemaps-data");
47
- const glob_1 = require("@datadog/datadog-ci-base/helpers/glob");
48
- const metrics_1 = require("@datadog/datadog-ci-base/helpers/metrics");
49
- const upload_1 = require("@datadog/datadog-ci-base/helpers/upload");
50
- const utils_1 = require("@datadog/datadog-ci-base/helpers/utils");
51
- const validation = __importStar(require("@datadog/datadog-ci-base/helpers/validation"));
52
- const validation_1 = require("@datadog/datadog-ci-base/helpers/validation");
53
- const version_1 = require("@datadog/datadog-ci-base/version");
54
- const clipanion_1 = require("clipanion");
55
- const upath_1 = __importDefault(require("upath"));
56
- const breakpad_1 = require("./breakpad");
57
- const helpers_1 = require("./helpers");
58
- const interfaces_1 = require("./interfaces");
59
- const pe_1 = require("./pe");
60
- const pe_constants_1 = require("./pe-constants");
61
- const renderer_1 = require("./renderer");
62
- class PeSymbolsUploadCommand extends datadog_ci_base_1.BaseCommand {
63
- constructor() {
64
- var _a, _b;
65
- super(...arguments);
66
- this.disableGit = clipanion_1.Option.Boolean('--disable-git', false);
67
- this.dryRun = clipanion_1.Option.Boolean('--dry-run', false);
68
- this.configPath = clipanion_1.Option.String('--config');
69
- this.maxConcurrency = clipanion_1.Option.String('--max-concurrency', '20', { validator: validation.isInteger() });
70
- this.repositoryUrl = clipanion_1.Option.String('--repository-url');
71
- this.replaceExisting = clipanion_1.Option.Boolean('--replace-existing', false);
72
- this.symbolsLocations = clipanion_1.Option.Rest({ required: 1 });
73
- this.cliVersion = version_1.cliVersion;
74
- this.config = {
75
- datadogSite: 'datadoghq.com',
76
- };
77
- this.fips = clipanion_1.Option.Boolean('--fips', false);
78
- this.fipsIgnoreError = clipanion_1.Option.Boolean('--fips-ignore-error', false);
79
- this.fipsConfig = {
80
- fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
81
- fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
82
- };
83
- }
84
- execute() {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- (0, fips_1.enableFips)(this.fips || this.fipsConfig.fips, this.fipsIgnoreError || this.fipsConfig.fipsIgnoreError);
87
- if (!(yield this.verifyParameters())) {
88
- return 1;
89
- }
90
- const initialTime = Date.now();
91
- this.context.stdout.write((0, renderer_1.renderCommandInfo)(this.dryRun, this.symbolsLocations));
92
- this.config = yield (0, utils_1.resolveConfigFromFileAndEnvironment)(this.config, {
93
- apiKey: process.env.DATADOG_API_KEY || process.env.DD_API_KEY,
94
- datadogSite: process.env.DATADOG_SITE || process.env.DD_SITE,
95
- }, {
96
- configPath: this.configPath,
97
- defaultConfigPaths: utils_1.DEFAULT_CONFIG_PATHS,
98
- configFromFileCallback: (configFromFile) => {
99
- (0, validation_1.checkAPIKeyOverride)(process.env.DATADOG_API_KEY || process.env.DD_API_KEY, configFromFile.apiKey, this.context.stdout);
100
- },
101
- });
102
- if (!this.disableGit) {
103
- this.gitData = yield this.getGitMetadata();
104
- }
105
- const callResults = [];
106
- try {
107
- callResults.push(...(yield this.performPESymbolsUpload()));
108
- const totalTime = (Date.now() - initialTime) / 1000;
109
- this.context.stdout.write((0, renderer_1.renderCommandSummary)(callResults, totalTime, this.dryRun));
110
- }
111
- catch (e) {
112
- this.context.stderr.write((0, renderer_1.renderGeneralizedError)(e));
113
- return 1;
114
- }
115
- return 0;
116
- });
117
- }
118
- getApiKeyValidator(metricsLogger) {
119
- return (0, apikey_1.newApiKeyValidator)({
120
- apiKey: this.config.apiKey,
121
- datadogSite: this.config.datadogSite,
122
- metricsLogger: metricsLogger.logger,
123
- });
124
- }
125
- getGitDataPayload(gitData) {
126
- const files = gitData.trackedFilesMatcher.rawTrackedFilesList();
127
- const repoPayload = {
128
- data: [
129
- {
130
- files,
131
- hash: gitData.hash,
132
- repository_url: gitData.remote,
133
- },
134
- ],
135
- version: 1,
136
- };
137
- return {
138
- type: 'string',
139
- options: { filename: 'repository', contentType: 'application/json' },
140
- value: JSON.stringify(repoPayload),
141
- };
142
- }
143
- getGitMetadata() {
144
- return __awaiter(this, void 0, void 0, function* () {
145
- try {
146
- return yield (0, format_git_sourcemaps_data_1.getRepositoryData)(yield (0, format_git_sourcemaps_data_1.newSimpleGit)(), this.repositoryUrl);
147
- }
148
- catch (e) {
149
- this.context.stdout.write((0, renderer_1.renderGitWarning)(e));
150
- }
151
- return undefined;
152
- });
153
- }
154
- getPESymbolSource(peFileMetadata) {
155
- if (peFileMetadata.hasPdbInfo) {
156
- return 'debug_info';
157
- }
158
- return 'none';
159
- }
160
- getArchitecture(architecture) {
161
- if (architecture === pe_constants_1.MachineArchitecture.x86) {
162
- return 'x86';
163
- }
164
- else if (architecture === pe_constants_1.MachineArchitecture.x64) {
165
- return 'x64';
166
- }
167
- else if (architecture === pe_constants_1.MachineArchitecture.Arm32) {
168
- return 'arm32';
169
- }
170
- else if (architecture === pe_constants_1.MachineArchitecture.Arm64) {
171
- return 'arm64';
172
- }
173
- else {
174
- return 'unknown';
175
- }
176
- }
177
- getMappingMetadata(peFileMetadata) {
178
- var _a, _b, _c;
179
- const symbolSource = (_a = peFileMetadata.symbolSource) !== null && _a !== void 0 ? _a : this.getPESymbolSource(peFileMetadata);
180
- return {
181
- cli_version: this.cliVersion,
182
- origin_version: this.cliVersion,
183
- origin: 'datadog-ci',
184
- arch: this.getArchitecture(peFileMetadata.arch),
185
- pdb_age: peFileMetadata.pdbAge,
186
- pdb_sig: peFileMetadata === null || peFileMetadata === void 0 ? void 0 : peFileMetadata.pdbSig,
187
- git_commit_sha: (_b = this.gitData) === null || _b === void 0 ? void 0 : _b.hash,
188
- git_repository_url: (_c = this.gitData) === null || _c === void 0 ? void 0 : _c.remote,
189
- symbol_source: symbolSource,
190
- filename: upath_1.default.basename(peFileMetadata.pdbFilename),
191
- overwrite: this.replaceExisting,
192
- type: interfaces_1.TYPE_PE_DEBUG_INFOS,
193
- };
194
- }
195
- getSymbolSourcePriority(symbolSource) {
196
- if (symbolSource === 'debug_info') {
197
- return 3;
198
- }
199
- if (symbolSource === 'symbol_table') {
200
- return 2;
201
- }
202
- if (symbolSource === 'dynamic_symbol_table') {
203
- return 1;
204
- }
205
- return 0;
206
- }
207
- getMetricsLogger() {
208
- const metricsLogger = (0, metrics_1.getMetricsLogger)({
209
- apiKey: this.config.apiKey,
210
- datadogSite: this.config.datadogSite,
211
- defaultTags: [`cli_version:${this.cliVersion}`, 'platform:pe'],
212
- prefix: 'datadog.ci.pe_symbols.',
213
- });
214
- return metricsLogger;
215
- }
216
- getPESymbolFiles(symbolsLocation) {
217
- return __awaiter(this, void 0, void 0, function* () {
218
- let paths = [];
219
- let reportFailure;
220
- const stat = yield fs_1.default.promises.stat(symbolsLocation);
221
- if (stat.isDirectory()) {
222
- // strict: false is needed to avoid throwing an error if a directory is not readable
223
- paths = (0, glob_1.globSync)((0, utils_1.buildPath)(symbolsLocation, '**'), { dot: true, dotRelative: true });
224
- reportFailure = (message) => this.context.stdout.write((0, renderer_1.renderWarning)(message));
225
- // throw an error if top-level directory is not readable
226
- // eslint-disable-next-line no-bitwise
227
- yield fs_1.default.promises.access(symbolsLocation, fs_1.default.constants.R_OK | fs_1.default.constants.X_OK).catch(() => {
228
- throw Error(`Directory ${symbolsLocation} is not readable`);
229
- });
230
- }
231
- else {
232
- paths = [symbolsLocation];
233
- // in single file mode, we want to report failures as errors
234
- reportFailure = (message) => {
235
- throw Error(message);
236
- };
237
- }
238
- const filesMetadata = [];
239
- for (const p of paths) {
240
- const pathStat = yield fs_1.default.promises.lstat(p);
241
- if (pathStat.isDirectory()) {
242
- // check if directory is readable and if not emit a warning
243
- // eslint-disable-next-line no-bitwise
244
- yield fs_1.default.promises.access(p, fs_1.default.constants.R_OK | fs_1.default.constants.X_OK).catch(() => {
245
- reportFailure(`Skipped directory ${p} because it is not readable`);
246
- });
247
- }
248
- else if (pathStat.isFile()) {
249
- if (this.isBreakpadSymFile(p)) {
250
- try {
251
- const breakpadMetadata = yield (0, breakpad_1.getBreakpadSymMetadata)(p);
252
- if (breakpadMetadata.moduleOs && breakpadMetadata.moduleOs.toLowerCase() !== 'windows') {
253
- this.context.stdout.write((0, renderer_1.renderWarning)(`Breakpad symbol ${p} declares module OS "${breakpadMetadata.moduleOs}" which is not Windows - uploading anyway`));
254
- }
255
- filesMetadata.push(breakpadMetadata);
256
- }
257
- catch (err) {
258
- const message = err instanceof Error ? err.message : `${err}`;
259
- reportFailure(`Error reading Breakpad symbol file ${p}: ${message}`);
260
- }
261
- continue;
262
- }
263
- // check that path is a file and is a PE file
264
- const peMetadata = yield (0, pe_1.getPEFileMetadata)(p);
265
- // handle all possible failures
266
- if (!peMetadata.isPE) {
267
- reportFailure(`Input location ${p} is not a PE file`);
268
- continue;
269
- }
270
- if (peMetadata.error) {
271
- reportFailure(`Error reading PE file ${p}: ${peMetadata.error.message}`);
272
- continue;
273
- }
274
- if (!peMetadata.hasPdbInfo) {
275
- reportFailure(`Skipped ${p} because it has no debug info, nor symbols`);
276
- continue;
277
- }
278
- filesMetadata.push(peMetadata);
279
- }
280
- }
281
- // sort files to make output deterministic
282
- filesMetadata.sort((a, b) => a.filename.localeCompare(b.filename));
283
- return filesMetadata;
284
- });
285
- }
286
- removeBuildIdDuplicates(filesMetadata) {
287
- var _a, _b;
288
- const buildIds = new Map();
289
- for (const metadata of filesMetadata) {
290
- const buildId = (0, pe_1.getBuildId)(metadata);
291
- const existing = buildIds.get(buildId);
292
- if (existing) {
293
- const newSymbolSource = (_a = metadata.symbolSource) !== null && _a !== void 0 ? _a : this.getPESymbolSource(metadata);
294
- const existingSymbolSource = (_b = existing.symbolSource) !== null && _b !== void 0 ? _b : this.getPESymbolSource(existing);
295
- const newPriority = this.getSymbolSourcePriority(newSymbolSource);
296
- const existingPriority = this.getSymbolSourcePriority(existingSymbolSource);
297
- if (newPriority > existingPriority) {
298
- this.context.stderr.write((0, renderer_1.renderWarning)(`Duplicate build_id found: ${buildId} in ${metadata.filename} and ${existing.filename} - keeping ${metadata.filename} because it has richer symbols (${newSymbolSource})`));
299
- buildIds.set(buildId, metadata);
300
- continue;
301
- }
302
- // if both files have the same quality (or the existing one is better), keep the existing entry
303
- this.context.stderr.write((0, renderer_1.renderWarning)(`Duplicate build_id found: ${buildId} in ${metadata.filename} and ${existing.filename} - skipping ${metadata.filename}`));
304
- }
305
- else {
306
- buildIds.set(buildId, metadata);
307
- }
308
- }
309
- return Array.from(buildIds.values()).sort((a, b) => a.filename.localeCompare(b.filename));
310
- }
311
- getFileInSameFolder(pathname, newFilename) {
312
- const dirname = upath_1.default.dirname(pathname);
313
- const newPathname = upath_1.default.join(dirname, upath_1.default.basename(newFilename));
314
- return newPathname;
315
- }
316
- isBreakpadSymFile(pathname) {
317
- return upath_1.default.extname(pathname).toLowerCase() === '.sym';
318
- }
319
- getAssociatedPdbFilename(pathname) {
320
- const basename = upath_1.default.basename(pathname, upath_1.default.extname(pathname));
321
- const dirname = upath_1.default.dirname(pathname);
322
- const newPathname = upath_1.default.join(dirname, `${basename}.pdb`);
323
- return newPathname;
324
- }
325
- performPESymbolsUpload() {
326
- return __awaiter(this, void 0, void 0, function* () {
327
- const metricsLogger = this.getMetricsLogger();
328
- const apiKeyValidator = this.getApiKeyValidator(metricsLogger);
329
- let peFilesMetadata = (yield Promise.all(this.symbolsLocations.map((location) => this.getPESymbolFiles(location)))).flat();
330
- peFilesMetadata = this.removeBuildIdDuplicates(peFilesMetadata);
331
- const requestBuilder = (0, helpers_1.getPERequestBuilder)(this.config.apiKey, this.cliVersion, this.config.datadogSite);
332
- try {
333
- const results = yield (0, concurrency_1.doWithMaxConcurrency)(this.maxConcurrency, peFilesMetadata, (fileMetadata) => __awaiter(this, void 0, void 0, function* () {
334
- const metadata = this.getMappingMetadata(fileMetadata);
335
- if (this.dryRun) {
336
- this.context.stdout.write(`[DRYRUN] ${(0, renderer_1.renderUpload)(fileMetadata.filename, metadata)}`);
337
- // TODO: uncomment the following when dryRun won't be TRUE by default
338
- // return UploadStatus.Success
339
- }
340
- // get the .pdb filename based on the .dll filename and copy it into a temp folder
341
- // --> not sure the ELF-based code makes any sense for PE files...
342
- // instead, we should not need to copy anything:
343
- // 1. get the .pdb filename from the .dll file (ex: foo64.dll --> foo.pdb)
344
- // 2. look for it in the same folder as the .dll file
345
- // 3. if it is not there, look in the same folder for a file with the same name as .dll but with a .pdb extension
346
- // 4. if it is there, upload it; if not generate a skip warning
347
- //
348
- let symbolFilePath;
349
- if (fileMetadata.sourceType === 'breakpad_sym') {
350
- symbolFilePath = fileMetadata.symbolPath;
351
- if (!symbolFilePath || !fs_1.default.existsSync(symbolFilePath)) {
352
- this.context.stdout.write((0, renderer_1.renderWarning)(`Skipped ${fileMetadata.filename} because the Breakpad .sym file is not readable`));
353
- return upload_1.UploadStatus.Skipped;
354
- }
355
- }
356
- else {
357
- let pdbFilename = this.getFileInSameFolder(fileMetadata.filename, fileMetadata.pdbFilename);
358
- if (!fs_1.default.existsSync(pdbFilename)) {
359
- pdbFilename = this.getAssociatedPdbFilename(fileMetadata.filename);
360
- if (!fs_1.default.existsSync(pdbFilename)) {
361
- this.context.stdout.write((0, renderer_1.renderMissingPdbFile)(fileMetadata.pdbFilename, fileMetadata.filename));
362
- return upload_1.UploadStatus.Skipped;
363
- }
364
- }
365
- symbolFilePath = pdbFilename;
366
- }
367
- const eventValue = JSON.stringify(metadata);
368
- this.context.stdout.write((0, renderer_1.renderEventPayload)(eventValue));
369
- const payload = {
370
- content: new Map([
371
- [
372
- 'event',
373
- {
374
- type: 'string',
375
- value: eventValue,
376
- options: { filename: 'event', contentType: 'application/json' },
377
- },
378
- ],
379
- [
380
- interfaces_1.VALUE_NAME_PE_DEBUG_INFOS,
381
- {
382
- type: 'file',
383
- path: symbolFilePath,
384
- options: { filename: interfaces_1.PE_DEBUG_INFOS_FILENAME },
385
- },
386
- ],
387
- ]),
388
- };
389
- if (this.gitData !== undefined) {
390
- payload.content.set('repository', this.getGitDataPayload(this.gitData));
391
- }
392
- return (0, helpers_1.uploadMultipartHelper)(requestBuilder, payload, {
393
- apiKeyValidator,
394
- onError: (e) => {
395
- this.context.stdout.write((0, renderer_1.renderFailedUpload)(fileMetadata.filename, e.message));
396
- metricsLogger.logger.increment('failed', 1);
397
- },
398
- onRetry: (e, attempts) => {
399
- this.context.stdout.write((0, renderer_1.renderRetriedUpload)(fileMetadata.filename, e.message, attempts));
400
- metricsLogger.logger.increment('retries', 1);
401
- },
402
- onUpload: () => {
403
- this.context.stdout.write((0, renderer_1.renderUpload)(fileMetadata.filename, metadata));
404
- },
405
- retries: 5,
406
- useGzip: true,
407
- });
408
- }));
409
- return results;
410
- }
411
- finally {
412
- try {
413
- yield metricsLogger.flush();
414
- }
415
- catch (err) {
416
- this.context.stdout.write(`WARN: ${err}\n`);
417
- }
418
- }
419
- });
420
- }
421
- verifyParameters() {
422
- return __awaiter(this, void 0, void 0, function* () {
423
- let parametersOkay = true;
424
- if (!this.symbolsLocations || this.symbolsLocations.length === 0) {
425
- this.context.stderr.write((0, renderer_1.renderArgumentMissingError)('symbols locations'));
426
- parametersOkay = false;
427
- }
428
- else {
429
- for (const symbolsLocation of this.symbolsLocations) {
430
- if (fs_1.default.existsSync(symbolsLocation)) {
431
- const stats = fs_1.default.statSync(symbolsLocation);
432
- if (!stats.isDirectory() && !stats.isFile()) {
433
- this.context.stderr.write((0, renderer_1.renderInvalidSymbolsLocation)(symbolsLocation));
434
- parametersOkay = false;
435
- }
436
- }
437
- else {
438
- this.context.stderr.write((0, renderer_1.renderInvalidSymbolsLocation)(symbolsLocation));
439
- parametersOkay = false;
440
- }
441
- }
442
- }
443
- return parametersOkay;
444
- });
445
- }
446
- }
447
- exports.PeSymbolsUploadCommand = PeSymbolsUploadCommand;
448
- PeSymbolsUploadCommand.paths = [['pe-symbols', 'upload']];
449
- PeSymbolsUploadCommand.usage = clipanion_1.Command.Usage({
450
- category: 'Profiling',
451
- description: 'Upload Windows PE debug info files to Datadog.',
452
- details: `
453
- This command will upload debug info from all PE files found recursively in the given location in order to symbolicate profiles
454
- `,
455
- examples: [['Upload debug infos for all PE files in the current directory', 'datadog-ci pe-symbols upload .']],
456
- });
457
- //# sourceMappingURL=upload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/commands/pe-symbols/upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,4BAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,gDAAgD;IAC7D,OAAO,EAAE;;SAEJ;IACL,QAAQ,EAAE,CAAC,CAAC,8DAA8D,EAAE,gCAAgC,CAAC,CAAC;CAC/G,CAAC,AAPiB,CAOjB"}
@@ -1,5 +0,0 @@
1
- import { ReactNativeCodepushCommand } from './codepush';
2
- import { ReactNativeInjectDebugIdCommand } from './injectDebugId';
3
- import { ReactNativeUploadCommand } from './upload';
4
- import { ReactNativeXcodeCommand } from './xcode';
5
- export declare const commands: (typeof ReactNativeUploadCommand | typeof ReactNativeCodepushCommand | typeof ReactNativeInjectDebugIdCommand | typeof ReactNativeXcodeCommand)[];
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.commands = void 0;
4
- const codepush_1 = require("./codepush");
5
- const injectDebugId_1 = require("./injectDebugId");
6
- const upload_1 = require("./upload");
7
- const xcode_1 = require("./xcode");
8
- exports.commands = [
9
- codepush_1.ReactNativeCodepushCommand,
10
- upload_1.ReactNativeUploadCommand,
11
- xcode_1.ReactNativeXcodeCommand,
12
- injectDebugId_1.ReactNativeInjectDebugIdCommand,
13
- ];
14
- //# sourceMappingURL=cli.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/commands/react-native/cli.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AACrD,mDAA+D;AAC/D,qCAAiD;AACjD,mCAA+C;AAElC,QAAA,QAAQ,GAAG;IACtB,qCAA0B;IAC1B,iCAAwB;IACxB,+BAAuB;IACvB,+CAA+B;CAChC,CAAA"}
@@ -1,29 +0,0 @@
1
- import { BaseCommand } from '@datadog/datadog-ci-base';
2
- export declare class ReactNativeCodepushCommand extends BaseCommand {
3
- static paths: string[][];
4
- static usage: import("clipanion").Usage;
5
- private appCenterAppName;
6
- private appCenterDeployment;
7
- /**
8
- * There should not be multiple uploads with the same version in the case
9
- * of codepush, so we can go with a default of "1".
10
- */
11
- private buildVersion;
12
- private bundle;
13
- private configPath;
14
- private disableGit;
15
- private dryRun;
16
- private maxConcurrency;
17
- private platform?;
18
- private projectPath;
19
- private removeSourcesContent;
20
- private repositoryURL;
21
- private service;
22
- private sourcemap;
23
- private releaseVersion?;
24
- private fips;
25
- private fipsIgnoreError;
26
- private config;
27
- execute(): Promise<number>;
28
- private getReleaseVersionFromCodepushHistory;
29
- }