danger 10.7.0 → 11.0.2
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/.prettierignore +1 -0
- package/.release-it.json +1 -1
- package/CHANGELOG.md +25 -0
- package/distribution/api/fetch.js +12 -12
- package/distribution/api/fetch.js.map +1 -1
- package/distribution/ci_source/ci_source_helpers.js +3 -3
- package/distribution/ci_source/ci_source_helpers.js.map +1 -1
- package/distribution/ci_source/get_ci_source.js +12 -10
- package/distribution/ci_source/get_ci_source.js.map +1 -1
- package/distribution/ci_source/providers/AppCenter.js +6 -6
- package/distribution/ci_source/providers/AppCenter.js.map +1 -1
- package/distribution/ci_source/providers/Bamboo.js +4 -4
- package/distribution/ci_source/providers/Bamboo.js.map +1 -1
- package/distribution/ci_source/providers/BitbucketPipelines.js +3 -3
- package/distribution/ci_source/providers/BitbucketPipelines.js.map +1 -1
- package/distribution/ci_source/providers/Bitrise.js +3 -3
- package/distribution/ci_source/providers/Bitrise.js.map +1 -1
- package/distribution/ci_source/providers/BuddyBuild.js +2 -2
- package/distribution/ci_source/providers/BuddyBuild.js.map +1 -1
- package/distribution/ci_source/providers/BuddyWorks.js +2 -2
- package/distribution/ci_source/providers/BuddyWorks.js.map +1 -1
- package/distribution/ci_source/providers/Buildkite.js +2 -2
- package/distribution/ci_source/providers/Buildkite.js.map +1 -1
- package/distribution/ci_source/providers/Circle.js +4 -4
- package/distribution/ci_source/providers/Circle.js.map +1 -1
- package/distribution/ci_source/providers/Cirrus.js +3 -3
- package/distribution/ci_source/providers/Cirrus.js.map +1 -1
- package/distribution/ci_source/providers/CodeBuild.js +3 -3
- package/distribution/ci_source/providers/CodeBuild.js.map +1 -1
- package/distribution/ci_source/providers/Codefresh.js +4 -4
- package/distribution/ci_source/providers/Codefresh.js.map +1 -1
- package/distribution/ci_source/providers/Codemagic.js +4 -4
- package/distribution/ci_source/providers/Codemagic.js.map +1 -1
- package/distribution/ci_source/providers/Codeship.js +3 -3
- package/distribution/ci_source/providers/Codeship.js.map +1 -1
- package/distribution/ci_source/providers/Concourse.js +2 -2
- package/distribution/ci_source/providers/Concourse.js.map +1 -1
- package/distribution/ci_source/providers/DockerCloud.js +4 -4
- package/distribution/ci_source/providers/DockerCloud.js.map +1 -1
- package/distribution/ci_source/providers/Drone.js +2 -2
- package/distribution/ci_source/providers/Drone.js.map +1 -1
- package/distribution/ci_source/providers/Fake.js +4 -4
- package/distribution/ci_source/providers/Fake.js.map +1 -1
- package/distribution/ci_source/providers/GitHubActions.js +3 -3
- package/distribution/ci_source/providers/GitHubActions.js.map +1 -1
- package/distribution/ci_source/providers/GitLabCI.js +2 -2
- package/distribution/ci_source/providers/GitLabCI.js.map +1 -1
- package/distribution/ci_source/providers/Jenkins.js +6 -6
- package/distribution/ci_source/providers/Jenkins.js.map +1 -1
- package/distribution/ci_source/providers/Netlify.js +2 -2
- package/distribution/ci_source/providers/Netlify.js.map +1 -1
- package/distribution/ci_source/providers/Nevercode.js +3 -3
- package/distribution/ci_source/providers/Nevercode.js.map +1 -1
- package/distribution/ci_source/providers/Screwdriver.js +2 -2
- package/distribution/ci_source/providers/Screwdriver.js.map +1 -1
- package/distribution/ci_source/providers/Semaphore.js +2 -2
- package/distribution/ci_source/providers/Semaphore.js.map +1 -1
- package/distribution/ci_source/providers/Surf.js +2 -2
- package/distribution/ci_source/providers/Surf.js.map +1 -1
- package/distribution/ci_source/providers/TeamCity.js +5 -5
- package/distribution/ci_source/providers/TeamCity.js.map +1 -1
- package/distribution/ci_source/providers/Travis.js +3 -3
- package/distribution/ci_source/providers/Travis.js.map +1 -1
- package/distribution/ci_source/providers/VSTS.js +2 -2
- package/distribution/ci_source/providers/VSTS.js.map +1 -1
- package/distribution/ci_source/providers/XcodeCloud.js +2 -2
- package/distribution/ci_source/providers/XcodeCloud.js.map +1 -1
- package/distribution/commands/ci/resetStatus.js +7 -6
- package/distribution/commands/ci/resetStatus.js.map +1 -1
- package/distribution/commands/ci/runner.js +14 -13
- package/distribution/commands/ci/runner.js.map +1 -1
- package/distribution/commands/danger-ci.js +2 -2
- package/distribution/commands/danger-ci.js.map +1 -1
- package/distribution/commands/danger-init.js +19 -19
- package/distribution/commands/danger-init.js.map +1 -1
- package/distribution/commands/danger-local.js +4 -3
- package/distribution/commands/danger-local.js.map +1 -1
- package/distribution/commands/danger-pr.js +12 -12
- package/distribution/commands/danger-pr.js.map +1 -1
- package/distribution/commands/danger-process.js +10 -10
- package/distribution/commands/danger-process.js.map +1 -1
- package/distribution/commands/danger-reset-status.js +2 -2
- package/distribution/commands/danger-reset-status.js.map +1 -1
- package/distribution/commands/danger-runner.js +15 -15
- package/distribution/commands/danger-runner.js.map +1 -1
- package/distribution/commands/init/add-to-ci.js +16 -13
- package/distribution/commands/init/add-to-ci.js.map +1 -1
- package/distribution/commands/init/default-dangerfile.js +12 -8
- package/distribution/commands/init/default-dangerfile.js.map +1 -1
- package/distribution/commands/init/get-repo-slug.js +3 -2
- package/distribution/commands/init/get-repo-slug.js.map +1 -1
- package/distribution/commands/init/state-setup.js +9 -7
- package/distribution/commands/init/state-setup.js.map +1 -1
- package/distribution/commands/utils/chainsmoker.js +2 -2
- package/distribution/commands/utils/chainsmoker.js.map +1 -1
- package/distribution/commands/utils/dangerRunToRunnerCLI.js +1 -1
- package/distribution/commands/utils/dangerRunToRunnerCLI.js.map +1 -1
- package/distribution/commands/utils/fileUtils.js +5 -5
- package/distribution/commands/utils/fileUtils.js.map +1 -1
- package/distribution/commands/utils/getRuntimeCISource.js +2 -2
- package/distribution/commands/utils/getRuntimeCISource.js.map +1 -1
- package/distribution/commands/utils/reporting.js +18 -13
- package/distribution/commands/utils/reporting.js.map +1 -1
- package/distribution/commands/utils/runDangerSubprocess.js +22 -19
- package/distribution/commands/utils/runDangerSubprocess.js.map +1 -1
- package/distribution/commands/utils/sharedDangerfileArgs.d.ts +2 -0
- package/distribution/commands/utils/sharedDangerfileArgs.js.map +1 -1
- package/distribution/commands/utils/validateDangerfileExists.js +3 -3
- package/distribution/commands/utils/validateDangerfileExists.js.map +1 -1
- package/distribution/danger.d.ts +5 -1
- package/distribution/danger.js.flow +7 -1
- package/distribution/debug.js +3 -2
- package/distribution/debug.js.map +1 -1
- package/distribution/dsl/DangerResults.js +27 -22
- package/distribution/dsl/DangerResults.js.map +1 -1
- package/distribution/dsl/GitDSL.d.ts +2 -1
- package/distribution/dsl/GitLabDSL.d.ts +3 -0
- package/distribution/dsl/Violation.js +2 -1
- package/distribution/dsl/Violation.js.map +1 -1
- package/distribution/platforms/BitBucketCloud.js +2 -2
- package/distribution/platforms/BitBucketCloud.js.map +1 -1
- package/distribution/platforms/BitBucketServer.js +6 -5
- package/distribution/platforms/BitBucketServer.js.map +1 -1
- package/distribution/platforms/FakePlatform.d.ts +5 -0
- package/distribution/platforms/FakePlatform.js +3 -2
- package/distribution/platforms/FakePlatform.js.map +1 -1
- package/distribution/platforms/GitHub.js +18 -16
- package/distribution/platforms/GitHub.js.map +1 -1
- package/distribution/platforms/GitLab.js +7 -6
- package/distribution/platforms/GitLab.js.map +1 -1
- package/distribution/platforms/LocalGit.js +5 -5
- package/distribution/platforms/LocalGit.js.map +1 -1
- package/distribution/platforms/bitbucket_cloud/BitBucketCloudAPI.js +26 -26
- package/distribution/platforms/bitbucket_cloud/BitBucketCloudAPI.js.map +1 -1
- package/distribution/platforms/bitbucket_cloud/BitBucketCloudGit.js +5 -4
- package/distribution/platforms/bitbucket_cloud/BitBucketCloudGit.js.map +1 -1
- package/distribution/platforms/bitbucket_cloud/_tests_/_bitbucket_cloud_api.test.js +6 -6
- package/distribution/platforms/bitbucket_cloud/_tests_/_bitbucket_cloud_api.test.js.map +1 -1
- package/distribution/platforms/bitbucket_cloud/_tests_/_bitbucket_cloud_git.test.js +21 -19
- package/distribution/platforms/bitbucket_cloud/_tests_/_bitbucket_cloud_git.test.js.map +1 -1
- package/distribution/platforms/bitbucket_server/BitBucketServerAPI.js +22 -22
- package/distribution/platforms/bitbucket_server/BitBucketServerAPI.js.map +1 -1
- package/distribution/platforms/bitbucket_server/BitBucketServerGit.js +58 -22
- package/distribution/platforms/bitbucket_server/BitBucketServerGit.js.map +1 -1
- package/distribution/platforms/git/diffToGitJSONDSL.js +4 -3
- package/distribution/platforms/git/diffToGitJSONDSL.js.map +1 -1
- package/distribution/platforms/git/gitJSONToGitDSL.d.ts +3 -12
- package/distribution/platforms/git/gitJSONToGitDSL.js +27 -20
- package/distribution/platforms/git/gitJSONToGitDSL.js.map +1 -1
- package/distribution/platforms/git/localGetCommits.js +4 -3
- package/distribution/platforms/git/localGetCommits.js.map +1 -1
- package/distribution/platforms/git/localGetDiff.js +6 -5
- package/distribution/platforms/git/localGetDiff.js.map +1 -1
- package/distribution/platforms/git/localGetFileAtSHA.js +6 -5
- package/distribution/platforms/git/localGetFileAtSHA.js.map +1 -1
- package/distribution/platforms/git/localLogGitCommits.js +4 -3
- package/distribution/platforms/git/localLogGitCommits.js.map +1 -1
- package/distribution/platforms/github/GitHubAPI.d.ts +5 -0
- package/distribution/platforms/github/GitHubAPI.js +67 -38
- package/distribution/platforms/github/GitHubAPI.js.map +1 -1
- package/distribution/platforms/github/GitHubGit.js +7 -5
- package/distribution/platforms/github/GitHubGit.js.map +1 -1
- package/distribution/platforms/github/GitHubUtils.d.ts +1108 -1
- package/distribution/platforms/github/GitHubUtils.js +47 -28
- package/distribution/platforms/github/GitHubUtils.js.map +1 -1
- package/distribution/platforms/github/comms/checks/githubAppSupport.js +8 -7
- package/distribution/platforms/github/comms/checks/githubAppSupport.js.map +1 -1
- package/distribution/platforms/github/comms/checks/resultsToCheck.js +20 -18
- package/distribution/platforms/github/comms/checks/resultsToCheck.js.map +1 -1
- package/distribution/platforms/github/comms/checksCommenter.js +20 -16
- package/distribution/platforms/github/comms/checksCommenter.js.map +1 -1
- package/distribution/platforms/github/comms/issueCommenter.d.ts +5 -0
- package/distribution/platforms/github/comms/issueCommenter.js +21 -8
- package/distribution/platforms/github/comms/issueCommenter.js.map +1 -1
- package/distribution/platforms/github/customGitHubRequire.js +33 -28
- package/distribution/platforms/github/customGitHubRequire.js.map +1 -1
- package/distribution/platforms/gitlab/GitLabAPI.d.ts +1 -1
- package/distribution/platforms/gitlab/GitLabAPI.js +9 -9
- package/distribution/platforms/gitlab/GitLabAPI.js.map +1 -1
- package/distribution/platforms/gitlab/GitLabGit.js +9 -7
- package/distribution/platforms/gitlab/GitLabGit.js.map +1 -1
- package/distribution/platforms/platform.d.ts +6 -0
- package/distribution/platforms/platform.js +6 -6
- package/distribution/platforms/platform.js.map +1 -1
- package/distribution/platforms/pullRequestParser.js +4 -4
- package/distribution/platforms/pullRequestParser.js.map +1 -1
- package/distribution/runner/DangerUtils.js +3 -2
- package/distribution/runner/DangerUtils.js.map +1 -1
- package/distribution/runner/Executor.d.ts +1 -0
- package/distribution/runner/Executor.js +75 -42
- package/distribution/runner/Executor.js.map +1 -1
- package/distribution/runner/dslGenerator.js +3 -2
- package/distribution/runner/dslGenerator.js.map +1 -1
- package/distribution/runner/jsonToContext.js +2 -2
- package/distribution/runner/jsonToContext.js.map +1 -1
- package/distribution/runner/jsonToDSL.js +16 -15
- package/distribution/runner/jsonToDSL.js.map +1 -1
- package/distribution/runner/runners/inline.js +10 -9
- package/distribution/runner/runners/inline.js.map +1 -1
- package/distribution/runner/runners/utils/resultsForCaughtError.js +3 -3
- package/distribution/runner/runners/utils/resultsForCaughtError.js.map +1 -1
- package/distribution/runner/runners/utils/transpiler.js +32 -25
- package/distribution/runner/runners/utils/transpiler.js.map +1 -1
- package/distribution/runner/templates/bitbucketCloudTemplate.js +18 -14
- package/distribution/runner/templates/bitbucketCloudTemplate.js.map +1 -1
- package/distribution/runner/templates/bitbucketServerTemplate.js +17 -13
- package/distribution/runner/templates/bitbucketServerTemplate.js.map +1 -1
- package/distribution/runner/templates/exceptionRaisedTemplate.js +1 -1
- package/distribution/runner/templates/exceptionRaisedTemplate.js.map +1 -1
- package/distribution/runner/templates/githubIssueTemplate.js +23 -19
- package/distribution/runner/templates/githubIssueTemplate.js.map +1 -1
- package/distribution/runner/templates/markdownTableTemplate.js +3 -3
- package/distribution/runner/templates/markdownTableTemplate.js.map +1 -1
- package/package.json +12 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issueCommenter.js","sourceRoot":"","sources":["../../../../source/platforms/github/comms/issueCommenter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wCAAsC;AAGtC,IAAM,CAAC,GAAG,aAAK,
|
|
1
|
+
{"version":3,"file":"issueCommenter.js","sourceRoot":"","sources":["../../../../source/platforms/github/comms/issueCommenter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wCAAsC;AAGtC,IAAM,CAAC,GAAG,IAAA,aAAK,EAAC,eAAe,CAAC,CAAA;AAEhC;;;;;GAKG;AACI,IAAM,4BAA4B,GAAG,UAAC,GAAW,EAAE,IAAY,EAAE,IAAY;IAClF,CAAC,CAAC,sCAAsC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,CAAA;IAC7D,OAAO,GAAG,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAA,IAAI;QAC9C,OAAO,IAAI,OAAO,CAAS,UAAC,OAAO,EAAE,MAAM;YACzC,IAAI,IAAI,KAAK,SAAS,EAAE;gBACtB,CAAC,CAAC,oCAAoC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;gBAC/F,MAAM,EAAE,CAAA;aACT;YAED,CAAC,CACC,wDAAwD,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CACjH,CAAA;YACD,IAAI,QAAQ,GAAG,CAAC,CAAA;YAChB,KAAkB,UAAY,EAAZ,KAAA,IAAK,CAA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,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;4BAEhE,mBAAmB;0BAF6C;;wBAAhE,KAAK,GAAG,SAAwD,CAAA;8BAGhC,EAAV,yBAAU;;;6BAAV,CAAA,wBAAU,CAAA;wBAAvB,SAAS;6BACZ,CAAA,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA,EAA3B,wBAA2B;wBAC7B,CAAC,CAAC,2BAAoB,SAAS,CAAE,CAAC,CAAA;wBAClC,qBAAM,GAAG,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAA;;wBAAxC,SAAwC,CAAA;;;wBAHtB,IAAU,CAAA;;;;wBAOhC,CAAC,CAAC,sBAAsB,CAAC,CAAA;wBACjB,qBAAM,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,EAAA;;wBAA3C,KAAK,GAAG,SAAmC,CAAA;;4BAG7C,sBAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAA;;;aAC/B;KACF,CAAA;AACH,CAAC,CAAA;AA1HY,QAAA,oBAAoB,wBA0HhC"}
|
|
@@ -35,12 +35,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
44
46
|
};
|
|
45
47
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -59,18 +61,19 @@ exports.dangerPrefix = "peril-downloaded-";
|
|
|
59
61
|
* Takes a DangerfileReferenceString and lets you know where to find it globally
|
|
60
62
|
* for strings like: artsy/peril-settings/settings.json@branch
|
|
61
63
|
*/
|
|
62
|
-
|
|
64
|
+
var dangerRepresentationForPath = function (value) {
|
|
63
65
|
var hasManySlashes = value.split("/").length > 2;
|
|
64
66
|
var _a = hasManySlashes
|
|
65
67
|
? value.split("@")[0].split("/")
|
|
66
|
-
:
|
|
68
|
+
: __spreadArray([undefined, undefined], value.split("@")[0].split("/"), true), owner = _a[0], repo = _a[1], pathComponents = _a.slice(2);
|
|
67
69
|
return {
|
|
68
70
|
branch: value.includes("@") ? value.split("@")[1] : "master",
|
|
69
71
|
dangerfilePath: pathComponents.join("/"),
|
|
70
|
-
repoSlug: owner ? owner
|
|
72
|
+
repoSlug: owner ? "".concat(owner, "/").concat(repo) : undefined,
|
|
71
73
|
referenceString: value,
|
|
72
74
|
};
|
|
73
75
|
};
|
|
76
|
+
exports.dangerRepresentationForPath = dangerRepresentationForPath;
|
|
74
77
|
function getGitHubFileContentsFromLocation(token, location, defaultRepo) {
|
|
75
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
76
79
|
return __generator(this, function (_a) {
|
|
@@ -91,13 +94,13 @@ function getGitHubFileContents(token, repoSlug, path, ref, showError) {
|
|
|
91
94
|
return __generator(this, function (_a) {
|
|
92
95
|
switch (_a.label) {
|
|
93
96
|
case 0:
|
|
94
|
-
refString = ref ? "?ref="
|
|
97
|
+
refString = ref ? "?ref=".concat(ref) : "";
|
|
95
98
|
containsBase = path.startsWith("http");
|
|
96
99
|
baseUrl = process.env["DANGER_GITHUB_API_BASE_URL"] || process.env["GITHUB_URL"] || "https://api.github.com";
|
|
97
|
-
URLPath = "repos/"
|
|
98
|
-
url = containsBase ? URLPath : baseUrl
|
|
99
|
-
return [4 /*yield*/, fetch_1.api(url, {
|
|
100
|
-
headers: { Authorization: "bearer "
|
|
100
|
+
URLPath = "repos/".concat(repoSlug, "/contents/").concat(path).concat(refString);
|
|
101
|
+
url = containsBase ? URLPath : "".concat(baseUrl, "/").concat(URLPath);
|
|
102
|
+
return [4 /*yield*/, (0, fetch_1.api)(url, {
|
|
103
|
+
headers: { Authorization: "bearer ".concat(token) },
|
|
101
104
|
})];
|
|
102
105
|
case 1:
|
|
103
106
|
res = _a.sent();
|
|
@@ -110,8 +113,8 @@ function getGitHubFileContents(token, repoSlug, path, ref, showError) {
|
|
|
110
113
|
}
|
|
111
114
|
else {
|
|
112
115
|
if (showError) {
|
|
113
|
-
debug_1.default("res: " + res.url);
|
|
114
|
-
debug_1.default("Getting GitHub file failed: " + JSON.stringify(data));
|
|
116
|
+
(0, debug_1.default)("res: " + res.url);
|
|
117
|
+
(0, debug_1.default)("Getting GitHub file failed: " + JSON.stringify(data));
|
|
115
118
|
}
|
|
116
119
|
return [2 /*return*/, ""];
|
|
117
120
|
}
|
|
@@ -123,7 +126,7 @@ function getGitHubFileContents(token, repoSlug, path, ref, showError) {
|
|
|
123
126
|
exports.getGitHubFileContents = getGitHubFileContents;
|
|
124
127
|
// Setup a callback used to determine whether a specific `require` invocation
|
|
125
128
|
// needs to be overridden.
|
|
126
|
-
|
|
129
|
+
var shouldUseGitHubOverride = function (request, parent) {
|
|
127
130
|
// Is it a from a file we're handling, and is it relative?
|
|
128
131
|
if (parent.filename.startsWith(exports.dangerPrefix) && request.startsWith(".")) {
|
|
129
132
|
return true;
|
|
@@ -131,26 +134,27 @@ exports.shouldUseGitHubOverride = function (request, parent) {
|
|
|
131
134
|
// Basically any import that's not a relative import from a Dangerfile
|
|
132
135
|
return false;
|
|
133
136
|
};
|
|
137
|
+
exports.shouldUseGitHubOverride = shouldUseGitHubOverride;
|
|
134
138
|
// We want to handle relative imports inside a Dangerfile, this custom version of the require func
|
|
135
139
|
// returns a Promise instead of the normal object, and so you would use `await require("./thing")`
|
|
136
140
|
// Which TypeScript handles just as you'd expect
|
|
137
|
-
|
|
141
|
+
var customGitHubResolveRequest = function (token) { return function (request, parent) { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
142
|
var prefixLessParent, dangerRep, localPath, extensions, _i, extensions_1, ext, newReferenceString, newRep, dangerfileContent, newPerilFileReference, newDangerfile, transpiled;
|
|
139
143
|
return __generator(this, function (_a) {
|
|
140
144
|
switch (_a.label) {
|
|
141
145
|
case 0:
|
|
142
146
|
prefixLessParent = parent.filename.replace(exports.dangerPrefix, "");
|
|
143
|
-
debug_1.default("Grabbing relative import \""
|
|
144
|
-
dangerRep = exports.dangerRepresentationForPath(prefixLessParent);
|
|
145
|
-
localPath = path_1.posix.resolve(path_1.dirname(dangerRep.dangerfilePath), request).replace(path_1.posix.resolve(""), "");
|
|
146
|
-
extensions = path_1.extname(prefixLessParent) === ".ts" ? [".ts", ".js"] : [".js", ".ts"];
|
|
147
|
+
(0, debug_1.default)("Grabbing relative import \"".concat(request, "\" to ").concat(prefixLessParent, "."));
|
|
148
|
+
dangerRep = (0, exports.dangerRepresentationForPath)(prefixLessParent);
|
|
149
|
+
localPath = path_1.posix.resolve((0, path_1.dirname)(dangerRep.dangerfilePath), request).replace(path_1.posix.resolve(""), "");
|
|
150
|
+
extensions = (0, path_1.extname)(prefixLessParent) === ".ts" ? [".ts", ".js"] : [".js", ".ts"];
|
|
147
151
|
_i = 0, extensions_1 = extensions;
|
|
148
152
|
_a.label = 1;
|
|
149
153
|
case 1:
|
|
150
154
|
if (!(_i < extensions_1.length)) return [3 /*break*/, 4];
|
|
151
155
|
ext = extensions_1[_i];
|
|
152
156
|
newReferenceString = prefixLessParent.replace(dangerRep.dangerfilePath, localPath) + ext;
|
|
153
|
-
newRep = exports.dangerRepresentationForPath(newReferenceString);
|
|
157
|
+
newRep = (0, exports.dangerRepresentationForPath)(newReferenceString);
|
|
154
158
|
// Not supported right now
|
|
155
159
|
if (!newRep.repoSlug) {
|
|
156
160
|
throw new Error("Relative imports don't work without a repo slug in the dangerfile reference.");
|
|
@@ -159,10 +163,10 @@ exports.customGitHubResolveRequest = function (token) { return function (request
|
|
|
159
163
|
case 2:
|
|
160
164
|
dangerfileContent = _a.sent();
|
|
161
165
|
if (dangerfileContent) {
|
|
162
|
-
newPerilFileReference = ""
|
|
163
|
-
newDangerfile = cleanDangerfile_1.default(dangerfileContent);
|
|
164
|
-
transpiled = transpiler_1.default(newDangerfile, newPerilFileReference);
|
|
165
|
-
return [2 /*return*/, require_from_string_1.default(transpiled, newPerilFileReference)];
|
|
166
|
+
newPerilFileReference = "".concat(exports.dangerPrefix).concat(newReferenceString);
|
|
167
|
+
newDangerfile = (0, cleanDangerfile_1.default)(dangerfileContent);
|
|
168
|
+
transpiled = (0, transpiler_1.default)(newDangerfile, newPerilFileReference);
|
|
169
|
+
return [2 /*return*/, (0, require_from_string_1.default)(transpiled, newPerilFileReference)];
|
|
166
170
|
}
|
|
167
171
|
_a.label = 3;
|
|
168
172
|
case 3:
|
|
@@ -170,8 +174,9 @@ exports.customGitHubResolveRequest = function (token) { return function (request
|
|
|
170
174
|
return [3 /*break*/, 1];
|
|
171
175
|
case 4:
|
|
172
176
|
// User error in the path basically
|
|
173
|
-
throw new Error("Could not find '"
|
|
177
|
+
throw new Error("Could not find '".concat(request, "' as a relative import from ").concat(prefixLessParent, ". Does ").concat(localPath, " exist in the repo?"));
|
|
174
178
|
}
|
|
175
179
|
});
|
|
176
180
|
}); }; };
|
|
181
|
+
exports.customGitHubResolveRequest = customGitHubResolveRequest;
|
|
177
182
|
//# sourceMappingURL=customGitHubRequire.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customGitHubRequire.js","sourceRoot":"","sources":["../../../source/platforms/github/customGitHubRequire.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customGitHubRequire.js","sourceRoot":"","sources":["../../../source/platforms/github/customGitHubRequire.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,mCAA2B,EAAC,kBAAkB,CAAC,CAAA;gBAE9D,0BAA0B;gBAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;oBACpB,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAA;iBAChG;gBAGyB,qBAAM,iCAAiC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAA;;gBAA3F,iBAAiB,GAAG,SAAuE;gBACjG,IAAI,iBAAiB,EAAE;oBAEf,qBAAqB,GAAG,UAAG,oBAAY,SAAG,kBAAkB,CAAE,CAAA;oBAE9D,aAAa,GAAG,IAAA,yBAAe,EAAC,iBAAiB,CAAC,CAAA;oBAElD,UAAU,GAAG,IAAA,oBAAU,EAAC,aAAa,EAAE,qBAAqB,CAAC,CAAA;oBACnE,sBAAO,IAAA,6BAAiB,EAAC,UAAU,EAAE,qBAAqB,CAAC,EAAA;iBAC5D;;;gBApBe,IAAU,CAAA;;;YAuB5B,mCAAmC;YACnC,MAAM,IAAI,KAAK,CACb,0BAAmB,OAAO,yCAA+B,gBAAgB,oBAAU,SAAS,wBAAqB,CAClH,CAAA;;;KACF,EAtC4D,CAsC5D,CAAA;AAtCY,QAAA,0BAA0B,8BAsCtC"}
|
|
@@ -20,7 +20,7 @@ declare class GitLabAPI {
|
|
|
20
20
|
constructor(repoMetadata: RepoMetaData, repoCredentials: GitLabAPICredentials);
|
|
21
21
|
get projectURL(): string;
|
|
22
22
|
get mergeRequestURL(): string;
|
|
23
|
-
get apiInstance(): import("gitlab/dist/infrastructure").Mapper<typeof import("gitlab/dist/services"), "
|
|
23
|
+
get apiInstance(): import("gitlab/dist/infrastructure").Mapper<typeof import("gitlab/dist/services"), "Groups" | "GroupAccessRequests" | "GroupBadges" | "GroupCustomAttributes" | "GroupIssueBoards" | "GroupMembers" | "GroupMilestones" | "GroupProjects" | "GroupVariables" | "Epics" | "EpicIssues" | "EpicNotes" | "EpicDiscussions" | "Users" | "UserCustomAttributes" | "UserEmails" | "UserImpersonationTokens" | "UserKeys" | "UserGPGKeys" | "Branches" | "Commits" | "CommitDiscussions" | "ContainerRegistry" | "DeployKeys" | "Deployments" | "Environments" | "Issues" | "IssueAwardEmojis" | "IssueNotes" | "IssueDiscussions" | "Jobs" | "Labels" | "MergeRequests" | "MergeRequestAwardEmojis" | "MergeRequestDiscussions" | "MergeRequestNotes" | "Pipelines" | "PipelineSchedules" | "PipelineScheduleVariables" | "Projects" | "ProjectAccessRequests" | "ProjectBadges" | "ProjectCustomAttributes" | "ProjectImportExport" | "ProjectIssueBoards" | "ProjectHooks" | "ProjectMembers" | "ProjectMilestones" | "ProjectSnippets" | "ProjectSnippetNotes" | "ProjectSnippetDiscussions" | "ProjectSnippetAwardEmojis" | "ProtectedBranches" | "ProtectedTags" | "ProjectVariables" | "PushRules" | "Releases" | "ReleaseLinks" | "Repositories" | "RepositoryFiles" | "Runners" | "Services" | "Tags" | "Triggers" | "Todos" | "ApplicationSettings" | "BroadcastMessages" | "Events" | "FeatureFlags" | "GeoNodes" | "GitignoreTemplates" | "GitLabCIYMLTemplates" | "Keys" | "Licence" | "LicenceTemplates" | "Lint" | "Namespaces" | "NotificationSettings" | "Markdown" | "PagesDomains" | "Search" | "SidekiqMetrics" | "Snippets" | "SystemHooks" | "Version" | "Wikis">;
|
|
24
24
|
getUser: () => Promise<GitLabUserProfile>;
|
|
25
25
|
getMergeRequestInfo: () => Promise<GitLabMR>;
|
|
26
26
|
updateMergeRequestInfo: (changes: object) => Promise<object>;
|
|
@@ -48,7 +48,7 @@ function getGitLabAPICredentialsFromEnv(env) {
|
|
|
48
48
|
// We used to support DANGER_GITLAB_HOST being just the host e.g. "gitlab.com"
|
|
49
49
|
// however it is possible to have a custom host without SSL, ensure we only add the protocol if one is not provided
|
|
50
50
|
var protocolRegex = /^https?:\/\//i;
|
|
51
|
-
host = protocolRegex.test(envHost) ? envHost : "https://"
|
|
51
|
+
host = protocolRegex.test(envHost) ? envHost : "https://".concat(envHost);
|
|
52
52
|
}
|
|
53
53
|
else if (envCIAPI) {
|
|
54
54
|
// GitLab >= v11.7 supplies the API Endpoint in an environment variable and we can work out our host value from that.
|
|
@@ -58,7 +58,7 @@ function getGitLabAPICredentialsFromEnv(env) {
|
|
|
58
58
|
var matches = hostRegex.exec(envCIAPI);
|
|
59
59
|
var matchProto = matches[1];
|
|
60
60
|
var matchHost = matches[2];
|
|
61
|
-
host = matchProto
|
|
61
|
+
host = "".concat(matchProto, "://").concat(matchHost);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
return {
|
|
@@ -73,7 +73,7 @@ var GitLabAPI = /** @class */ (function () {
|
|
|
73
73
|
var _this = this;
|
|
74
74
|
this.repoMetadata = repoMetadata;
|
|
75
75
|
this.repoCredentials = repoCredentials;
|
|
76
|
-
this.d = debug_1.debug("GitLabAPI");
|
|
76
|
+
this.d = (0, debug_1.debug)("GitLabAPI");
|
|
77
77
|
this.getUser = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
78
78
|
var user;
|
|
79
79
|
return __generator(this, function (_a) {
|
|
@@ -93,7 +93,7 @@ var GitLabAPI = /** @class */ (function () {
|
|
|
93
93
|
return __generator(this, function (_a) {
|
|
94
94
|
switch (_a.label) {
|
|
95
95
|
case 0:
|
|
96
|
-
this.d("getMergeRequestInfo for repo: "
|
|
96
|
+
this.d("getMergeRequestInfo for repo: ".concat(this.repoMetadata.repoSlug, " pr: ").concat(this.repoMetadata.pullRequestID));
|
|
97
97
|
return [4 /*yield*/, this.api.MergeRequests.show(this.repoMetadata.repoSlug, Number(this.repoMetadata.pullRequestID))];
|
|
98
98
|
case 1:
|
|
99
99
|
mr = (_a.sent());
|
|
@@ -115,7 +115,7 @@ var GitLabAPI = /** @class */ (function () {
|
|
|
115
115
|
return __generator(this, function (_a) {
|
|
116
116
|
switch (_a.label) {
|
|
117
117
|
case 0:
|
|
118
|
-
this.d("getMergeRequestApprovals for repo: "
|
|
118
|
+
this.d("getMergeRequestApprovals for repo: ".concat(this.repoMetadata.repoSlug, " pr: ").concat(this.repoMetadata.pullRequestID));
|
|
119
119
|
return [4 /*yield*/, this.api.MergeRequests.approvals(this.repoMetadata.repoSlug, {
|
|
120
120
|
mergerequestIId: Number(this.repoMetadata.pullRequestID),
|
|
121
121
|
})];
|
|
@@ -131,7 +131,7 @@ var GitLabAPI = /** @class */ (function () {
|
|
|
131
131
|
return __generator(this, function (_a) {
|
|
132
132
|
switch (_a.label) {
|
|
133
133
|
case 0:
|
|
134
|
-
this.d("getMergeRequestChanges for repo: "
|
|
134
|
+
this.d("getMergeRequestChanges for repo: ".concat(this.repoMetadata.repoSlug, " pr: ").concat(this.repoMetadata.pullRequestID));
|
|
135
135
|
return [4 /*yield*/, this.api.MergeRequests.changes(this.repoMetadata.repoSlug, Number(this.repoMetadata.pullRequestID))];
|
|
136
136
|
case 1:
|
|
137
137
|
mr = (_a.sent());
|
|
@@ -285,7 +285,7 @@ var GitLabAPI = /** @class */ (function () {
|
|
|
285
285
|
return __generator(this, function (_a) {
|
|
286
286
|
switch (_a.label) {
|
|
287
287
|
case 0:
|
|
288
|
-
this.d("getFileContents requested for path:"
|
|
288
|
+
this.d("getFileContents requested for path:".concat(path, ", slug:").concat(slug, ", ref:").concat(ref));
|
|
289
289
|
api = this.api.RepositoryFiles;
|
|
290
290
|
projectId = slug || this.repoMetadata.repoSlug;
|
|
291
291
|
if (!!ref) return [3 /*break*/, 2];
|
|
@@ -387,14 +387,14 @@ var GitLabAPI = /** @class */ (function () {
|
|
|
387
387
|
}
|
|
388
388
|
Object.defineProperty(GitLabAPI.prototype, "projectURL", {
|
|
389
389
|
get: function () {
|
|
390
|
-
return this.hostURL
|
|
390
|
+
return "".concat(this.hostURL, "/").concat(this.repoMetadata.repoSlug);
|
|
391
391
|
},
|
|
392
392
|
enumerable: false,
|
|
393
393
|
configurable: true
|
|
394
394
|
});
|
|
395
395
|
Object.defineProperty(GitLabAPI.prototype, "mergeRequestURL", {
|
|
396
396
|
get: function () {
|
|
397
|
-
return this.projectURL
|
|
397
|
+
return "".concat(this.projectURL, "/merge_requests/").concat(this.repoMetadata.pullRequestID);
|
|
398
398
|
},
|
|
399
399
|
enumerable: false,
|
|
400
400
|
configurable: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitLabAPI.js","sourceRoot":"","sources":["../../../source/platforms/gitlab/GitLabAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA8C;AAe9C,iCAA+B;AAE/B,qCAAmC;AAUnC,SAAgB,8BAA8B,CAAC,GAAQ;IACrD,IAAI,IAAI,GAAG,oBAAoB,CAAA;IAC/B,IAAM,OAAO,GAAG,GAAG,CAAC,oBAAoB,CAAC,CAAA;IACzC,IAAM,QAAQ,GAAG,GAAG,CAAC,eAAe,CAAC,CAAA;IAErC,IAAI,OAAO,EAAE;QACX,8EAA8E;QAC9E,mHAAmH;QACnH,IAAM,aAAa,GAAG,eAAe,CAAA;QACrC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"GitLabAPI.js","sourceRoot":"","sources":["../../../source/platforms/gitlab/GitLabAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA8C;AAe9C,iCAA+B;AAE/B,qCAAmC;AAUnC,SAAgB,8BAA8B,CAAC,GAAQ;IACrD,IAAI,IAAI,GAAG,oBAAoB,CAAA;IAC/B,IAAM,OAAO,GAAG,GAAG,CAAC,oBAAoB,CAAC,CAAA;IACzC,IAAM,QAAQ,GAAG,GAAG,CAAC,eAAe,CAAC,CAAA;IAErC,IAAI,OAAO,EAAE;QACX,8EAA8E;QAC9E,mHAAmH;QACnH,IAAM,aAAa,GAAG,eAAe,CAAA;QACrC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CA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MH,gBAAC;AAAD,CAAC,AA9ND,IA8NC;AAED,kBAAe,SAAS,CAAA"}
|
|
@@ -39,10 +39,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.gitlabChangesToDiff = exports.gitLabGitDSL = void 0;
|
|
40
40
|
var debug_1 = require("../../debug");
|
|
41
41
|
var gitJSONToGitDSL_1 = require("../git/gitJSONToGitDSL");
|
|
42
|
-
var d = debug_1.debug("GitLabGit");
|
|
43
|
-
|
|
42
|
+
var d = (0, debug_1.debug)("GitLabGit");
|
|
43
|
+
var gitLabGitDSL = function (gitlab, json, gitlabAPI) {
|
|
44
44
|
var config = {
|
|
45
|
-
repo: ""
|
|
45
|
+
repo: "".concat(gitlab.mr.project_id),
|
|
46
46
|
baseSHA: gitlab.mr.diff_refs ? gitlab.mr.diff_refs.base_sha : "",
|
|
47
47
|
headSHA: gitlab.mr.diff_refs ? gitlab.mr.diff_refs.head_sha : "",
|
|
48
48
|
getFileContents: gitlab.utils.fileContents,
|
|
@@ -53,15 +53,16 @@ exports.gitLabGitDSL = function (gitlab, json, gitlabAPI) {
|
|
|
53
53
|
case 0: return [4 /*yield*/, gitlabAPI.getCompareChanges(base, head)];
|
|
54
54
|
case 1:
|
|
55
55
|
changes = _a.sent();
|
|
56
|
-
return [2 /*return*/, exports.gitlabChangesToDiff(changes)];
|
|
56
|
+
return [2 /*return*/, (0, exports.gitlabChangesToDiff)(changes)];
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
}); },
|
|
60
60
|
};
|
|
61
61
|
d("Setting up git DSL with: ", config);
|
|
62
|
-
return gitJSONToGitDSL_1.gitJSONToGitDSL(json, config);
|
|
62
|
+
return (0, gitJSONToGitDSL_1.gitJSONToGitDSL)(json, config);
|
|
63
63
|
};
|
|
64
|
-
exports.
|
|
64
|
+
exports.gitLabGitDSL = gitLabGitDSL;
|
|
65
|
+
var gitlabChangesToDiff = function (changes) {
|
|
65
66
|
d("Converting GitLab Changes to Diff");
|
|
66
67
|
// Gitlab doesn't return full raw git diff, relevant issue: https://gitlab.com/gitlab-org/gitlab/issues/24913
|
|
67
68
|
return changes
|
|
@@ -70,8 +71,9 @@ exports.gitlabChangesToDiff = function (changes) {
|
|
|
70
71
|
if (diff.startsWith("diff --git a/") || diff.startsWith("--- a/") || diff.startsWith("--- /dev/null")) {
|
|
71
72
|
return diff;
|
|
72
73
|
}
|
|
73
|
-
return "diff --git a/"
|
|
74
|
+
return "diff --git a/".concat(change.old_path, " b/").concat(change.new_path, "\n").concat(change.new_file ? "new file mode ".concat(change.b_mode) : "").concat(change.deleted_file ? "deleted file mode ".concat(change.a_mode) : "").concat(change.renamed_file ? "rename from ".concat(change.old_path, "\nrename to ").concat(change.new_path) : "", "\n--- ").concat(change.new_file ? "/dev/null" : "a/" + change.old_path, "\n+++ ").concat(change.deleted_file ? "/dev/null" : "b/" + change.new_path, "\n").concat(diff);
|
|
74
75
|
})
|
|
75
76
|
.join("\n");
|
|
76
77
|
};
|
|
78
|
+
exports.gitlabChangesToDiff = gitlabChangesToDiff;
|
|
77
79
|
//# sourceMappingURL=GitLabGit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitLabGit.js","sourceRoot":"","sources":["../../../source/platforms/gitlab/GitLabGit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAmC;AAGnC,0DAA+E;AAG/E,IAAM,CAAC,GAAG,aAAK,
|
|
1
|
+
{"version":3,"file":"GitLabGit.js","sourceRoot":"","sources":["../../../source/platforms/gitlab/GitLabGit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAmC;AAGnC,0DAA+E;AAG/E,IAAM,CAAC,GAAG,IAAA,aAAK,EAAC,WAAW,CAAC,CAAA;AAErB,IAAM,YAAY,GAAG,UAAC,MAAiB,EAAE,IAAgB,EAAE,SAAoB;IACpF,IAAM,MAAM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M,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,EAAE,SACvD,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,4BAAqB,MAAM,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,EAAE,SAC/D,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,sBAAe,MAAM,CAAC,QAAQ,yBAAe,MAAM,CAAC,QAAQ,CAAE,CAAC,CAAC,CAAC,EAAE,mBACrF,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,mBACtD,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,eAC9D,IAAI,CAAE,CAAA;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC,CAAA;AApBY,QAAA,mBAAmB,uBAoB/B"}
|
|
@@ -56,6 +56,12 @@ export interface PlatformCommunicator {
|
|
|
56
56
|
updateInlineComment: (comment: string, commentId: string) => Promise<any>;
|
|
57
57
|
/** Delete an inline comment */
|
|
58
58
|
deleteInlineComment: (commentId: string) => Promise<boolean>;
|
|
59
|
+
/** Create a review with inline comments */
|
|
60
|
+
createInlineReview?: (git: GitDSL, comments: {
|
|
61
|
+
comment: string;
|
|
62
|
+
path: string;
|
|
63
|
+
line: number;
|
|
64
|
+
}[]) => Promise<any>;
|
|
59
65
|
/** Delete the main Danger comment */
|
|
60
66
|
deleteMainComment: (dangerID: string) => Promise<boolean>;
|
|
61
67
|
/** Replace the main Danger comment, returning the URL to the issue */
|
|
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
15
|
if (mod && mod.__esModule) return mod;
|
|
16
16
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
@@ -45,7 +45,7 @@ function getPlatformForEnv(env, source) {
|
|
|
45
45
|
var api = new BitBucketServerAPI_1.BitBucketServerAPI({
|
|
46
46
|
pullRequestID: source.pullRequestID,
|
|
47
47
|
repoSlug: source.repoSlug,
|
|
48
|
-
}, BitBucketServerAPI_1.bitbucketServerRepoCredentialsFromEnv(env));
|
|
48
|
+
}, (0, BitBucketServerAPI_1.bitbucketServerRepoCredentialsFromEnv)(env));
|
|
49
49
|
return new BitBucketServer_1.BitBucketServer(api);
|
|
50
50
|
}
|
|
51
51
|
// Bitbucket Cloud
|
|
@@ -55,7 +55,7 @@ function getPlatformForEnv(env, source) {
|
|
|
55
55
|
var api = new BitBucketCloudAPI_1.BitBucketCloudAPI({
|
|
56
56
|
pullRequestID: source.pullRequestID,
|
|
57
57
|
repoSlug: source.repoSlug,
|
|
58
|
-
}, BitBucketCloudAPI_1.bitbucketCloudCredentialsFromEnv(env));
|
|
58
|
+
}, (0, BitBucketCloudAPI_1.bitbucketCloudCredentialsFromEnv)(env));
|
|
59
59
|
return new BitBucketCloud_1.BitBucketCloud(api);
|
|
60
60
|
}
|
|
61
61
|
// GitLab
|
|
@@ -65,14 +65,14 @@ function getPlatformForEnv(env, source) {
|
|
|
65
65
|
var api = new GitLabAPI_1.default({
|
|
66
66
|
pullRequestID: source.pullRequestID,
|
|
67
67
|
repoSlug: source.repoSlug,
|
|
68
|
-
}, GitLabAPI_1.getGitLabAPICredentialsFromEnv(env));
|
|
68
|
+
}, (0, GitLabAPI_1.getGitLabAPICredentialsFromEnv)(env));
|
|
69
69
|
return new GitLab_1.default(api);
|
|
70
70
|
}
|
|
71
71
|
// GitHub Platform
|
|
72
72
|
var ghToken = env["DANGER_GITHUB_API_TOKEN"] || env["GITHUB_TOKEN"];
|
|
73
73
|
// They need to set the token up for GitHub actions to work
|
|
74
74
|
if (env["GITHUB_EVENT_NAME"] && !ghToken) {
|
|
75
|
-
console.error("You need to add GITHUB_TOKEN to your Danger action in the workflow:\n \n - name: Danger JS\n uses: danger/danger-js@X.Y.Z\n "
|
|
75
|
+
console.error("You need to add GITHUB_TOKEN to your Danger action in the workflow:\n \n - name: Danger JS\n uses: danger/danger-js@X.Y.Z\n ".concat(chalk_1.default.green("env:\n GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}"), "\n "));
|
|
76
76
|
}
|
|
77
77
|
if (ghToken || env["DANGER_PR_PLATFORM"] === GitHub_1.GitHub.name) {
|
|
78
78
|
if (!ghToken) {
|
|
@@ -80,7 +80,7 @@ function getPlatformForEnv(env, source) {
|
|
|
80
80
|
console.log("Check out: http://danger.systems/js/guides/the_dangerfile.html#working-on-your-dangerfile");
|
|
81
81
|
}
|
|
82
82
|
var api = new GitHubAPI_1.GitHubAPI(source, ghToken);
|
|
83
|
-
return GitHub_1.GitHub(api);
|
|
83
|
+
return (0, GitHub_1.GitHub)(api);
|
|
84
84
|
}
|
|
85
85
|
// Support automatically returning a fake platform if you pass a Fake CI
|
|
86
86
|
if (source.name === "Fake Testing CI") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../source/platforms/platform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,mCAAiC;AACjC,gDAA8C;AAC9C,qDAAmD;AACnD,4EAAiH;AACjH,mDAAiD;AACjD,yEAAyG;AACzG,8DAA8E;AAC9E,oDAA6B;AAI7B,gDAAyB;AACzB,+CAA6C;
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../source/platforms/platform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,mCAAiC;AACjC,gDAA8C;AAC9C,q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AI,gBAAM,CAAC,GAAG,CAAC,CAAA;KACvB;IAED,kBAAkB;IAClB,IAAM,OAAO,GAAG,GAAG,CAAC,yBAAyB,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,CAAA;IAErE,2DAA2D;IAC3D,IAAI,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE;QACxC,OAAO,CAAC,KAAK,CAAC,oJAIV,eAAK,CAAC,KAAK,CAAC,yDAC+B,CAAC,WAC/C,CAAC,CAAA;KACH;IAED,IAAI,OAAO,IAAI,GAAG,CAAC,oBAAoB,CAAC,KAAK,eAAM,CAAC,IAAI,EAAE;QACxD,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,CAAC,GAAG,CAAC,iGAAiG,CAAC,CAAA;YAC9G,OAAO,CAAC,GAAG,CAAC,2FAA2F,CAAC,CAAA;SACzG;QAED,IAAM,GAAG,GAAG,IAAI,qBAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC1C,OAAO,IAAA,eAAM,EAAC,GAAG,CAAC,CAAA;KACnB;IAED,wEAAwE;IACxE,IAAI,MAAM,CAAC,IAAI,KAAK,iBAAiB,EAAE;QACrC,OAAO,IAAI,2BAAY,EAAE,CAAA;KAC1B;IAED,OAAO,CAAC,KAAK,CACX,mHAAmH,CACpH,CAAA;IACD,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAA;IAC/E,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;AAC3D,CAAC;AA/ED,8CA+EC"}
|
|
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
15
|
if (mod && mod.__esModule) return mod;
|
|
16
16
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
@@ -42,7 +42,7 @@ function pullRequestParser(address) {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
// shape: https://bitbucket.org/proj/repo/pull-requests/1
|
|
45
|
-
if (lodash_includes_1.default(components.path, "pull-requests")) {
|
|
45
|
+
if ((0, lodash_includes_1.default)(components.path, "pull-requests")) {
|
|
46
46
|
return {
|
|
47
47
|
platform: BitBucketCloud_1.BitBucketCloud.name,
|
|
48
48
|
repo: components.path.split("/pull-requests")[0].slice(1),
|
|
@@ -50,7 +50,7 @@ function pullRequestParser(address) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
// shape: http://github.com/proj/repo/pull/1
|
|
53
|
-
if (lodash_includes_1.default(components.path, "pull")) {
|
|
53
|
+
if ((0, lodash_includes_1.default)(components.path, "pull")) {
|
|
54
54
|
return {
|
|
55
55
|
platform: GitHub_1.GitHub.name,
|
|
56
56
|
repo: components.path.split("/pull")[0].slice(1),
|
|
@@ -58,7 +58,7 @@ function pullRequestParser(address) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
// shape: https://gitlab.com/GROUP[/SUBGROUP]/PROJ/merge_requests/123
|
|
61
|
-
if (lodash_includes_1.default(components.path, "merge_requests")) {
|
|
61
|
+
if ((0, lodash_includes_1.default)(components.path, "merge_requests")) {
|
|
62
62
|
var regex = /\/(.+)\/merge_requests\/(\d+)/;
|
|
63
63
|
var parts_1 = components.path.match(regex);
|
|
64
64
|
if (parts_1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullRequestParser.js","sourceRoot":"","sources":["../../source/platforms/pullRequestParser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA0B;AAC1B,oEAAsC;AACtC,qDAAmD;AACnD,mCAAiC;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|
20
20
|
if (!href && text) {
|
|
21
21
|
return text;
|
|
22
22
|
}
|
|
23
|
-
return "<a href=\""
|
|
23
|
+
return "<a href=\"".concat(href, "\">").concat(text || href, "</a>");
|
|
24
24
|
}
|
|
25
25
|
exports.href = href;
|
|
26
|
-
|
|
26
|
+
var compliment = function () {
|
|
27
27
|
var compliments = ["Well done.", "Congrats.", "Woo!", "Yay.", "Jolly good show.", "Good on 'ya.", "Nice work."];
|
|
28
28
|
return compliments[Math.floor(Math.random() * compliments.length)];
|
|
29
29
|
};
|
|
30
|
+
exports.compliment = compliment;
|
|
30
31
|
//# sourceMappingURL=DangerUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DangerUtils.js","sourceRoot":"","sources":["../../source/runner/DangerUtils.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,2BAA2B;;;AAE3B,SAAgB,QAAQ,CAAC,KAAe;IACtC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAC9B,OAAO,EAAE,CAAA;KACV;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAA;KAChB;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC,GAAG,EAAE,CAAA;AAC5E,CAAC;AARD,4BAQC;AAED,SAAgB,IAAI,CAAC,IAAa,EAAE,IAAa;IAC/C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE;QAClB,OAAO,IAAI,CAAA;KACZ;IACD,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;QACjB,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,
|
|
1
|
+
{"version":3,"file":"DangerUtils.js","sourceRoot":"","sources":["../../source/runner/DangerUtils.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,2BAA2B;;;AAE3B,SAAgB,QAAQ,CAAC,KAAe;IACtC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAC9B,OAAO,EAAE,CAAA;KACV;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAA;KAChB;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC,GAAG,EAAE,CAAA;AAC5E,CAAC;AARD,4BAQC;AAED,SAAgB,IAAI,CAAC,IAAa,EAAE,IAAa;IAC/C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE;QAClB,OAAO,IAAI,CAAA;KACZ;IACD,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;QACjB,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,oBAAY,IAAI,gBAAK,IAAI,IAAI,IAAI,SAAM,CAAA;AAChD,CAAC;AARD,oBAQC;AAEM,IAAM,UAAU,GAAG;IACxB,IAAM,WAAW,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,YAAY,CAAC,CAAA;IACjH,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;AACpE,CAAC,CAAA;AAHY,QAAA,UAAU,cAGtB"}
|
|
@@ -80,6 +80,7 @@ export declare class Executor {
|
|
|
80
80
|
* @param results Results with inline violations
|
|
81
81
|
*/
|
|
82
82
|
sendInlineComments(results: DangerResults, git: GitDSL, previousComments: Comment[] | null): Promise<DangerResults>;
|
|
83
|
+
sendInlineReview(git: GitDSL, inlineResultsForReview: DangerInlineResults[]): Promise<any>;
|
|
83
84
|
sendInlineComment(git: GitDSL, inlineResults: DangerInlineResults): Promise<any>;
|
|
84
85
|
updateInlineComment(inlineResults: DangerInlineResults, previousComment: Comment): Promise<any>;
|
|
85
86
|
deleteInlineComment(comment: Comment): Promise<any>;
|