danger 11.3.0 → 12.0.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/CHANGELOG.md +24 -0
- package/Dockerfile +2 -2
- package/distribution/ci_source/providers/GitHubActions.d.ts +20 -0
- package/distribution/ci_source/providers/GitHubActions.js +20 -0
- package/distribution/ci_source/providers/GitHubActions.js.map +1 -1
- package/distribution/commands/danger-pr.js +3 -4
- package/distribution/commands/danger-pr.js.map +1 -1
- package/distribution/commands/danger-runner.js +3 -2
- package/distribution/commands/danger-runner.js.map +1 -1
- package/distribution/danger.d.ts +13 -8
- package/distribution/danger.js.flow +15 -5
- package/distribution/dsl/GitDSL.d.ts +2 -0
- package/distribution/dsl/GitHubDSL.d.ts +6 -1
- package/distribution/dsl/GitLabDSL.d.ts +3 -4
- package/distribution/platforms/FakePlatform.js +1 -1
- package/distribution/platforms/FakePlatform.js.map +1 -1
- package/distribution/platforms/GitHub.js +1 -0
- package/distribution/platforms/GitHub.js.map +1 -1
- package/distribution/platforms/GitLab.d.ts +8 -6
- package/distribution/platforms/GitLab.js +137 -78
- package/distribution/platforms/GitLab.js.map +1 -1
- package/distribution/platforms/encodingParser.d.ts +6 -0
- package/distribution/platforms/encodingParser.js +15 -0
- package/distribution/platforms/encodingParser.js.map +1 -0
- package/distribution/platforms/git/gitJSONToGitDSL.js +5 -1
- package/distribution/platforms/git/gitJSONToGitDSL.js.map +1 -1
- package/distribution/platforms/github/GitHubAPI.js +14 -15
- package/distribution/platforms/github/GitHubAPI.js.map +1 -1
- package/distribution/platforms/github/GitHubUtils.d.ts +2 -2
- package/distribution/platforms/github/GitHubUtils.js +4 -2
- package/distribution/platforms/github/GitHubUtils.js.map +1 -1
- package/distribution/platforms/github/customGitHubRequire.d.ts +1 -1
- package/distribution/platforms/github/customGitHubRequire.js +1 -1
- package/distribution/platforms/github/customGitHubRequire.js.map +1 -1
- package/distribution/platforms/gitlab/GitLabAPI.d.ts +23 -17
- package/distribution/platforms/gitlab/GitLabAPI.js +138 -73
- package/distribution/platforms/gitlab/GitLabAPI.js.map +1 -1
- package/distribution/platforms/gitlab/GitLabGit.d.ts +1 -1
- package/distribution/platforms/gitlab/inlinePositionParser.d.ts +14 -0
- package/distribution/platforms/gitlab/inlinePositionParser.js +125 -0
- package/distribution/platforms/gitlab/inlinePositionParser.js.map +1 -0
- package/distribution/runner/Dangerfile.d.ts +2 -3
- package/distribution/runner/Dangerfile.js.map +1 -1
- package/package.json +17 -18
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,27 @@
|
|
|
17
17
|
<!-- Your comment below this -->
|
|
18
18
|
<!-- Your comment above this -->
|
|
19
19
|
|
|
20
|
+
## 12.0.0
|
|
21
|
+
|
|
22
|
+
Bumping to 12.x because we've raised the minimum to node version from 14 to 18. This is due to some of our dependencies
|
|
23
|
+
requiring a newer version of node. This is a breaking change for some folk! Also, 14 has been out of support for quite a while
|
|
24
|
+
now and Node 18 gives us a full year. - [@orta]
|
|
25
|
+
|
|
26
|
+
- Remove the user checks in GitHub comment/inline comment lookups, to allow using app tokens [#1433] - [@orta]
|
|
27
|
+
- Upgrade `node` engine from `>=14.13.1` to `>=18` [@heltoft]
|
|
28
|
+
- Upgrade `@types/node` from `^10.11.3` to `18.19.18` [@heltoft]
|
|
29
|
+
- GitLab: [#1386] Move from `@gitbeaker/node` to `@gitbeaker/rest` [@heltoft]
|
|
30
|
+
- GitLab: [#1412] Danger fails to create inline comments on Gitlab [@heltoft]
|
|
31
|
+
- GitLab: [#1405] Can't post multiple inline comments [@heltoft]
|
|
32
|
+
- GitLab: Do not delete system resolved danger inline comments [@heltoft]
|
|
33
|
+
- Fix for ESM imports in Dangerfiles [@mgol]
|
|
34
|
+
|
|
35
|
+
## 11.3.1
|
|
36
|
+
|
|
37
|
+
- Adds `pull_number` into `thisPR` in the GitHub SDL [@radimsv]
|
|
38
|
+
- Clear missing DSL timeout when DSL is found so danger runner can exit faster when done [@normano64]
|
|
39
|
+
- Customise GHE actions bot user ID via `DANGER_GHE_ACTIONS_BOT_USER_ID` #1404 [@dimitar-hristov]
|
|
40
|
+
|
|
20
41
|
## 11.3.0
|
|
21
42
|
|
|
22
43
|
- GitLab: Upgrade `@gitbeaker/node` from `^21.3.0` to `^35.8.1` [@buffcode]
|
|
@@ -1978,6 +1999,7 @@ Not usable for others, only stubs of classes etc. - [@orta]
|
|
|
1978
1999
|
[@dbgrandi]: https://github.com/dbgrandi
|
|
1979
2000
|
[@dblandin]: https://github.com/dblandin
|
|
1980
2001
|
[@denieler]: https://github.com/denieler
|
|
2002
|
+
[@dimitar-hristov]: https://github.com/dimitar-hristov
|
|
1981
2003
|
[@dfalling]: https://github.com/dfalling
|
|
1982
2004
|
[@dkundel]: https://github.com/dkundel
|
|
1983
2005
|
[@doniyor2109]: https://github.com/doniyor2109
|
|
@@ -1995,6 +2017,7 @@ Not usable for others, only stubs of classes etc. - [@orta]
|
|
|
1995
2017
|
[@hanneskaeufler]: https://github.com/hanneskaeufler
|
|
1996
2018
|
[@happylinks]: https://github.com/happylinks
|
|
1997
2019
|
[@hellocore]: https://github.com/HelloCore
|
|
2020
|
+
[@heltoft]: https://github.com/heltoft
|
|
1998
2021
|
[@hiroppy]: https://github.com/hiroppy
|
|
1999
2022
|
[@hmcc]: https://github.com/hmcc
|
|
2000
2023
|
[@hmschreiner]: https://github.com/hmschreiner
|
|
@@ -2046,6 +2069,7 @@ Not usable for others, only stubs of classes etc. - [@orta]
|
|
|
2046
2069
|
[@ravanscafi]: https://github.com/ravanscafi
|
|
2047
2070
|
[@rogerluan]: https://github.com/rogerluan
|
|
2048
2071
|
[@rohit-gohri]: https://github.com/rohit-gohri
|
|
2072
|
+
[@radimsv]: https://github.com/radimsv
|
|
2049
2073
|
[@rouby]: https://github.com/rouby
|
|
2050
2074
|
[@rzgry]: https://github.com/rzgry
|
|
2051
2075
|
[@sajjadzamani]: https://github.com/sajjadzamani
|
package/Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM node:
|
|
1
|
+
FROM node:18-slim as build
|
|
2
2
|
|
|
3
3
|
LABEL maintainer="Orta Therox"
|
|
4
4
|
LABEL "com.github.actions.name"="Danger JS Action"
|
|
@@ -16,7 +16,7 @@ RUN yarn install --production --frozen-lockfile
|
|
|
16
16
|
RUN chmod +x distribution/commands/danger.js
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
FROM node:
|
|
19
|
+
FROM node:18-slim
|
|
20
20
|
WORKDIR /usr/src/danger
|
|
21
21
|
ENV PATH="/usr/src/danger/node_modules/.bin:$PATH"
|
|
22
22
|
COPY package.json ./
|
|
@@ -54,6 +54,26 @@ import { Env, CISource } from "../ci_source";
|
|
|
54
54
|
* Note it's likely the version number should change, but you get the point. This will run Danger
|
|
55
55
|
* self-encapsulated inside a GitHub action.
|
|
56
56
|
*
|
|
57
|
+
* If you are using DangerJS on GitHub Enteprise, you will need to set the Danger user ID to
|
|
58
|
+
* the GitHub Actions bot. This will enable Danger to correctly comment and update on PRs.
|
|
59
|
+
*
|
|
60
|
+
* * ```yml
|
|
61
|
+
* name: "Danger JS"
|
|
62
|
+
* on: [pull_request]
|
|
63
|
+
*
|
|
64
|
+
* jobs:
|
|
65
|
+
* build:
|
|
66
|
+
* name: Danger JS
|
|
67
|
+
* runs-on: ubuntu-latest
|
|
68
|
+
* steps:
|
|
69
|
+
* - uses: actions/checkout@v1
|
|
70
|
+
* - name: Danger
|
|
71
|
+
* uses: danger/danger-js@9.1.6
|
|
72
|
+
* env:
|
|
73
|
+
* GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
74
|
+
* DANGER_GHE_ACTIONS_BOT_USER_ID: *user_id*
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
57
77
|
* <!-- !JS --!>
|
|
58
78
|
* <!-- Swift --!>
|
|
59
79
|
*
|
|
@@ -59,6 +59,26 @@ var fs_1 = require("fs");
|
|
|
59
59
|
* Note it's likely the version number should change, but you get the point. This will run Danger
|
|
60
60
|
* self-encapsulated inside a GitHub action.
|
|
61
61
|
*
|
|
62
|
+
* If you are using DangerJS on GitHub Enteprise, you will need to set the Danger user ID to
|
|
63
|
+
* the GitHub Actions bot. This will enable Danger to correctly comment and update on PRs.
|
|
64
|
+
*
|
|
65
|
+
* * ```yml
|
|
66
|
+
* name: "Danger JS"
|
|
67
|
+
* on: [pull_request]
|
|
68
|
+
*
|
|
69
|
+
* jobs:
|
|
70
|
+
* build:
|
|
71
|
+
* name: Danger JS
|
|
72
|
+
* runs-on: ubuntu-latest
|
|
73
|
+
* steps:
|
|
74
|
+
* - uses: actions/checkout@v1
|
|
75
|
+
* - name: Danger
|
|
76
|
+
* uses: danger/danger-js@9.1.6
|
|
77
|
+
* env:
|
|
78
|
+
* GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
79
|
+
* DANGER_GHE_ACTIONS_BOT_USER_ID: *user_id*
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
62
82
|
* <!-- !JS --!>
|
|
63
83
|
* <!-- Swift --!>
|
|
64
84
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHubActions.js","sourceRoot":"","sources":["../../../source/ci_source/providers/GitHubActions.ts"],"names":[],"mappings":";;;AACA,0DAAyD;AACzD,yBAA6C;AAE7C,wCAAwC;AAExC
|
|
1
|
+
{"version":3,"file":"GitHubActions.js","sourceRoot":"","sources":["../../../source/ci_source/providers/GitHubActions.ts"],"names":[],"mappings":";;;AACA,0DAAyD;AACzD,yBAA6C;AAE7C,wCAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA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AAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;QAClF,CAAC;;;OAAA;IAED,sBAAI,mCAAQ;aAAZ;YACE,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS,EAAE;gBACzC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAA;aACnD;iBAAM,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE;gBAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAA;aACvC;YAED,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;QAC7E,CAAC;;;OAAA;IAMH,oBAAC;AAAD,CAAC,AAxDD,IAwDC;AAxDY,sCAAa"}
|
|
@@ -65,7 +65,6 @@ var platform_1 = require("../platforms/platform");
|
|
|
65
65
|
var GitLabAPI_1 = require("../platforms/gitlab/GitLabAPI");
|
|
66
66
|
var d = (0, debug_1.debug)("pr");
|
|
67
67
|
var log = console.log;
|
|
68
|
-
var gitLabApiCredentials = (0, GitLabAPI_1.getGitLabAPICredentialsFromEnv)(process.env);
|
|
69
68
|
commander_1.default
|
|
70
69
|
.usage("[options] <pr_url>")
|
|
71
70
|
.description("Emulate running Danger against an existing GitHub Pull Request.")
|
|
@@ -80,8 +79,8 @@ commander_1.default
|
|
|
80
79
|
!process.env["DANGER_BITBUCKETCLOUD_OAUTH_KEY"] &&
|
|
81
80
|
!process.env["DANGER_BITBUCKETCLOUD_USERNAME"] &&
|
|
82
81
|
!process.env["DANGER_BITBUCKETCLOUD_REPO_ACCESSTOKEN"] &&
|
|
83
|
-
!
|
|
84
|
-
!
|
|
82
|
+
!process.env["DANGER_GITLAB_API_TOKEN"] &&
|
|
83
|
+
!process.env["DANGER_GITLAB_API_OAUTH_TOKEN"]) {
|
|
85
84
|
log("");
|
|
86
85
|
log(" You don't have a DANGER_GITHUB_API_TOKEN/DANGER_GITLAB_API_TOKEN/DANGER_GITLAB_API_OAUTH_TOKEN/DANGER_BITBUCKETCLOUD_OAUTH_KEY/DANGER_BITBUCKETCLOUD_USERNAME/DANGER_BITBUCKETCLOUD_REPO_ACCESSTOKEN set up, this is optional, but TBH, you want to do this.");
|
|
87
86
|
log(" Check out: http://danger.systems/js/guides/the_dangerfile.html#working-on-your-dangerfile");
|
|
@@ -105,7 +104,7 @@ if (commander_1.default.args.length === 0) {
|
|
|
105
104
|
process.exitCode = 1;
|
|
106
105
|
}
|
|
107
106
|
else {
|
|
108
|
-
var customHost_1 = process.env["DANGER_GITHUB_HOST"] || process.env["DANGER_BITBUCKETSERVER_HOST"] ||
|
|
107
|
+
var customHost_1 = process.env["DANGER_GITHUB_HOST"] || process.env["DANGER_BITBUCKETSERVER_HOST"] || (0, GitLabAPI_1.getGitLabHostFromEnv)(process.env); // This defaults to https://www.gitlab.com
|
|
109
108
|
// Allow an ambiguous amount of args to find the PR reference
|
|
110
109
|
var findPR = commander_1.default.args.find(function (a) { return a.includes(customHost_1) || a.includes("github") || a.includes("bitbucket.org"); });
|
|
111
110
|
if (!findPR) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"danger-pr.js","sourceRoot":"","sources":["../../source/commands/danger-pr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wDAA+B;AAC/B,kCAAgC;AAChC,0DAAmC;AAEnC,oDAAoD;AACpD,oEAAkE;AAClE,+CAAkD;AAClD,sFAAuE;AACvE,uDAAyD;AACzD,mEAA8D;AAC9D,sCAAuC;AACvC,kDAAmE;AAEnE,
|
|
1
|
+
{"version":3,"file":"danger-pr.js","sourceRoot":"","sources":["../../source/commands/danger-pr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wDAA+B;AAC/B,kCAAgC;AAChC,0DAAmC;AAEnC,oDA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,IAAI,CAAA;oBACf,IAAA,kBAAS,EAAC,GAAG,EAAE,EAAE,MAAM,QAAA,EAAE,QAAQ,UAAA,EAAE,iBAAiB,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;iBACvF;aACF;SACF;KACF;CACF;AAED,oEAAoE;AACpE,SAAe,kBAAkB,CAAC,QAAkB,EAAE,MAAgB;;;;;wBAClD,qBAAM,IAAA,+BAAgB,EAAC,QAAQ,EAAE,MAAM,EAAE,mBAAO,CAAC;oBACnE,4BAA4B;kBADuC;;oBAA7D,SAAS,GAAG,SAAiD;oBACnE,4BAA4B;oBAC5B,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE;wBACtE,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAA;qBACtG;oBAEK,YAAY,GAAG,IAAA,sCAAgB,EAAC,SAAS,CAAC,CAAA;oBAC1C,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;oBAEvC,IAAI,GAAG,CAAC,IAAI,EAAE;wBACZ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;qBACtD;yBAAM,IAAI,GAAG,CAAC,EAAE,EAAE;wBACjB,OAAO,CAAC,GAAG,CAAC,oBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;qBACvC;;;;;CACF"}
|
|
@@ -88,6 +88,7 @@ var run = function (config) { return function (jsonString) { return __awaiter(vo
|
|
|
88
88
|
platform = (0, platform_1.getPlatformForEnv)(process.env, source);
|
|
89
89
|
d("Got STDIN for Danger Run");
|
|
90
90
|
foundDSL = true;
|
|
91
|
+
clearTimeout(missingDSLTimeout);
|
|
91
92
|
dangerFile = (0, fileUtils_1.dangerfilePath)(commander_1.default);
|
|
92
93
|
return [4 /*yield*/, (0, jsonToContext_1.jsonToContext)(jsonString, commander_1.default, source)];
|
|
93
94
|
case 3:
|
|
@@ -125,9 +126,9 @@ var run = function (config) { return function (jsonString) { return __awaiter(vo
|
|
|
125
126
|
}
|
|
126
127
|
});
|
|
127
128
|
// Add a timeout so that CI doesn't run forever if something has broken.
|
|
128
|
-
setTimeout(function () {
|
|
129
|
+
var missingDSLTimeout = setTimeout(function () {
|
|
129
130
|
if (!foundDSL) {
|
|
130
|
-
console.error(chalk_1.default.red("Timeout: Failed to get the Danger DSL after
|
|
131
|
+
console.error(chalk_1.default.red("Timeout: Failed to get the Danger DSL after 10 second"));
|
|
131
132
|
process.exitCode = 1;
|
|
132
133
|
process.exit(1);
|
|
133
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"danger-runner.js","sourceRoot":"","sources":["../../source/commands/danger-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,sFAAuE;AACvE,8DAAsC;AAEtC,wDAA+B;AAC/B,kCAAgC;AAChC,wDAAgC;AAChC,gDAAyB;AAEzB,oEAA6C;AAC7C,+CAAkD;AAClD,yDAAuD;AAGvD,kFAA2D;AAC3D,kDAAyD;AACzD,yBAA2B;AAC3B,yBAAkC;AAClC,6BAA2B;AAC3B,iCAAoC;AAEpC,IAAM,CAAC,GAAG,IAAA,aAAK,EAAC,QAAQ,CAAC,CAAA;AAEzB,4FAA4F;AAC5F,EAAE;AACF,2MAA2M;AAC3M,EAAE;AACF,mGAAmG;AAEnG,mBAAO;KACJ,KAAK,CAAC,WAAW,CAAC;KAClB,WAAW,CACV,6JAA6J,CAC9J;IACD,6CAA6C;IAC7C,8CAA8C;KAC7C,kBAAkB,CAAC,IAAI,CAAC,CAAA;AAE3B,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,iBAAiB,GAAG,UAAU,CAAC;IACnC,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC,CAAA;QACjF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;AACH,CAAC,EAAE,KAAK,CAAC,CAAA;AAET,qCAAqC;AACrC,IAAA,mBAAQ,GAAE,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAc,CAAC,CAAC,CAAA"}
|
package/distribution/danger.d.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Octokit as GitHub } from "@octokit/rest"
|
|
6
|
-
import
|
|
7
|
-
import { Types as CoreTypes } from "@gitbeaker/core/dist"
|
|
6
|
+
import type * as Types from "@gitbeaker/rest"
|
|
8
7
|
import { File } from "parse-diff"
|
|
9
8
|
|
|
10
9
|
type MarkdownString = string
|
|
@@ -833,6 +832,8 @@ interface TextDiff {
|
|
|
833
832
|
interface StructuredDiff {
|
|
834
833
|
/** Git diff chunks */
|
|
835
834
|
chunks: File["chunks"]
|
|
835
|
+
/** The file path pre-change */
|
|
836
|
+
fromPath: string | undefined
|
|
836
837
|
}
|
|
837
838
|
|
|
838
839
|
/** The results of running a JSON patch */
|
|
@@ -1461,8 +1462,13 @@ interface GitHubAPIPR {
|
|
|
1461
1462
|
owner: string
|
|
1462
1463
|
/** The repo name */
|
|
1463
1464
|
repo: string
|
|
1464
|
-
/**
|
|
1465
|
+
/**
|
|
1466
|
+
* The PR number
|
|
1467
|
+
* @deprecated use `pull_number` instead
|
|
1468
|
+
*/
|
|
1465
1469
|
number: number
|
|
1470
|
+
/** The PR number */
|
|
1471
|
+
pull_number: number
|
|
1466
1472
|
}
|
|
1467
1473
|
|
|
1468
1474
|
interface GitHubReviewers {
|
|
@@ -1476,7 +1482,7 @@ interface GitLabJSONDSL {
|
|
|
1476
1482
|
/** Info about the repo */
|
|
1477
1483
|
metadata: RepoMetaData
|
|
1478
1484
|
/** Info about the merge request */
|
|
1479
|
-
mr:
|
|
1485
|
+
mr: Types.ExpandedMergeRequestSchema
|
|
1480
1486
|
/** All the individual commits in the merge request */
|
|
1481
1487
|
commits: Types.CommitSchema[]
|
|
1482
1488
|
/** Merge Request-level MR approvals Configuration */
|
|
@@ -1491,7 +1497,7 @@ interface GitLabDSL extends GitLabJSONDSL {
|
|
|
1491
1497
|
addLabels(...labels: string[]): Promise<boolean>
|
|
1492
1498
|
removeLabels(...labels: string[]): Promise<boolean>
|
|
1493
1499
|
}
|
|
1494
|
-
api: InstanceType<typeof Gitlab>
|
|
1500
|
+
api: InstanceType<typeof Types.Gitlab>
|
|
1495
1501
|
}
|
|
1496
1502
|
|
|
1497
1503
|
/** Key details about a repo */
|
|
@@ -1561,7 +1567,7 @@ type Scheduleable = Promise<any> | Promise<void> | CallbackableFn
|
|
|
1561
1567
|
declare function schedule(asyncFunction: Scheduleable): void
|
|
1562
1568
|
|
|
1563
1569
|
/**
|
|
1564
|
-
*
|
|
1570
|
+
* Highlights critical issues. Message is shown inside a HTML table.
|
|
1565
1571
|
*
|
|
1566
1572
|
* @param {MarkdownString} message the String to output
|
|
1567
1573
|
* @param {string | undefined} file a file which this message should be attached to
|
|
@@ -1570,8 +1576,7 @@ declare function schedule(asyncFunction: Scheduleable): void
|
|
|
1570
1576
|
declare function fail(message: MarkdownString, file?: string, line?: number): void
|
|
1571
1577
|
|
|
1572
1578
|
/**
|
|
1573
|
-
* Highlights low-priority issues
|
|
1574
|
-
* is shown inside a HTML table.
|
|
1579
|
+
* Highlights low-priority issues. Message is shown inside a HTML table.
|
|
1575
1580
|
*
|
|
1576
1581
|
* @param {MarkdownString} message the String to output
|
|
1577
1582
|
* @param {string | undefined} file a file which this message should be attached to
|
|
@@ -1165,6 +1165,11 @@ declare interface StructuredDiff {
|
|
|
1165
1165
|
* Git diff chunks
|
|
1166
1166
|
*/
|
|
1167
1167
|
chunks: "NO PRINT IMPLEMENTED: IndexedAccessType";
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* The file path pre-change
|
|
1171
|
+
*/
|
|
1172
|
+
fromPath: string | void;
|
|
1168
1173
|
}
|
|
1169
1174
|
/**
|
|
1170
1175
|
* The results of running a JSON patch
|
|
@@ -1902,8 +1907,14 @@ declare interface GitHubAPIPR {
|
|
|
1902
1907
|
|
|
1903
1908
|
/**
|
|
1904
1909
|
* The PR number
|
|
1910
|
+
* @deprecated use `pull_number` instead
|
|
1905
1911
|
*/
|
|
1906
1912
|
number: number;
|
|
1913
|
+
|
|
1914
|
+
/**
|
|
1915
|
+
* The PR number
|
|
1916
|
+
*/
|
|
1917
|
+
pull_number: number;
|
|
1907
1918
|
}
|
|
1908
1919
|
declare interface GitHubReviewers {
|
|
1909
1920
|
/**
|
|
@@ -1925,7 +1936,7 @@ declare interface GitLabJSONDSL {
|
|
|
1925
1936
|
/**
|
|
1926
1937
|
* Info about the merge request
|
|
1927
1938
|
*/
|
|
1928
|
-
mr:
|
|
1939
|
+
mr: Types.ExpandedMergeRequestSchema;
|
|
1929
1940
|
|
|
1930
1941
|
/**
|
|
1931
1942
|
* All the individual commits in the merge request
|
|
@@ -1946,7 +1957,7 @@ declare type GitLabDSL = {
|
|
|
1946
1957
|
addLabels(...labels: string[]): Promise<boolean>,
|
|
1947
1958
|
removeLabels(...labels: string[]): Promise<boolean>,
|
|
1948
1959
|
},
|
|
1949
|
-
api: InstanceType<typeof
|
|
1960
|
+
api: InstanceType<typeof undefined>,
|
|
1950
1961
|
} & GitLabJSONDSL
|
|
1951
1962
|
|
|
1952
1963
|
/**
|
|
@@ -2049,7 +2060,7 @@ section of code to evaluate across multiple tick cycles.
|
|
|
2049
2060
|
declare export function schedule(asyncFunction: Scheduleable): void
|
|
2050
2061
|
|
|
2051
2062
|
/**
|
|
2052
|
-
*
|
|
2063
|
+
* Highlights critical issues. Message is shown inside a HTML table.
|
|
2053
2064
|
* @param the String to output
|
|
2054
2065
|
* @param a file which this message should be attached to
|
|
2055
2066
|
* @param the line which this message should be attached to
|
|
@@ -2057,8 +2068,7 @@ declare export function schedule(asyncFunction: Scheduleable): void
|
|
|
2057
2068
|
declare export function fail(message: MarkdownString, file?: string, line?: number): void
|
|
2058
2069
|
|
|
2059
2070
|
/**
|
|
2060
|
-
* Highlights low-priority issues
|
|
2061
|
-
* is shown inside a HTML table.
|
|
2071
|
+
* Highlights low-priority issues. Message is shown inside a HTML table.
|
|
2062
2072
|
* @param the String to output
|
|
2063
2073
|
* @param a file which this message should be attached to
|
|
2064
2074
|
* @param the line which this message should be attached to
|
|
@@ -18,6 +18,8 @@ export interface TextDiff {
|
|
|
18
18
|
export interface StructuredDiff {
|
|
19
19
|
/** Git diff chunks */
|
|
20
20
|
chunks: File["chunks"];
|
|
21
|
+
/** The file path pre-change */
|
|
22
|
+
fromPath: string | undefined;
|
|
21
23
|
}
|
|
22
24
|
/** The results of running a JSON patch */
|
|
23
25
|
export interface JSONPatch {
|
|
@@ -387,8 +387,13 @@ export interface GitHubAPIPR {
|
|
|
387
387
|
owner: string;
|
|
388
388
|
/** The repo name */
|
|
389
389
|
repo: string;
|
|
390
|
-
/**
|
|
390
|
+
/**
|
|
391
|
+
* The PR number
|
|
392
|
+
* @deprecated use `pull_number` instead
|
|
393
|
+
*/
|
|
391
394
|
number: number;
|
|
395
|
+
/** The PR number */
|
|
396
|
+
pull_number: number;
|
|
392
397
|
}
|
|
393
398
|
export interface GitHubReviewers {
|
|
394
399
|
/** Users that have been requested */
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type * as Types from "@gitbeaker/rest";
|
|
2
2
|
import { RepoMetaData } from "./RepoMetaData";
|
|
3
|
-
import { Types as CoreTypes } from "@gitbeaker/core/dist";
|
|
4
3
|
export interface GitLabJSONDSL {
|
|
5
4
|
/** Info about the repo */
|
|
6
5
|
metadata: RepoMetaData;
|
|
7
6
|
/** Info about the merge request */
|
|
8
|
-
mr:
|
|
7
|
+
mr: Types.ExpandedMergeRequestSchema;
|
|
9
8
|
/** All the individual commits in the merge request */
|
|
10
9
|
commits: Types.CommitSchema[];
|
|
11
10
|
/** Merge Request-level MR approvals Configuration */
|
|
@@ -18,5 +17,5 @@ export interface GitLabDSL extends GitLabJSONDSL {
|
|
|
18
17
|
addLabels(...labels: string[]): Promise<boolean>;
|
|
19
18
|
removeLabels(...labels: string[]): Promise<boolean>;
|
|
20
19
|
};
|
|
21
|
-
api: InstanceType<typeof Gitlab>;
|
|
20
|
+
api: InstanceType<typeof Types.Gitlab>;
|
|
22
21
|
}
|
|
@@ -77,7 +77,7 @@ var FakePlatform = /** @class */ (function () {
|
|
|
77
77
|
return [2 /*return*/, ({ before: "", after: "", diff: "", added: "", removed: "" })];
|
|
78
78
|
}); }); },
|
|
79
79
|
structuredDiffForFile: function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
80
|
-
return [2 /*return*/, ({ chunks: [] })];
|
|
80
|
+
return [2 /*return*/, ({ chunks: [], fromPath: undefined })];
|
|
81
81
|
}); }); },
|
|
82
82
|
JSONDiffForFile: function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
83
83
|
return [2 /*return*/, ({})];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FakePlatform.js","sourceRoot":"","sources":["../../source/platforms/FakePlatform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8EAAuD;AAEvD,yBAAiC;AAEjC;IAGE;QA8EA,oBAAe,GAAG,UAAC,IAAY,IAAK,OAAA,IAAI,OAAO,CAAS,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAA,iBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,EAA/B,CAA+B,CAAC,EAA7D,CAA6D,CAAA;QAEjG,uBAAkB,GACh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BACD,WAAW,EAAE;4BAAY,sBAAA,CAAC,EAAA;iCAAA;qBAC3B,EAAA;;;KACF;IAEK,wCAAiB,GAAvB,UAAwB,CAAS;;;gBAC/B,sBAAO,EAAE,EAAA;;;KACV;IAED,yCAAkB,GAAlB;QACE,OAAO,IAAI,CAAA;IACb,CAAC;IAED,6CAAsB,GAAtB;QACE,OAAO,IAAI,CAAA;IACb,CAAC;IAEK,4CAAqB,GAA3B,UAA4B,SAAiB,EAAE,WAAmB;;;gBAChE,sBAAO,gFAAgF,EAAA;;;KACxF;IAEK,oCAAa,GAAnB,UAAoB,QAAgB;;;gBAClC,sBAAO,IAAI,EAAA;;;KACZ;IAEK,0CAAmB,GAAzB,UAA0B,IAAY,EAAE,QAAgB,EAAE,KAAa,EAAE,KAAa;;;gBACpF,sBAAO,IAAI,EAAA;;;KACZ;IAEK,0CAAmB,GAAzB,UAA0B,QAAgB,EAAE,UAAkB;;;gBAC5D,sBAAO,IAAI,EAAA;;;KACZ;IAEK,0CAAmB,GAAzB,UAA0B,GAAW;;;gBACnC,sBAAO,IAAI,EAAA;;;KACZ;IAEK,wCAAiB,GAAvB;;;gBACE,sBAAO,IAAI,EAAA;;;KACZ;IAEK,mCAAY,GAAlB;;;gBACE,sBAAO,IAAI,EAAA;;;KACZ;IAMH,mBAAC;AAAD,CAAC,AArFD,IAqFC;AArFY,oCAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHub.js","sourceRoot":"","sources":["../../source/platforms/GitHub.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,qEAA8C;AAC9C,iEAAgD;AAKhD,gEAAoE;AACpE,kEAAsE;AAMtE,SAAgB,MAAM,CAAC,GAAc;IAArC,
|
|
1
|
+
{"version":3,"file":"GitHub.js","sourceRoot":"","sources":["../../source/platforms/GitHub.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,CAAC,EAAE;oBAC7C,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC,CAAA;iBAChF;gBAED,4CAA4C;gBAC5C,qBAAM,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC;oBAEpE,mBAAmB;kBAFiD;;gBADpE,4CAA4C;gBAC5C,SAAoE,CAAA;gBAEpE,mBAAmB;gBACnB,2BAA2B,EAAE,CAAA;;;;KAC9B,CAAA"}
|
|
@@ -2,7 +2,7 @@ import GitLabAPI from "./gitlab/GitLabAPI";
|
|
|
2
2
|
import { Comment, Platform } from "./platform";
|
|
3
3
|
import { GitDSL, GitJSONDSL } from "../dsl/GitDSL";
|
|
4
4
|
import { GitLabDSL, GitLabJSONDSL } from "../dsl/GitLabDSL";
|
|
5
|
-
import
|
|
5
|
+
import type * as Types from "@gitbeaker/rest";
|
|
6
6
|
declare class GitLab implements Platform {
|
|
7
7
|
readonly api: GitLabAPI;
|
|
8
8
|
readonly name: string;
|
|
@@ -14,21 +14,23 @@ declare class GitLab implements Platform {
|
|
|
14
14
|
supportsCommenting(): boolean;
|
|
15
15
|
supportsInlineComments(): boolean;
|
|
16
16
|
updateOrCreateComment: (dangerID: string, newComment: string) => Promise<string>;
|
|
17
|
-
createComment: (_dangerID: string, comment: string) => Promise<Types.
|
|
17
|
+
createComment: (_dangerID: string, comment: string) => Promise<Types.DiscussionNoteSchema | Types.MergeRequestNoteSchema | undefined>;
|
|
18
18
|
createInlineComment: (git: GitDSL, comment: string, path: string, line: number) => Promise<Types.DiscussionSchema>;
|
|
19
|
-
updateInlineComment: (comment: string, id: string) => Promise<Types.
|
|
19
|
+
updateInlineComment: (comment: string, id: string) => Promise<Types.MergeRequestNoteSchema>;
|
|
20
20
|
deleteInlineComment: (id: string) => Promise<boolean>;
|
|
21
21
|
/**
|
|
22
22
|
* Attempts to delete the "main" Danger comment. If the "main" Danger
|
|
23
23
|
* comment has any comments on it then that comment will not be deleted.
|
|
24
24
|
*/
|
|
25
25
|
deleteMainComment: (dangerID: string) => Promise<boolean>;
|
|
26
|
-
|
|
26
|
+
deleteDiscussions: (discussions: Types.DiscussionSchema[]) => Promise<boolean>;
|
|
27
|
+
deleteDiscussion: (discussion: Types.DiscussionSchema) => Promise<boolean>;
|
|
27
28
|
/**
|
|
28
29
|
* Only fetches the discussions where danger owns the top note
|
|
29
30
|
*/
|
|
30
31
|
getDangerDiscussions: (dangerID: string) => Promise<Types.DiscussionSchema[]>;
|
|
31
|
-
|
|
32
|
+
isDangerDiscussionSystemResolved: (discussion: Types.DiscussionSchema) => boolean;
|
|
33
|
+
getDiffNotesFromDiscussions: (discussions: Types.DiscussionSchema[]) => Types.DiscussionNoteSchema[];
|
|
32
34
|
/**
|
|
33
35
|
* Attempts to find the "main" Danger note and should return at most
|
|
34
36
|
* one item. If the "main" Danger note has any comments on it then that
|
|
@@ -38,7 +40,7 @@ declare class GitLab implements Platform {
|
|
|
38
40
|
/**
|
|
39
41
|
* Filters a note to determine if it was created by Danger.
|
|
40
42
|
*/
|
|
41
|
-
getDangerDiscussionNoteFilter: (dangerID: string) => Promise<(note: Types.
|
|
43
|
+
getDangerDiscussionNoteFilter: (dangerID: string) => Promise<(note: Types.DiscussionNoteSchema) => boolean>;
|
|
42
44
|
/**
|
|
43
45
|
* Filters a note to the "main" Danger note. If that note has any
|
|
44
46
|
* comments on it then it will not be found.
|