danger 11.2.8 → 11.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/distribution/ci_source/providers/GitHubActions.d.ts +20 -0
  3. package/distribution/ci_source/providers/GitHubActions.js +20 -0
  4. package/distribution/ci_source/providers/GitHubActions.js.map +1 -1
  5. package/distribution/commands/danger-runner.js +3 -2
  6. package/distribution/commands/danger-runner.js.map +1 -1
  7. package/distribution/danger.d.ts +14 -277
  8. package/distribution/danger.js.flow +12 -302
  9. package/distribution/dsl/GitHubDSL.d.ts +6 -1
  10. package/distribution/dsl/GitLabDSL.d.ts +6 -246
  11. package/distribution/platforms/GitHub.js +1 -0
  12. package/distribution/platforms/GitHub.js.map +1 -1
  13. package/distribution/platforms/GitLab.d.ts +11 -10
  14. package/distribution/platforms/GitLab.js +33 -26
  15. package/distribution/platforms/GitLab.js.map +1 -1
  16. package/distribution/platforms/bitbucket_cloud/BitBucketCloudAPI.js +4 -3
  17. package/distribution/platforms/bitbucket_cloud/BitBucketCloudAPI.js.map +1 -1
  18. package/distribution/platforms/github/GitHubAPI.js +6 -1
  19. package/distribution/platforms/github/GitHubAPI.js.map +1 -1
  20. package/distribution/platforms/gitlab/GitLabAPI.d.ts +18 -108
  21. package/distribution/platforms/gitlab/GitLabAPI.js +22 -21
  22. package/distribution/platforms/gitlab/GitLabAPI.js.map +1 -1
  23. package/distribution/platforms/gitlab/GitLabGit.d.ts +3 -2
  24. package/distribution/platforms/gitlab/GitLabGit.js.map +1 -1
  25. package/distribution/runner/Dangerfile.d.ts +2 -3
  26. package/distribution/runner/Dangerfile.js.map +1 -1
  27. package/distribution/runner/templates/githubIssueTemplate.js +1 -1
  28. package/distribution/runner/templates/githubIssueTemplate.js.map +1 -1
  29. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -17,6 +17,16 @@
17
17
  <!-- Your comment below this -->
18
18
  <!-- Your comment above this -->
19
19
 
20
+ ## 11.3.1
21
+
22
+ - Adds `pull_number` into `thisPR` in the GitHub SDL [@radimsv]
23
+ - Clear missing DSL timeout when DSL is found so danger runner can exit faster when done [@normano64]
24
+ - Customise GHE actions bot user ID via `DANGER_GHE_ACTIONS_BOT_USER_ID` #1404 [@dimitar-hristov]
25
+
26
+ ## 11.3.0
27
+
28
+ - GitLab: Upgrade `@gitbeaker/node` from `^21.3.0` to `^35.8.1` [@buffcode]
29
+
20
30
  ## 11.2.8
21
31
 
22
32
  - Another fix for Gitlab inline comments #1395 [@glensc]
@@ -1963,6 +1973,7 @@ Not usable for others, only stubs of classes etc. - [@orta]
1963
1973
  [@azz]: https://github.com/azz
1964
1974
  [@bdotdub]: https://github.com/bdotdub
1965
1975
  [@bigkraig]: https://github.com/bigkraig
1976
+ [@buffcode]: https://github.com/buffcode
1966
1977
  [@caffodian]: https://github.com/caffodian
1967
1978
  [@codestergit]: https://github.com/codestergit
1968
1979
  [@cwright017]: https://github.com/Cwright017
@@ -1973,6 +1984,7 @@ Not usable for others, only stubs of classes etc. - [@orta]
1973
1984
  [@dbgrandi]: https://github.com/dbgrandi
1974
1985
  [@dblandin]: https://github.com/dblandin
1975
1986
  [@denieler]: https://github.com/denieler
1987
+ [@dimitar-hristov]: https://github.com/dimitar-hristov
1976
1988
  [@dfalling]: https://github.com/dfalling
1977
1989
  [@dkundel]: https://github.com/dkundel
1978
1990
  [@doniyor2109]: https://github.com/doniyor2109
@@ -2041,6 +2053,7 @@ Not usable for others, only stubs of classes etc. - [@orta]
2041
2053
  [@ravanscafi]: https://github.com/ravanscafi
2042
2054
  [@rogerluan]: https://github.com/rogerluan
2043
2055
  [@rohit-gohri]: https://github.com/rohit-gohri
2056
+ [@radimsv]: https://github.com/radimsv
2044
2057
  [@rouby]: https://github.com/rouby
2045
2058
  [@rzgry]: https://github.com/rzgry
2046
2059
  [@sajjadzamani]: https://github.com/sajjadzamani
@@ -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;A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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"}
@@ -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 1 second"));
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;AAE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AAuD,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"}
@@ -3,7 +3,8 @@
3
3
  //
4
4
 
5
5
  import { Octokit as GitHub } from "@octokit/rest"
6
- import { Gitlab } from "@gitbeaker/node"
6
+ import { Gitlab, Types } from "@gitbeaker/node"
7
+ import { Types as CoreTypes } from "@gitbeaker/core/dist"
7
8
  import { File } from "parse-diff"
8
9
 
9
10
  type MarkdownString = string
@@ -1460,8 +1461,13 @@ interface GitHubAPIPR {
1460
1461
  owner: string
1461
1462
  /** The repo name */
1462
1463
  repo: string
1463
- /** The PR number */
1464
+ /**
1465
+ * The PR number
1466
+ * @deprecated use `pull_number` instead
1467
+ */
1464
1468
  number: number
1469
+ /** The PR number */
1470
+ pull_number: number
1465
1471
  }
1466
1472
 
1467
1473
  interface GitHubReviewers {
@@ -1475,11 +1481,11 @@ interface GitLabJSONDSL {
1475
1481
  /** Info about the repo */
1476
1482
  metadata: RepoMetaData
1477
1483
  /** Info about the merge request */
1478
- mr: GitLabMR
1479
- /** All of the individual commits in the merge request */
1480
- commits: GitLabMRCommit[]
1484
+ mr: CoreTypes.ExpandedMergeRequestSchema
1485
+ /** All the individual commits in the merge request */
1486
+ commits: Types.CommitSchema[]
1481
1487
  /** Merge Request-level MR approvals Configuration */
1482
- approvals: GitLabApproval
1488
+ approvals: Types.MergeRequestLevelMergeRequestApprovalSchema
1483
1489
  }
1484
1490
 
1485
1491
  // danger.gitlab
@@ -1493,274 +1499,6 @@ interface GitLabDSL extends GitLabJSONDSL {
1493
1499
  api: InstanceType<typeof Gitlab>
1494
1500
  }
1495
1501
 
1496
- // ---
1497
- // JSON responses from API
1498
-
1499
- interface GitLabUser {
1500
- id: number
1501
- name: string
1502
- username: string
1503
- state: "active" | "blocked"
1504
- avatar_url: string | null
1505
- web_url: string
1506
- }
1507
-
1508
- interface GitLabUserProfile extends GitLabUser {
1509
- created_at: string
1510
- bio: string | null
1511
- location: string | null
1512
- public_email: string
1513
- skype: string
1514
- linkedin: string
1515
- twitter: string
1516
- website_url: string
1517
- organization: string
1518
- last_sign_in_at: string
1519
- confirmed_at: string
1520
- theme_id: number
1521
- last_activity_on: string
1522
- color_scheme_id: number
1523
- projects_limit: number
1524
- current_sign_in_at: string
1525
- identities: [{ provider: string; extern_uid: string }]
1526
- can_create_group: boolean
1527
- can_create_project: boolean
1528
- two_factor_enabled: boolean
1529
- external: boolean
1530
- private_profile: boolean
1531
- }
1532
-
1533
- interface GitLabMRBase {
1534
- /** The MR's id */
1535
- id: number
1536
-
1537
- /** The unique ID for this MR */
1538
- iid: number
1539
-
1540
- /** The project ID for this MR */
1541
- project_id: number
1542
-
1543
- /** The given name of the MR */
1544
- title: string
1545
-
1546
- /** The body text describing the MR */
1547
- description: string
1548
-
1549
- /** The MR's current availability */
1550
- state: "closed" | "open" | "locked" | "merged"
1551
-
1552
- /** When was the MR made */
1553
- created_at: string
1554
-
1555
- /** When was the MR updated */
1556
- updated_at: string
1557
-
1558
- /** What branch is this MR being merged into */
1559
- target_branch: string
1560
- /** What branch is this MR come from */
1561
- source_branch: string
1562
-
1563
- /** How many folks have given it an upvote */
1564
- upvotes: number
1565
- /** How many folks have given it an downvote */
1566
- downvotes: number
1567
-
1568
- /** Who made it */
1569
- author: GitLabUser
1570
- /** Access rights for the user who created the MR */
1571
- user: {
1572
- /** Does the author have access to merge? */
1573
- can_merge: boolean
1574
- }
1575
- /** Who was assigned as the person to review */
1576
- assignee?: GitLabUser
1577
- assignees: GitLabUser[]
1578
- /** Users who were added as reviewers to the MR */
1579
- reviewers: GitLabUser[]
1580
- source_project_id: number
1581
- target_project_id: number
1582
- labels: string[]
1583
- work_in_progress: boolean
1584
- milestone: {
1585
- id: number
1586
- iid: number
1587
- project_id: number
1588
- title: string
1589
- description: string
1590
- state: "closed" | "active"
1591
- created_at: string
1592
- updated_at: string
1593
- due_date: string
1594
- start_date: string
1595
- web_url: string
1596
- }
1597
- merge_when_pipeline_succeeds: boolean
1598
- merge_status: "can_be_merged" // XXX: other statuses?
1599
- merge_error: null | null
1600
- sha: string
1601
- merge_commit_sha: string | null
1602
- user_notes_count: number
1603
- discussion_locked: null | null
1604
- should_remove_source_branch: boolean
1605
- force_remove_source_branch: boolean
1606
- allow_collaboration: boolean
1607
- allow_maintainer_to_push: boolean
1608
- web_url: string
1609
- time_stats: {
1610
- time_estimate: number
1611
- total_time_spent: number
1612
- human_time_estimate: number | null
1613
- human_total_time_spent: number | null
1614
- }
1615
- }
1616
-
1617
- /** TODO: These need more comments from someone who uses GitLab, see GitLabDSL.ts in the danger-js repo */
1618
- interface GitLabMR extends GitLabMRBase {
1619
- squash: boolean
1620
- subscribed: boolean
1621
- changes_count: string
1622
- merged_by: GitLabUser
1623
- merged_at: string
1624
- closed_by: GitLabUser | null
1625
- closed_at: string | null
1626
- latest_build_started_at: string
1627
- latest_build_finished_at: string
1628
- first_deployed_to_production_at: string | null
1629
- pipeline: {
1630
- id: number
1631
- sha: string
1632
- ref: string
1633
- status: "canceled" | "failed" | "pending" | "running" | "skipped" | "success"
1634
- web_url: string
1635
- }
1636
- diff_refs: {
1637
- base_sha: string
1638
- head_sha: string
1639
- start_sha: string
1640
- }
1641
- diverged_commits_count: number
1642
- rebase_in_progress: boolean
1643
- approvals_before_merge: null | null
1644
- }
1645
-
1646
- interface GitLabMRChange {
1647
- old_path: string
1648
- new_path: string
1649
- a_mode: string
1650
- b_mode: string
1651
- diff: string
1652
- new_file: boolean
1653
- renamed_file: boolean
1654
- deleted_file: boolean
1655
- }
1656
-
1657
- interface GitLabMRChanges extends GitLabMRBase {
1658
- changes: GitLabMRChange[]
1659
- }
1660
-
1661
- interface GitLabNote {
1662
- id: number
1663
- type: "DiffNote" | "DiscussionNote" | null // XXX: other types? null means "normal comment"
1664
- body: string
1665
- attachment: null // XXX: what can an attachment be?
1666
- author: GitLabUser
1667
- created_at: string
1668
- updated_at: string
1669
- system: boolean
1670
- noteable_id: number
1671
- noteable_type: "MergeRequest" // XXX: other types...?
1672
- resolvable: boolean
1673
- noteable_iid: number
1674
- }
1675
-
1676
- interface GitLabDiscussion {
1677
- id: string //40 character hex
1678
- individual_note: boolean
1679
- notes: GitLabNote[]
1680
- }
1681
-
1682
- interface GitLabDiscussionTextPosition {
1683
- position_type: "text"
1684
- base_sha: string
1685
- start_sha: string
1686
- head_sha: string
1687
- new_path: string
1688
- new_line: number
1689
- old_path: string
1690
- old_line: number | null
1691
- }
1692
-
1693
- interface GitLabDiscussionCreationOptions {
1694
- position?: GitLabDiscussionTextPosition
1695
- }
1696
-
1697
- interface GitLabInlineNote extends GitLabNote {
1698
- position: {
1699
- base_sha: string
1700
- start_sha: string
1701
- head_sha: string
1702
- old_path: string
1703
- new_path: string
1704
- position_type: "text" // XXX: other types?
1705
- old_line: number | null
1706
- new_line: number
1707
- }
1708
- resolvable: boolean
1709
- resolved: boolean
1710
- resolved_by: GitLabUser | null
1711
- }
1712
-
1713
- interface GitLabMRCommit {
1714
- id: string
1715
- short_id: string
1716
- created_at: string
1717
- parent_ids: string[]
1718
- title: string
1719
- message: string
1720
- author_name: string
1721
- author_email: string
1722
- authored_date: string
1723
- committer_name: string
1724
- committer_email: string
1725
- committed_date: string
1726
- }
1727
-
1728
- interface GitLabCommit {
1729
- id: string
1730
- short_id: string
1731
- title: string
1732
- author_name: string
1733
- author_email: string
1734
- created_at: string
1735
- }
1736
-
1737
- interface GitLabRepositoryCompare {
1738
- commit: GitLabCommit
1739
- commits: GitLabCommit[]
1740
- diffs: GitLabMRChange[]
1741
- compare_timeout: boolean
1742
- compare_same_ref: boolean
1743
- }
1744
-
1745
- interface GitLabApproval {
1746
- id: number
1747
- iid: number
1748
- project_id: number
1749
- title: string
1750
- description: string
1751
- state: "closed" | "open" | "locked" | "merged"
1752
- created_at: string
1753
- updated_at: string
1754
- merge_status: "can_be_merged"
1755
- approvals_required: number
1756
- approvals_left: number
1757
- approved_by?:
1758
- | {
1759
- user: GitLabUser
1760
- }[]
1761
- | GitLabUser[]
1762
- }
1763
-
1764
1502
  /** Key details about a repo */
1765
1503
  interface RepoMetaData {
1766
1504
  /** A path like "artsy/eigen" */
@@ -1828,7 +1566,7 @@ type Scheduleable = Promise<any> | Promise<void> | CallbackableFn
1828
1566
  declare function schedule(asyncFunction: Scheduleable): void
1829
1567
 
1830
1568
  /**
1831
- * Fails a build, outputting a specific reason for failing into a HTML table.
1569
+ * Highlights critical issues. Message is shown inside a HTML table.
1832
1570
  *
1833
1571
  * @param {MarkdownString} message the String to output
1834
1572
  * @param {string | undefined} file a file which this message should be attached to
@@ -1837,8 +1575,7 @@ declare function schedule(asyncFunction: Scheduleable): void
1837
1575
  declare function fail(message: MarkdownString, file?: string, line?: number): void
1838
1576
 
1839
1577
  /**
1840
- * Highlights low-priority issues, but does not fail the build. Message
1841
- * is shown inside a HTML table.
1578
+ * Highlights low-priority issues. Message is shown inside a HTML table.
1842
1579
  *
1843
1580
  * @param {MarkdownString} message the String to output
1844
1581
  * @param {string | undefined} file a file which this message should be attached to