@datadog/datadog-ci 1.8.0 → 1.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.
- package/dist/commands/dsyms/interfaces.d.ts +1 -0
- package/dist/commands/dsyms/interfaces.js +15 -4
- package/dist/commands/dsyms/interfaces.js.map +1 -1
- package/dist/commands/git-metadata/interfaces.d.ts +1 -0
- package/dist/commands/git-metadata/interfaces.js +15 -4
- package/dist/commands/git-metadata/interfaces.js.map +1 -1
- package/dist/commands/junit/__tests__/upload.test.js +15 -25
- package/dist/commands/junit/__tests__/upload.test.js.map +1 -1
- package/dist/commands/junit/renderer.d.ts +2 -1
- package/dist/commands/junit/renderer.js +19 -1
- package/dist/commands/junit/renderer.js.map +1 -1
- package/dist/commands/junit/upload.d.ts +1 -0
- package/dist/commands/junit/upload.js +15 -10
- package/dist/commands/junit/upload.js.map +1 -1
- package/dist/commands/junit/utils.d.ts +4 -0
- package/dist/commands/junit/utils.js +45 -1
- package/dist/commands/junit/utils.js.map +1 -1
- package/dist/commands/{sourcemaps/__tests__/git.test.d.ts → react-native/__tests__/interfaces.test.d.ts} +0 -0
- package/dist/commands/react-native/__tests__/interfaces.test.js +27 -0
- package/dist/commands/react-native/__tests__/interfaces.test.js.map +1 -0
- package/dist/{helpers/__tests__/git.test.d.ts → commands/react-native/__tests__/upload.test.d.ts} +0 -0
- package/dist/commands/react-native/__tests__/upload.test.js +153 -0
- package/dist/commands/react-native/__tests__/upload.test.js.map +1 -0
- package/dist/commands/react-native/cli.d.ts +1 -0
- package/dist/commands/react-native/cli.js +5 -0
- package/dist/commands/react-native/cli.js.map +1 -0
- package/dist/commands/react-native/interfaces.d.ts +19 -0
- package/dist/commands/react-native/interfaces.js +70 -0
- package/dist/commands/react-native/interfaces.js.map +1 -0
- package/dist/commands/react-native/renderer.d.ts +18 -0
- package/dist/commands/react-native/renderer.js +95 -0
- package/dist/commands/react-native/renderer.js.map +1 -0
- package/dist/commands/react-native/upload.d.ts +25 -0
- package/dist/commands/react-native/upload.js +260 -0
- package/dist/commands/react-native/upload.js.map +1 -0
- package/dist/commands/react-native/validation.d.ts +6 -0
- package/dist/commands/react-native/validation.js +32 -0
- package/dist/commands/react-native/validation.js.map +1 -0
- package/dist/commands/sourcemaps/interfaces.d.ts +1 -0
- package/dist/commands/sourcemaps/interfaces.js +32 -20
- package/dist/commands/sourcemaps/interfaces.js.map +1 -1
- package/dist/commands/sourcemaps/renderer.js +1 -1
- package/dist/commands/sourcemaps/renderer.js.map +1 -1
- package/dist/commands/sourcemaps/upload.js +20 -14
- package/dist/commands/sourcemaps/upload.js.map +1 -1
- package/dist/commands/sourcemaps/utils.d.ts +0 -2
- package/dist/commands/sourcemaps/utils.js +1 -18
- package/dist/commands/sourcemaps/utils.js.map +1 -1
- package/dist/commands/sourcemaps/validation.js +3 -22
- package/dist/commands/sourcemaps/validation.js.map +1 -1
- package/dist/commands/trace/api.js +2 -2
- package/dist/commands/trace/api.js.map +1 -1
- package/dist/helpers/base-intake-url.d.ts +1 -0
- package/dist/helpers/base-intake-url.js +14 -0
- package/dist/helpers/base-intake-url.js.map +1 -0
- package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.d.ts +1 -0
- package/dist/{commands/sourcemaps/__tests__/git.test.js → helpers/git/__tests__/format-git-sourcemaps-data.test.js} +15 -71
- package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js.map +1 -0
- package/dist/helpers/git/__tests__/format-git-span-data.test.d.ts +1 -0
- package/dist/helpers/{__tests__/git.test.js → git/__tests__/format-git-span-data.test.js} +5 -5
- package/dist/helpers/git/__tests__/format-git-span-data.test.js.map +1 -0
- package/dist/helpers/git/__tests__/get-git-data.test.d.ts +1 -0
- package/dist/helpers/git/__tests__/get-git-data.test.js +60 -0
- package/dist/helpers/git/__tests__/get-git-data.test.js.map +1 -0
- package/dist/{commands/sourcemaps/git.d.ts → helpers/git/format-git-sourcemaps-data.d.ts} +2 -7
- package/dist/{commands/sourcemaps/git.js → helpers/git/format-git-sourcemaps-data.js} +9 -48
- package/dist/helpers/git/format-git-sourcemaps-data.js.map +1 -0
- package/dist/helpers/{git.d.ts → git/format-git-span-data.d.ts} +1 -1
- package/dist/helpers/{git.js → git/format-git-span-data.js} +8 -7
- package/dist/helpers/git/format-git-span-data.js.map +1 -0
- package/dist/helpers/git/get-git-data.d.ts +10 -0
- package/dist/helpers/git/get-git-data.js +60 -0
- package/dist/helpers/git/get-git-data.js.map +1 -0
- package/dist/helpers/metrics.js +0 -1
- package/dist/helpers/metrics.js.map +1 -1
- package/dist/helpers/utils.d.ts +1 -0
- package/dist/helpers/utils.js +8 -1
- package/dist/helpers/utils.js.map +1 -1
- package/dist/helpers/validation.d.ts +4 -0
- package/dist/helpers/validation.js +25 -0
- package/dist/helpers/validation.js.map +1 -0
- package/package.json +2 -2
- package/dist/commands/sourcemaps/__tests__/git.test.js.map +0 -1
- package/dist/commands/sourcemaps/git.js.map +0 -1
- package/dist/helpers/__tests__/git.test.js.map +0 -1
- package/dist/helpers/git.js.map +0 -1
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.validatePayload = exports.InvalidPayload = void 0;
|
|
7
|
-
const
|
|
4
|
+
const validation_1 = require("../../helpers/validation");
|
|
8
5
|
class InvalidPayload extends Error {
|
|
9
6
|
constructor(reason, message) {
|
|
10
7
|
super(message);
|
|
@@ -12,25 +9,9 @@ class InvalidPayload extends Error {
|
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
11
|
exports.InvalidPayload = InvalidPayload;
|
|
15
|
-
const checkFile = (path) => {
|
|
16
|
-
try {
|
|
17
|
-
const stats = fs_1.default.statSync(path);
|
|
18
|
-
if (stats.size === 0) {
|
|
19
|
-
return { exists: true, empty: true };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
if (error.code === 'ENOENT') {
|
|
24
|
-
return { exists: false, empty: false };
|
|
25
|
-
}
|
|
26
|
-
// Other kind of error
|
|
27
|
-
throw error;
|
|
28
|
-
}
|
|
29
|
-
return { exists: true, empty: false };
|
|
30
|
-
};
|
|
31
12
|
const validatePayload = (sourcemap) => {
|
|
32
13
|
// Check existence of sourcemap file
|
|
33
|
-
const sourcemapCheck = checkFile(sourcemap.sourcemapPath);
|
|
14
|
+
const sourcemapCheck = validation_1.checkFile(sourcemap.sourcemapPath);
|
|
34
15
|
if (!sourcemapCheck.exists) {
|
|
35
16
|
// This case should not happen as all collected sourcemaps should point to correct files
|
|
36
17
|
throw new InvalidPayload('missing_sourcemap', `Skipping missing sourcemap (${sourcemap.sourcemapPath})`);
|
|
@@ -39,7 +20,7 @@ const validatePayload = (sourcemap) => {
|
|
|
39
20
|
throw new InvalidPayload('empty_sourcemap', `Skipping empty sourcemap (${sourcemap.sourcemapPath})`);
|
|
40
21
|
}
|
|
41
22
|
// Check existence of minified file
|
|
42
|
-
const minifiedFileCheck = checkFile(sourcemap.minifiedFilePath);
|
|
23
|
+
const minifiedFileCheck = validation_1.checkFile(sourcemap.minifiedFilePath);
|
|
43
24
|
if (!minifiedFileCheck.exists) {
|
|
44
25
|
throw new InvalidPayload('missing_js', `Missing corresponding JS file for sourcemap (${sourcemap.minifiedFilePath})`);
|
|
45
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/commands/sourcemaps/validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/commands/sourcemaps/validation.ts"],"names":[],"mappings":";;;AAAA,yDAAkD;AAGlD,MAAa,cAAe,SAAQ,KAAK;IAGvC,YAAY,MAAc,EAAE,OAAgB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AAPD,wCAOC;AAEM,MAAM,eAAe,GAAG,CAAC,SAAoB,EAAE,EAAE;IACtD,oCAAoC;IACpC,MAAM,cAAc,GAAG,sBAAS,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IACzD,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QAC1B,wFAAwF;QACxF,MAAM,IAAI,cAAc,CAAC,mBAAmB,EAAE,+BAA+B,SAAS,CAAC,aAAa,GAAG,CAAC,CAAA;KACzG;IACD,IAAI,cAAc,CAAC,KAAK,EAAE;QACxB,MAAM,IAAI,cAAc,CAAC,iBAAiB,EAAE,6BAA6B,SAAS,CAAC,aAAa,GAAG,CAAC,CAAA;KACrG;IACD,mCAAmC;IACnC,MAAM,iBAAiB,GAAG,sBAAS,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;IAC/D,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE;QAC7B,MAAM,IAAI,cAAc,CACtB,YAAY,EACZ,gDAAgD,SAAS,CAAC,gBAAgB,GAAG,CAC9E,CAAA;KACF;IACD,IAAI,iBAAiB,CAAC,KAAK,EAAE;QAC3B,MAAM,IAAI,cAAc,CACtB,UAAU,EACV,uBAAuB,SAAS,CAAC,aAAa,YAAY,SAAS,CAAC,gBAAgB,cAAc,CACnG,CAAA;KACF;AACH,CAAC,CAAA;AAxBY,QAAA,eAAe,mBAwB3B"}
|
|
@@ -10,14 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.apiConstructor = exports.reportCustomSpan = void 0;
|
|
13
|
-
const
|
|
13
|
+
const format_git_span_data_1 = require("../../helpers/git/format-git-span-data");
|
|
14
14
|
const user_provided_git_1 = require("../../helpers/user-provided-git");
|
|
15
15
|
const utils_1 = require("../../helpers/utils");
|
|
16
16
|
// Dependency follows-redirects sets a default maxBodyLength of 10 MB https://github.com/follow-redirects/follow-redirects/blob/b774a77e582b97174813b3eaeb86931becba69db/index.js#L391
|
|
17
17
|
// We don't want any hard limit enforced by the CLI, the backend will enforce a max size by returning 413 errors.
|
|
18
18
|
const maxBodyLength = Infinity;
|
|
19
19
|
const reportCustomSpan = (request) => (customSpan, provider) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const gitSpanTags = yield
|
|
20
|
+
const gitSpanTags = yield format_git_span_data_1.getGitMetadata();
|
|
21
21
|
const userGitSpanTags = user_provided_git_1.getUserGitSpanTags();
|
|
22
22
|
return request({
|
|
23
23
|
data: Object.assign(Object.assign({}, customSpan), { tags: Object.assign(Object.assign(Object.assign({}, gitSpanTags), userGitSpanTags), customSpan.tags) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/commands/trace/api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/commands/trace/api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,iFAAqE;AACrE,uEAAkE;AAClE,+CAAqD;AAGrD,sLAAsL;AACtL,iHAAiH;AACjH,MAAM,aAAa,GAAG,QAAQ,CAAA;AAEvB,MAAM,gBAAgB,GAAG,CAAC,OAAkE,EAAE,EAAE,CAAC,CACtG,UAAmB,EACnB,QAAgB,EAChB,EAAE;IACF,MAAM,WAAW,GAAG,MAAM,qCAAc,EAAE,CAAA;IAC1C,MAAM,eAAe,GAAG,sCAAkB,EAAE,CAAA;IAE5C,OAAO,OAAO,CAAC;QACb,IAAI,kCACC,UAAU,KACb,IAAI,gDACC,WAAW,GACX,eAAe,GACf,UAAU,CAAC,IAAI,IAErB;QACD,OAAO,EAAE;YACP,2BAA2B,EAAE,QAAQ;SACtC;QACD,aAAa;QACb,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,gBAAgB;KACtB,CAAC,CAAA;AACJ,CAAC,CAAA,CAAA;AAvBY,QAAA,gBAAgB,oBAuB5B;AAEM,MAAM,cAAc,GAAG,CAAC,OAAe,EAAE,MAAc,EAAE,EAAE;IAChE,MAAM,aAAa,GAAG,yBAAiB,CAAC,EAAC,OAAO,EAAE,MAAM,EAAC,CAAC,CAAA;IAE1D,OAAO;QACL,gBAAgB,EAAE,wBAAgB,CAAC,aAAa,CAAC;KAClD,CAAA;AACH,CAAC,CAAA;AANY,QAAA,cAAc,kBAM1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBaseSourcemapIntakeUrl: () => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBaseSourcemapIntakeUrl = void 0;
|
|
4
|
+
const getBaseSourcemapIntakeUrl = () => {
|
|
5
|
+
if (process.env.DATADOG_SOURCEMAP_INTAKE_URL) {
|
|
6
|
+
return process.env.DATADOG_SOURCEMAP_INTAKE_URL;
|
|
7
|
+
}
|
|
8
|
+
else if (process.env.DATADOG_SITE) {
|
|
9
|
+
return 'https://sourcemap-intake.' + process.env.DATADOG_SITE;
|
|
10
|
+
}
|
|
11
|
+
return 'https://sourcemap-intake.datadoghq.com';
|
|
12
|
+
};
|
|
13
|
+
exports.getBaseSourcemapIntakeUrl = getBaseSourcemapIntakeUrl;
|
|
14
|
+
//# sourceMappingURL=base-intake-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-intake-url.js","sourceRoot":"","sources":["../../src/helpers/base-intake-url.ts"],"names":[],"mappings":";;;AAAO,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE;QAC5C,OAAO,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAA;KAChD;SAAM,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;QACnC,OAAO,2BAA2B,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAA;KAC9D;IAED,OAAO,wCAAwC,CAAA;AACjD,CAAC,CAAA;AARY,QAAA,yBAAyB,6BAQrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,83 +9,38 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
12
|
+
const format_git_sourcemaps_data_1 = require("../format-git-sourcemaps-data");
|
|
13
13
|
describe('git', () => {
|
|
14
|
-
describe('gitRemote', () => {
|
|
15
|
-
const createMockSimpleGit = (remotes) => ({
|
|
16
|
-
getRemotes: (arg) => remotes,
|
|
17
|
-
});
|
|
18
|
-
test('should choose the remote named origin', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const mock = createMockSimpleGit([
|
|
20
|
-
{ name: 'first', refs: { push: 'remote1' } },
|
|
21
|
-
{ name: 'origin', refs: { push: 'remote2' } },
|
|
22
|
-
]);
|
|
23
|
-
const remote = yield git_1.gitRemote(mock);
|
|
24
|
-
expect(remote).toBe('remote2');
|
|
25
|
-
}));
|
|
26
|
-
test('should choose the first remote', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
const mock = createMockSimpleGit([
|
|
28
|
-
{ name: 'first', refs: { push: 'remote1' } },
|
|
29
|
-
{ name: 'second', refs: { push: 'remote2' } },
|
|
30
|
-
]);
|
|
31
|
-
const remote = yield git_1.gitRemote(mock);
|
|
32
|
-
expect(remote).toBe('remote1');
|
|
33
|
-
}));
|
|
34
|
-
});
|
|
35
|
-
describe('stripCredentials: git protocol', () => {
|
|
36
|
-
test('should return the same value', () => {
|
|
37
|
-
const input = 'git@github.com:user/project.git';
|
|
38
|
-
expect(git_1.stripCredentials(input)).toBe(input);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
describe('stripCredentials: nothing to remove', () => {
|
|
42
|
-
test('should return the same value', () => {
|
|
43
|
-
const input = 'https://gitlab.com/user/project.git';
|
|
44
|
-
expect(git_1.stripCredentials(input)).toBe(input);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
describe('stripCredentials: user:pwd', () => {
|
|
48
|
-
test('should return without credentials', () => {
|
|
49
|
-
const input = 'https://token:[MASKED]@gitlab.com/user/project.git';
|
|
50
|
-
expect(git_1.stripCredentials(input)).toBe('https://gitlab.com/user/project.git');
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
describe('stripCredentials: token', () => {
|
|
54
|
-
test('should return without credentials', () => {
|
|
55
|
-
const input = 'https://token@gitlab.com/user/project.git';
|
|
56
|
-
expect(git_1.stripCredentials(input)).toBe('https://gitlab.com/user/project.git');
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
14
|
describe('TrackedFilesMatcher', () => {
|
|
60
15
|
describe('related cases', () => {
|
|
61
16
|
test('related path', () => {
|
|
62
17
|
const sources = ['webpack:///./src/file.ts'];
|
|
63
18
|
const trackedFiles = ['src/file.ts'];
|
|
64
|
-
const matcher = new
|
|
19
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
65
20
|
expect(matcher.matchSources(sources)).toStrictEqual(trackedFiles);
|
|
66
21
|
});
|
|
67
22
|
test('related path in another folder', () => {
|
|
68
23
|
const sources = ['webpack:///./src/file.ts'];
|
|
69
24
|
const trackedFiles = ['path/to/file.ts'];
|
|
70
|
-
const matcher = new
|
|
25
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
71
26
|
expect(matcher.matchSources(sources)).toStrictEqual(trackedFiles);
|
|
72
27
|
});
|
|
73
28
|
test('related path with query parameter', () => {
|
|
74
29
|
const sources = ['file.ts?abc123'];
|
|
75
30
|
const trackedFiles = ['src/file.ts'];
|
|
76
|
-
const matcher = new
|
|
31
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
77
32
|
expect(matcher.matchSources(sources)).toStrictEqual(trackedFiles);
|
|
78
33
|
});
|
|
79
34
|
test('related path with legit question mark', () => {
|
|
80
35
|
const sources = ['file.ts?abc123'];
|
|
81
36
|
const trackedFiles = ['src/file.ts?abc123'];
|
|
82
|
-
const matcher = new
|
|
37
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
83
38
|
expect(matcher.matchSources(sources)).toStrictEqual(trackedFiles);
|
|
84
39
|
});
|
|
85
40
|
test('related hidden file', () => {
|
|
86
41
|
const sources = ['src/.file.ts'];
|
|
87
42
|
const trackedFiles = ['folder/.file.ts'];
|
|
88
|
-
const matcher = new
|
|
43
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
89
44
|
expect(matcher.matchSources(sources)).toStrictEqual(trackedFiles);
|
|
90
45
|
});
|
|
91
46
|
});
|
|
@@ -93,7 +48,7 @@ describe('git', () => {
|
|
|
93
48
|
test('not related', () => {
|
|
94
49
|
const sources = ['folder/other.ts'];
|
|
95
50
|
const trackedFiles = ['src/file.ts'];
|
|
96
|
-
const matcher = new
|
|
51
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
97
52
|
expect(matcher.matchSources(sources)).toHaveLength(0);
|
|
98
53
|
});
|
|
99
54
|
});
|
|
@@ -103,60 +58,49 @@ describe('git', () => {
|
|
|
103
58
|
'webpack:///./.yarn/cache/testfile.js-npm-1.2.3-abc1234567-abc1234567.zip/node_modules/testfile.js/testfile.js',
|
|
104
59
|
];
|
|
105
60
|
const trackedFiles = ['.yarn/cache/testfile.js-npm-1.1.1-abc1234567-abc1234567.zip'];
|
|
106
|
-
const matcher = new
|
|
61
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
107
62
|
expect(matcher.matchSources(sources)).toHaveLength(0);
|
|
108
63
|
});
|
|
109
64
|
test('multiple related tracked files from one source', () => {
|
|
110
65
|
const sources = ['webpack:///./src/file.ts'];
|
|
111
66
|
const trackedFiles = ['src/file.ts', 'src/commands/sourcemaps/file.ts', 'other'];
|
|
112
|
-
const matcher = new
|
|
67
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
113
68
|
expect(matcher.matchSources(sources)).toStrictEqual(['src/file.ts', 'src/commands/sourcemaps/file.ts']);
|
|
114
69
|
});
|
|
115
70
|
test('mix of related and not related', () => {
|
|
116
71
|
const sources = ['folder/file.ts', 'folder/other.ts'];
|
|
117
72
|
const trackedFiles = ['src/file.ts', 'file.ts', 'src/other2.ts'];
|
|
118
|
-
const matcher = new
|
|
73
|
+
const matcher = new format_git_sourcemaps_data_1.TrackedFilesMatcher(trackedFiles);
|
|
119
74
|
expect(matcher.matchSources(sources)).toStrictEqual(['src/file.ts', 'file.ts']);
|
|
120
75
|
});
|
|
121
76
|
});
|
|
122
77
|
});
|
|
123
78
|
describe('GetRepositoryData', () => {
|
|
124
|
-
const createMockStdout = () => {
|
|
125
|
-
let data = '';
|
|
126
|
-
return {
|
|
127
|
-
toString: () => data,
|
|
128
|
-
write: (input) => {
|
|
129
|
-
data += input;
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
79
|
const createMockSimpleGit = () => ({
|
|
134
80
|
getRemotes: (arg) => [{ refs: { push: 'git@github.com:user/repository.git' } }],
|
|
135
81
|
raw: (arg) => 'src/commands/sourcemaps/__tests__/git.test.ts',
|
|
136
82
|
revparse: (arg) => '25da22df90210a40b919debe3f7ebfb0c1811898',
|
|
137
83
|
});
|
|
138
84
|
test('integration', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
139
|
-
const
|
|
140
|
-
const data = yield git_1.getRepositoryData(createMockSimpleGit(), stdout, '');
|
|
85
|
+
const data = yield format_git_sourcemaps_data_1.getRepositoryData(createMockSimpleGit(), '');
|
|
141
86
|
if (!data) {
|
|
142
87
|
fail('data should not be undefined');
|
|
143
88
|
}
|
|
144
|
-
const files = data.trackedFilesMatcher.matchSourcemap(
|
|
89
|
+
const files = data.trackedFilesMatcher.matchSourcemap('src/commands/sourcemaps/__tests__/fixtures/basic/common.min.js.map', () => undefined);
|
|
145
90
|
expect(data.remote).toBe('git@github.com:user/repository.git');
|
|
146
91
|
expect(data.hash).toBe('25da22df90210a40b919debe3f7ebfb0c1811898');
|
|
147
92
|
expect(files).toStrictEqual(['src/commands/sourcemaps/__tests__/git.test.ts']);
|
|
148
93
|
}));
|
|
149
94
|
test('integration: remote override', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
150
|
-
const
|
|
151
|
-
const data = yield git_1.getRepositoryData(createMockSimpleGit(), stdout, 'git@github.com:user/other.git');
|
|
95
|
+
const data = yield format_git_sourcemaps_data_1.getRepositoryData(createMockSimpleGit(), 'git@github.com:user/other.git');
|
|
152
96
|
if (!data) {
|
|
153
97
|
fail('data should not be undefined');
|
|
154
98
|
}
|
|
155
|
-
const files = data.trackedFilesMatcher.matchSourcemap(
|
|
99
|
+
const files = data.trackedFilesMatcher.matchSourcemap('src/commands/sourcemaps/__tests__/fixtures/basic/common.min.js.map', () => undefined);
|
|
156
100
|
expect(data.remote).toBe('git@github.com:user/other.git');
|
|
157
101
|
expect(data.hash).toBe('25da22df90210a40b919debe3f7ebfb0c1811898');
|
|
158
102
|
expect(files).toStrictEqual(['src/commands/sourcemaps/__tests__/git.test.ts']);
|
|
159
103
|
}));
|
|
160
104
|
});
|
|
161
105
|
});
|
|
162
|
-
//# sourceMappingURL=git.test.js.map
|
|
106
|
+
//# sourceMappingURL=format-git-sourcemaps-data.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-git-sourcemaps-data.test.js","sourceRoot":"","sources":["../../../../src/helpers/git/__tests__/format-git-sourcemaps-data.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAA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C,CAAA,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,8 +13,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const simple_git_1 = __importDefault(require("simple-git"));
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const tags_1 = require("../../tags");
|
|
17
|
+
const format_git_span_data_1 = require("../format-git-span-data");
|
|
18
18
|
jest.mock('simple-git');
|
|
19
19
|
describe('getGitMetadata', () => {
|
|
20
20
|
it('reads git metadata successfully', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -30,7 +30,7 @@ describe('getGitMetadata', () => {
|
|
|
30
30
|
return 'authorName,authorEmail,authorDate,committerName,committerEmail,committerDate';
|
|
31
31
|
},
|
|
32
32
|
}));
|
|
33
|
-
const result = yield
|
|
33
|
+
const result = yield format_git_span_data_1.getGitMetadata();
|
|
34
34
|
expect(result).toEqual({
|
|
35
35
|
[tags_1.GIT_REPOSITORY_URL]: 'repository_url',
|
|
36
36
|
[tags_1.GIT_BRANCH]: 'main',
|
|
@@ -60,8 +60,8 @@ describe('getGitMetadata', () => {
|
|
|
60
60
|
throw new Error();
|
|
61
61
|
},
|
|
62
62
|
}));
|
|
63
|
-
const result = yield
|
|
63
|
+
const result = yield format_git_span_data_1.getGitMetadata();
|
|
64
64
|
expect(result).toEqual({});
|
|
65
65
|
}));
|
|
66
66
|
});
|
|
67
|
-
//# sourceMappingURL=git.test.js.map
|
|
67
|
+
//# sourceMappingURL=format-git-span-data.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-git-span-data.test.js","sourceRoot":"","sources":["../../../../src/helpers/git/__tests__/format-git-span-data.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,4DAAkC;AAElC,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,EAAE,CAAC,CAAC;YAC5C,MAAM,EAAE,GAAG,EAAE;gBACX,MAAM,IAAI,KAAK,EAAE,CAAA;YACnB,CAAC;YACD,UAAU,EAAE,GAAG,EAAE;gBACf,MAAM,IAAI,KAAK,EAAE,CAAA;YACnB,CAAC;YACD,QAAQ,EAAE,GAAG,EAAE;gBACb,MAAM,IAAI,KAAK,EAAE,CAAA;YACnB,CAAC;YACD,IAAI,EAAE,GAAG,EAAE;gBACT,MAAM,IAAI,KAAK,EAAE,CAAA;YACnB,CAAC;SACF,CAAC,CAAC,CAAA;QACH,MAAM,MAAM,GAAG,MAAM,qCAAc,EAAE,CAAA;QACrC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC5B,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const get_git_data_1 = require("../get-git-data");
|
|
13
|
+
describe('git', () => {
|
|
14
|
+
describe('gitRemote', () => {
|
|
15
|
+
const createMockSimpleGit = (remotes) => ({
|
|
16
|
+
getRemotes: (arg) => remotes,
|
|
17
|
+
});
|
|
18
|
+
test('should choose the remote named origin', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const mock = createMockSimpleGit([
|
|
20
|
+
{ name: 'first', refs: { push: 'remote1' } },
|
|
21
|
+
{ name: 'origin', refs: { push: 'remote2' } },
|
|
22
|
+
]);
|
|
23
|
+
const remote = yield get_git_data_1.gitRemote(mock);
|
|
24
|
+
expect(remote).toBe('remote2');
|
|
25
|
+
}));
|
|
26
|
+
test('should choose the first remote', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
const mock = createMockSimpleGit([
|
|
28
|
+
{ name: 'first', refs: { push: 'remote1' } },
|
|
29
|
+
{ name: 'second', refs: { push: 'remote2' } },
|
|
30
|
+
]);
|
|
31
|
+
const remote = yield get_git_data_1.gitRemote(mock);
|
|
32
|
+
expect(remote).toBe('remote1');
|
|
33
|
+
}));
|
|
34
|
+
});
|
|
35
|
+
describe('stripCredentials: git protocol', () => {
|
|
36
|
+
test('should return the same value', () => {
|
|
37
|
+
const input = 'git@github.com:user/project.git';
|
|
38
|
+
expect(get_git_data_1.stripCredentials(input)).toBe(input);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe('stripCredentials: nothing to remove', () => {
|
|
42
|
+
test('should return the same value', () => {
|
|
43
|
+
const input = 'https://gitlab.com/user/project.git';
|
|
44
|
+
expect(get_git_data_1.stripCredentials(input)).toBe(input);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('stripCredentials: user:pwd', () => {
|
|
48
|
+
test('should return without credentials', () => {
|
|
49
|
+
const input = 'https://token:[MASKED]@gitlab.com/user/project.git';
|
|
50
|
+
expect(get_git_data_1.stripCredentials(input)).toBe('https://gitlab.com/user/project.git');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe('stripCredentials: token', () => {
|
|
54
|
+
test('should return without credentials', () => {
|
|
55
|
+
const input = 'https://token@gitlab.com/user/project.git';
|
|
56
|
+
expect(get_git_data_1.stripCredentials(input)).toBe('https://gitlab.com/user/project.git');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=get-git-data.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-git-data.test.js","sourceRoot":"","sources":["../../../../src/helpers/git/__tests__/get-git-data.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,kDAA2D;AAE3D,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACnB,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;QACzB,MAAM,mBAAmB,GAAG,CAAC,OAAc,EAAE,EAAE,CAAC,CAAC;YAC/C,UAAU,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,OAAO;SACtC,CAAC,CAAA;QAEF,IAAI,CAAC,uCAAuC,EAAE,GAAS,EAAE;YACvD,MAAM,IAAI,GAAG,mBAAmB,CAAC;gBAC/B,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC,EAAC;gBACxC,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC,EAAC;aAC1C,CAAQ,CAAA;YACT,MAAM,MAAM,GAAG,MAAM,wBAAS,CAAC,IAAI,CAAC,CAAA;YAEpC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAChC,CAAC,CAAA,CAAC,CAAA;QACF,IAAI,CAAC,gCAAgC,EAAE,GAAS,EAAE;YAChD,MAAM,IAAI,GAAG,mBAAmB,CAAC;gBAC/B,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC,EAAC;gBACxC,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC,EAAC;aAC1C,CAAQ,CAAA;YACT,MAAM,MAAM,GAAG,MAAM,wBAAS,CAAC,I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
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as simpleGit from 'simple-git';
|
|
3
|
-
import { Writable } from 'stream';
|
|
4
2
|
export declare const newSimpleGit: () => Promise<simpleGit.SimpleGit>;
|
|
5
|
-
export declare const gitRemote: (git: simpleGit.SimpleGit) => Promise<string>;
|
|
6
|
-
export declare const stripCredentials: (remote: string) => string;
|
|
7
|
-
export declare const gitTrackedFiles: (git: simpleGit.SimpleGit) => Promise<string[]>;
|
|
8
3
|
export interface RepositoryData {
|
|
9
4
|
hash: string;
|
|
10
5
|
remote: string;
|
|
11
6
|
trackedFilesMatcher: TrackedFilesMatcher;
|
|
12
7
|
}
|
|
13
|
-
export declare const getRepositoryData: (git: simpleGit.SimpleGit,
|
|
8
|
+
export declare const getRepositoryData: (git: simpleGit.SimpleGit, repositoryURL: string | undefined) => Promise<RepositoryData>;
|
|
14
9
|
export declare class TrackedFilesMatcher {
|
|
15
10
|
private trackedFilenames;
|
|
16
11
|
constructor(trackedFiles: string[]);
|
|
17
|
-
matchSourcemap(
|
|
12
|
+
matchSourcemap(srcmapPath: string, onSourcesNotFound: () => void): string[] | undefined;
|
|
18
13
|
matchSources(sources: string[]): string[];
|
|
19
14
|
private getFilename;
|
|
20
15
|
}
|
|
@@ -31,11 +31,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.TrackedFilesMatcher = exports.getRepositoryData = exports.
|
|
34
|
+
exports.TrackedFilesMatcher = exports.getRepositoryData = exports.newSimpleGit = void 0;
|
|
35
35
|
const fs_1 = __importDefault(require("fs"));
|
|
36
36
|
const simpleGit = __importStar(require("simple-git"));
|
|
37
|
-
const
|
|
38
|
-
const renderer_1 = require("./renderer");
|
|
37
|
+
const get_git_data_1 = require("./get-git-data");
|
|
39
38
|
// Returns a configured SimpleGit.
|
|
40
39
|
const newSimpleGit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
40
|
const options = {
|
|
@@ -57,47 +56,10 @@ const newSimpleGit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
57
56
|
return simpleGit.gitP(options);
|
|
58
57
|
});
|
|
59
58
|
exports.newSimpleGit = newSimpleGit;
|
|
60
|
-
// Returns the remote of the current repository.
|
|
61
|
-
const gitRemote = (git) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
const remotes = yield git.getRemotes(true);
|
|
63
|
-
if (remotes.length === 0) {
|
|
64
|
-
throw new Error('No git remotes available');
|
|
65
|
-
}
|
|
66
|
-
for (const remote of remotes) {
|
|
67
|
-
// We're trying to pick the remote called with the default git name 'origin'.
|
|
68
|
-
if (remote.name === 'origin') {
|
|
69
|
-
return exports.stripCredentials(remote.refs.push);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// Falling back to picking the first remote in the list if 'origin' is not found.
|
|
73
|
-
return exports.stripCredentials(remotes[0].refs.push);
|
|
74
|
-
});
|
|
75
|
-
exports.gitRemote = gitRemote;
|
|
76
|
-
// StripCredentials removes credentials from a remote HTTP url.
|
|
77
|
-
const stripCredentials = (remote) => {
|
|
78
|
-
try {
|
|
79
|
-
const url = new url_1.URL(remote);
|
|
80
|
-
url.username = '';
|
|
81
|
-
url.password = '';
|
|
82
|
-
return url.toString();
|
|
83
|
-
}
|
|
84
|
-
catch (_a) {
|
|
85
|
-
return remote;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
exports.stripCredentials = stripCredentials;
|
|
89
|
-
// Returns the hash of the current repository.
|
|
90
|
-
const gitHash = (git) => __awaiter(void 0, void 0, void 0, function* () { return git.revparse('HEAD'); });
|
|
91
|
-
// Returns the tracked files of the current repository.
|
|
92
|
-
const gitTrackedFiles = (git) => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
-
const files = yield git.raw('ls-files');
|
|
94
|
-
return files.split(/\r\n|\r|\n/);
|
|
95
|
-
});
|
|
96
|
-
exports.gitTrackedFiles = gitTrackedFiles;
|
|
97
59
|
// Returns the current hash and remote as well as a TrackedFilesMatcher.
|
|
98
60
|
//
|
|
99
61
|
// To obtain the list of tracked files paths tied to a specific sourcemap, invoke the 'matchSourcemap' methid.
|
|
100
|
-
const getRepositoryData = (git,
|
|
62
|
+
const getRepositoryData = (git, repositoryURL) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
63
|
// Invoke git commands to retrieve the remote, hash and tracked files.
|
|
102
64
|
// We're using Promise.all instead of Promive.allSettled since we want to fail early if
|
|
103
65
|
// any of the promises fails.
|
|
@@ -107,17 +69,16 @@ const getRepositoryData = (git, stdout, repositoryURL) => __awaiter(void 0, void
|
|
|
107
69
|
try {
|
|
108
70
|
if (repositoryURL) {
|
|
109
71
|
;
|
|
110
|
-
[hash, trackedFiles] = yield Promise.all([gitHash(git),
|
|
72
|
+
[hash, trackedFiles] = yield Promise.all([get_git_data_1.gitHash(git), get_git_data_1.gitTrackedFiles(git)]);
|
|
111
73
|
remote = repositoryURL;
|
|
112
74
|
}
|
|
113
75
|
else {
|
|
114
76
|
;
|
|
115
|
-
[remote, hash, trackedFiles] = yield Promise.all([
|
|
77
|
+
[remote, hash, trackedFiles] = yield Promise.all([get_git_data_1.gitRemote(git), get_git_data_1.gitHash(git), get_git_data_1.gitTrackedFiles(git)]);
|
|
116
78
|
}
|
|
117
79
|
}
|
|
118
80
|
catch (e) {
|
|
119
|
-
|
|
120
|
-
return undefined;
|
|
81
|
+
throw e;
|
|
121
82
|
}
|
|
122
83
|
const data = {
|
|
123
84
|
hash,
|
|
@@ -147,7 +108,7 @@ class TrackedFilesMatcher {
|
|
|
147
108
|
}
|
|
148
109
|
}
|
|
149
110
|
// Looks up the sources declared in the sourcemap and return a list of related tracked files.
|
|
150
|
-
matchSourcemap(
|
|
111
|
+
matchSourcemap(srcmapPath, onSourcesNotFound) {
|
|
151
112
|
const buff = fs_1.default.readFileSync(srcmapPath, 'utf8');
|
|
152
113
|
const srcmapObj = JSON.parse(buff);
|
|
153
114
|
if (!srcmapObj.sources) {
|
|
@@ -159,7 +120,7 @@ class TrackedFilesMatcher {
|
|
|
159
120
|
}
|
|
160
121
|
const filtered = this.matchSources(sources);
|
|
161
122
|
if (filtered.length === 0) {
|
|
162
|
-
|
|
123
|
+
onSourcesNotFound();
|
|
163
124
|
return undefined;
|
|
164
125
|
}
|
|
165
126
|
return filtered;
|
|
@@ -207,4 +168,4 @@ class TrackedFilesMatcher {
|
|
|
207
168
|
}
|
|
208
169
|
}
|
|
209
170
|
exports.TrackedFilesMatcher = TrackedFilesMatcher;
|
|
210
|
-
//# sourceMappingURL=git.js.map
|
|
171
|
+
//# sourceMappingURL=format-git-sourcemaps-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-git-sourcemaps-data.js","sourceRoot":"","sources":["../../../src/helpers/git/format-git-sourcemaps-data.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAmB;AACnB,sDAAuC;AACvC,iDAAkE;AAElE,kCAAkC;AAC3B,MAAM,YAAY,GAAG,GAAuC,EAAE;IACnE,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;QACtB,MAAM,EAAE,KAAK;QACb,2DAA2D;QAC3D,sBAAsB,EAAE,CAAC;KAC1B,CAAA;IACD,IAAI;QACF,yFAAyF;QACzF,0EAA0E;QAC1E,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACnC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAA;QAClD,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;KACvB;IAAC,WAAM;QACN,0EAA0E;KAC3E;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AAChC,C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BACxC,SAAQ;aACT;YACD,sBAAsB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACpC,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACxD,IAAI,YAAY,EAAE;gBAChB,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;aACzC;SACF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,oCAAoC;IACpC,EAAE;IACF,2FAA2F;IAC3F,8FAA8F;IAC9F,0CAA0C;IAC1C,gGAAgG;IAChG,0FAA0F;IAC1F,oFAAoF;IACpF,4FAA4F;IAC5F,kDAAkD;IAClD,sDAAsD;IAC9C,WAAW,CAAC,CAAS;QAC3B,IAAI,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;QAC9B,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,KAAK,GAAG,CAAC,CAAA;SACV;aAAM;YACL,KAAK,EAAE,CAAA;SACR;QACD,IAAI,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;QAC5B,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,IAAI,KAAK,EAAE;YAC9B,GAAG,GAAG,CAAC,CAAC,MAAM,CAAA;SACf;QAED,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAChC,CAAC;CACF;AAjFD,kDAiFC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SpanTags } from '
|
|
1
|
+
import type { SpanTags } from '../interfaces';
|
|
2
2
|
export declare const getGitMetadata: () => Promise<SpanTags>;
|
|
@@ -14,7 +14,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.getGitMetadata = void 0;
|
|
16
16
|
const simple_git_1 = __importDefault(require("simple-git"));
|
|
17
|
-
const tags_1 = require("
|
|
17
|
+
const tags_1 = require("../tags");
|
|
18
|
+
const get_git_data_1 = require("./get-git-data");
|
|
18
19
|
const getGitMetadata = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
20
|
try {
|
|
20
21
|
const git = simple_git_1.default({
|
|
@@ -24,11 +25,11 @@ const getGitMetadata = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
24
25
|
maxConcurrentProcesses: 5,
|
|
25
26
|
});
|
|
26
27
|
const [commitSHA, branch, repositoryUrl, message, authorAndCommitter] = yield Promise.all([
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
get_git_data_1.gitHash(git),
|
|
29
|
+
get_git_data_1.gitBranch(git),
|
|
30
|
+
get_git_data_1.gitRepositoryURL(git),
|
|
31
|
+
get_git_data_1.gitMessage(git),
|
|
32
|
+
get_git_data_1.gitAuthorAndCommitter(git),
|
|
32
33
|
]);
|
|
33
34
|
const [authorName, authorEmail, authorDate, committerName, committerEmail, committerDate,] = authorAndCommitter.split(',');
|
|
34
35
|
return {
|
|
@@ -49,4 +50,4 @@ const getGitMetadata = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
exports.getGitMetadata = getGitMetadata;
|
|
52
|
-
//# sourceMappingURL=git.js.map
|
|
53
|
+
//# sourceMappingURL=format-git-span-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-git-span-data.js","sourceRoot":"","sources":["../../../src/helpers/git/format-git-span-data.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAAkC;AAGlC,kCAWgB;AAChB,iDAAsG;AAE/F,MAAM,cAAc,GAAG,GAA4B,EAAE;IAC1D,IAAI;QACF,MAAM,GAAG,GAAG,oBAAS,CAAC;YACpB,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;YACtB,MAAM,EAAE,KAAK;YAC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
import { BranchSummary } from 'simple-git';
|
|
3
|
+
export declare const gitRemote: (git: simpleGit.SimpleGit) => Promise<string>;
|
|
4
|
+
export declare const stripCredentials: (remote: string) => string;
|
|
5
|
+
export declare const gitHash: (git: simpleGit.SimpleGit) => Promise<string>;
|
|
6
|
+
export declare const gitTrackedFiles: (git: simpleGit.SimpleGit) => Promise<string[]>;
|
|
7
|
+
export declare const gitBranch: (git: simpleGit.SimpleGit) => Promise<BranchSummary>;
|
|
8
|
+
export declare const gitMessage: (git: simpleGit.SimpleGit) => Promise<string>;
|
|
9
|
+
export declare const gitAuthorAndCommitter: (git: simpleGit.SimpleGit) => Promise<string>;
|
|
10
|
+
export declare const gitRepositoryURL: (git: simpleGit.SimpleGit) => Promise<string>;
|