@toptal/davinci-ci 2.0.14-alpha-feature-fx-1939-collect-davinci-metrics-efa08b80.73 → 2.0.14-alpha-FX-3285-assigne-dangerjs-rule-b2cb5b97.58

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/README.md CHANGED
@@ -47,6 +47,9 @@ master:
47
47
  deploy_staging: false
48
48
  deploy_storybook_staging: false
49
49
  deploy: false
50
+ conventional_commits: false # danger check will require each commit to follow convential commits
51
+ force_assignee: false # danger check will require each PR to have assignee
52
+ force_assignee_whitelist: ['dependabot-preview[bot]', 'dependabot[bot]']
50
53
 
51
54
  # Customize Slack channel where the notifications will get posted
52
55
  slack_channel: 'custom-slack-channel'
package/bin/davinci-ci.js CHANGED
@@ -4,5 +4,5 @@ const cliEngine = require('@toptal/davinci-cli-shared')
4
4
 
5
5
  const { commands } = require('../src')
6
6
 
7
- cliEngine.loadCommands(commands, 'davinci-ci')
7
+ cliEngine.loadCommands(commands)
8
8
  cliEngine.bootstrap()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-ci",
3
- "version": "2.0.14-alpha-feature-fx-1939-collect-davinci-metrics-efa08b80.73+efa08b80",
3
+ "version": "2.0.14-alpha-FX-3285-assigne-dangerjs-rule-b2cb5b97.58+b2cb5b97",
4
4
  "description": "Continuos integrations tools for frontend projects",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -32,9 +32,9 @@
32
32
  "dependencies": {
33
33
  "@commitlint/cli": "^17.0.2",
34
34
  "@commitlint/config-conventional": "^17.1.0",
35
- "@toptal/davinci-cli-shared": "1.8.2-alpha-feature-fx-1939-collect-davinci-metrics-efa08b80.119+efa08b80",
35
+ "@toptal/davinci-cli-shared": "1.8.2-alpha-FX-3285-assigne-dangerjs-rule-b2cb5b97.104+b2cb5b97",
36
36
  "danger": "^11.0.7",
37
37
  "markdown-table": "^2.0.0"
38
38
  },
39
- "gitHead": "efa08b80844f1832ba6130d7bceb0952eebf8e57"
39
+ "gitHead": "b2cb5b9737ec998c8c7130d14d95262d9437cb9e"
40
40
  }
@@ -1,7 +1,17 @@
1
1
  const { schedule } = require('danger')
2
+ const { davinciProjectConfig } = require('@toptal/davinci-cli-shared')
2
3
 
3
4
  const { conventionalCommits } = require('./plugins/conventional-commits')
4
5
  const { conventionalPRTitle } = require('./plugins/conventional-pr-title')
6
+ const { emptyAssignee } = require('../plugins/empty-assignee')
5
7
 
6
8
  schedule(conventionalCommits)
7
9
  schedule(conventionalPRTitle)
10
+
11
+ const {
12
+ master: { forceAssigne },
13
+ } = davinciProjectConfig
14
+
15
+ if (forceAssigne) {
16
+ schedule(emptyAssignee)
17
+ }
@@ -0,0 +1,24 @@
1
+ /// <reference types="danger" />
2
+ /* globals danger, fail */
3
+ const { davinciProjectConfig } = require('@toptal/davinci-cli-shared')
4
+
5
+ const {
6
+ master: { forceAssigneWhiteList = [] },
7
+ } = davinciProjectConfig
8
+
9
+ const WHITELISTED_USERS = forceAssigneWhiteList
10
+ const emptyAssignee = () => {
11
+ const isLocalRun = !danger.github
12
+
13
+ if (isLocalRun || WHITELISTED_USERS.includes(danger.github.pr.user.login)) {
14
+ return
15
+ }
16
+
17
+ if (!danger.github.pr.assignee || danger.github.pr.assignees.length === 0) {
18
+ fail('Please assign someone to this PR before merging.')
19
+ }
20
+ }
21
+
22
+ module.exports = {
23
+ emptyAssignee,
24
+ }
@@ -1,7 +1,17 @@
1
1
  const { schedule } = require('danger')
2
+ const { davinciProjectConfig } = require('@toptal/davinci-cli-shared')
2
3
 
3
4
  const { toptalCommits } = require('./plugins/toptal-commits')
4
5
  const { toptalPRTitle } = require('./plugins/toptal-pr-title')
6
+ const { emptyAssignee } = require('../plugins/empty-assignee')
5
7
 
6
8
  schedule(toptalCommits)
7
9
  schedule(toptalPRTitle)
10
+
11
+ const {
12
+ master: { forceAssigne },
13
+ } = davinciProjectConfig
14
+
15
+ if (forceAssigne) {
16
+ schedule(emptyAssignee)
17
+ }