@toptal/davinci-ci 2.0.8 → 2.0.9-alpha-fx-2996-add-error-message-for-missing-engine.15
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/package.json +4 -3
- package/src/configs/jobs/deploy-helm-run/Jenkinsfile +1 -1
- package/src/configs/jobs/master-main/Jenkinsfile +1 -1
- package/src/configs/jobs/publish-alpha-package/Jenkinsfile +1 -1
- package/dist-package/package.json +0 -39
- package/src/configs/danger/toptal/plugins/toptal-commits/toptal-commits.test.js +0 -128
- package/src/configs/danger/toptal/plugins/toptal-pr-title/toptal-pr-title.test.js +0 -68
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/davinci-ci",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9-alpha-fx-2996-add-error-message-for-missing-engine.15+227d5ea7",
|
|
4
4
|
"description": "Continuos integrations tools for frontend projects",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@commitlint/cli": "^17.0.2",
|
|
34
34
|
"@commitlint/config-conventional": "^17.0.3",
|
|
35
|
-
"@toptal/davinci-cli-shared": "1.6.
|
|
35
|
+
"@toptal/davinci-cli-shared": "1.6.1-alpha-fx-2996-add-error-message-for-missing-engine.21+227d5ea7",
|
|
36
36
|
"danger": "^11.0.7",
|
|
37
37
|
"markdown-table": "^2.0.0"
|
|
38
|
-
}
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "227d5ea750c2b2ce9f4abd1ff33bbe1838ae9d28"
|
|
39
40
|
}
|
|
@@ -138,7 +138,7 @@ pipeline {
|
|
|
138
138
|
-e SENTRY_PROJECT=${REPOSITORY_NAME} \
|
|
139
139
|
-e SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} \
|
|
140
140
|
gcr.io/toptal-hub/${REPOSITORY_NAME}:${TAG} \
|
|
141
|
-
yarn davinci
|
|
141
|
+
yarn davinci-engine sentry-upload-source-maps
|
|
142
142
|
"""
|
|
143
143
|
} else {
|
|
144
144
|
info "Your current davinci version is not supporting uploading source maps to Sentry. Please update davinci package version in your app."
|
|
@@ -273,7 +273,7 @@ pipeline {
|
|
|
273
273
|
steps {
|
|
274
274
|
script {
|
|
275
275
|
PWD = sh(returnStdout: true, script: 'pwd').trim()
|
|
276
|
-
releasePackageCommand = 'yarn davinci
|
|
276
|
+
releasePackageCommand = 'yarn davinci-engine release-package'
|
|
277
277
|
|
|
278
278
|
def outputVersionParamExistsInDavinci = hasParamInDavinciCommand(
|
|
279
279
|
command: 'engine release-package',
|
|
@@ -126,7 +126,7 @@ pipeline {
|
|
|
126
126
|
-v ${PWD}/.git:/app/.git \
|
|
127
127
|
gcr.io/toptal-hub/${repositoryName}:${commitId} \
|
|
128
128
|
/bin/bash -c "yarn ${params.BUILD_PACKAGE_SCRIPT_NAME} && \
|
|
129
|
-
yarn davinci
|
|
129
|
+
yarn davinci-engine publish-package \
|
|
130
130
|
--alpha \
|
|
131
131
|
--outputVersion /artifacts/.version \
|
|
132
132
|
--branch ${sourceBranch}"
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@toptal/davinci-ci",
|
|
3
|
-
"version": "2.0.8",
|
|
4
|
-
"description": "Continuos integrations tools for frontend projects",
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
7
|
-
},
|
|
8
|
-
"keywords": [
|
|
9
|
-
"jenkins",
|
|
10
|
-
"docker",
|
|
11
|
-
"ci"
|
|
12
|
-
],
|
|
13
|
-
"author": "Toptal",
|
|
14
|
-
"homepage": "https://github.com/toptal/davinci/tree/master/packages/ci#readme",
|
|
15
|
-
"license": "ISC",
|
|
16
|
-
"bin": {
|
|
17
|
-
"davinci-ci": "./bin/davinci-ci.js"
|
|
18
|
-
},
|
|
19
|
-
"main": "./src/index.js",
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/toptal/davinci.git"
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build:package": "../../bin/build-package.js",
|
|
26
|
-
"prepublishOnly": "../../bin/prepublish.js",
|
|
27
|
-
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
28
|
-
},
|
|
29
|
-
"bugs": {
|
|
30
|
-
"url": "https://github.com/toptal/davinci/issues"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@commitlint/cli": "^17.0.2",
|
|
34
|
-
"@commitlint/config-conventional": "^17.0.3",
|
|
35
|
-
"@toptal/davinci-cli-shared": "1.6.0",
|
|
36
|
-
"danger": "^11.0.7",
|
|
37
|
-
"markdown-table": "^2.0.0"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
const { toptalCommits } = require('.')
|
|
2
|
-
|
|
3
|
-
const prepareCommitsWithMessages = (messages = []) => ({
|
|
4
|
-
commits: messages.map(message => ({
|
|
5
|
-
message,
|
|
6
|
-
sha: '123',
|
|
7
|
-
})),
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
describe('commit danger plugin', () => {
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
global.fail = jest.fn()
|
|
13
|
-
global.danger = {
|
|
14
|
-
github: {
|
|
15
|
-
pr: {
|
|
16
|
-
user: {
|
|
17
|
-
login: 'user',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
afterEach(() => {
|
|
25
|
-
global.fail = undefined
|
|
26
|
-
global.danger = undefined
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
it('commit with title only', () => {
|
|
30
|
-
global.danger.git = prepareCommitsWithMessages(['Hello world'])
|
|
31
|
-
toptalCommits()
|
|
32
|
-
|
|
33
|
-
expect(global.fail).toHaveBeenCalledTimes(0)
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
it('commit with title and body', () => {
|
|
37
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
38
|
-
'Hello world\n\nSome commit body here.',
|
|
39
|
-
])
|
|
40
|
-
toptalCommits()
|
|
41
|
-
|
|
42
|
-
expect(global.fail).toHaveBeenCalledTimes(0)
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
it('commit with multi-line body', () => {
|
|
46
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
47
|
-
'Hello world\n\nFirst line of commit body\nSecond line of commit body',
|
|
48
|
-
])
|
|
49
|
-
toptalCommits()
|
|
50
|
-
|
|
51
|
-
expect(global.fail).toHaveBeenCalledTimes(0)
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
it('commit with title longer than allowed', () => {
|
|
55
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
56
|
-
'This commit message is a teeny tiny bit longer than allowed length of 79 characters',
|
|
57
|
-
])
|
|
58
|
-
toptalCommits()
|
|
59
|
-
|
|
60
|
-
expect(global.fail).toHaveBeenCalledTimes(1)
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
it('commit with body lines longer than allowed', () => {
|
|
64
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
65
|
-
'Short commit title\n\nBut this body line commit message is a bit longer than allowed length of 79 characters\nAnd this one is fine again.',
|
|
66
|
-
])
|
|
67
|
-
toptalCommits()
|
|
68
|
-
|
|
69
|
-
expect(global.fail).toHaveBeenCalledTimes(1)
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
it('commit message not starting with an uppercase letter', () => {
|
|
73
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
74
|
-
'23432 starts with a number',
|
|
75
|
-
'starts with a lowercase letter',
|
|
76
|
-
'* starts with a symbol',
|
|
77
|
-
' starts with a space',
|
|
78
|
-
])
|
|
79
|
-
toptalCommits()
|
|
80
|
-
|
|
81
|
-
expect(global.fail).toHaveBeenCalledTimes(4)
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
it('commit message ending with a period in title', () => {
|
|
85
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
86
|
-
'Commit title ending with period.',
|
|
87
|
-
])
|
|
88
|
-
toptalCommits()
|
|
89
|
-
|
|
90
|
-
expect(global.fail).toHaveBeenCalledTimes(1)
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
it('commit without a blank line between title and body', () => {
|
|
94
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
95
|
-
'Commit title\nBody without a blank line after title',
|
|
96
|
-
])
|
|
97
|
-
toptalCommits()
|
|
98
|
-
|
|
99
|
-
expect(global.fail).toHaveBeenCalledTimes(1)
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
it('valid commit titles', () => {
|
|
103
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
104
|
-
'Regular commit title',
|
|
105
|
-
'Commit with sentence. But does not end with a full-stop',
|
|
106
|
-
'[FOO-1234] Commit with prefix',
|
|
107
|
-
'[FOO] Prefix numbers can be omitted',
|
|
108
|
-
'[FOO][BAR] Prefixes can couple',
|
|
109
|
-
'[FOO-1234][BAR] Mixed prefixes',
|
|
110
|
-
'[FOO-1234][BAR-123][BAZ] Everything. Together',
|
|
111
|
-
])
|
|
112
|
-
toptalCommits()
|
|
113
|
-
|
|
114
|
-
expect(global.fail).toHaveBeenCalledTimes(0)
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
it('invalid commit title prefixes', () => {
|
|
118
|
-
global.danger.git = prepareCommitsWithMessages([
|
|
119
|
-
'[FOO-1234] commit with lowercase',
|
|
120
|
-
'[FOO-BAR] Prefix with letter after dash',
|
|
121
|
-
'[FOO] [BAR] Prefixes with space between',
|
|
122
|
-
'[FOO]Prefix without space',
|
|
123
|
-
])
|
|
124
|
-
toptalCommits()
|
|
125
|
-
|
|
126
|
-
expect(global.fail).toHaveBeenCalledTimes(4)
|
|
127
|
-
})
|
|
128
|
-
})
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
const { toptalPRTitle } = require('.')
|
|
2
|
-
const {
|
|
3
|
-
MISSING_TICKET_CODE_ERROR_MESSAGE,
|
|
4
|
-
DEFAULT_PR_TITLE_ERROR_MESSAGE,
|
|
5
|
-
} = require('../../config')
|
|
6
|
-
|
|
7
|
-
const VALID_PR_TITLE = '[ASD-123] Hello world'
|
|
8
|
-
const INVALID_PR_TITLE = '[ASD-123] hello world'
|
|
9
|
-
const NO_TICKET_CODE_PR_TITLE = 'Hello world'
|
|
10
|
-
|
|
11
|
-
describe('commit danger plugin', () => {
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
global.fail = jest.fn()
|
|
14
|
-
global.danger = {
|
|
15
|
-
github: {
|
|
16
|
-
issue: {
|
|
17
|
-
labels: [{ name: 'My Team' }],
|
|
18
|
-
},
|
|
19
|
-
pr: {
|
|
20
|
-
title: '',
|
|
21
|
-
user: {
|
|
22
|
-
login: 'user',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
afterEach(() => {
|
|
30
|
-
global.fail = undefined
|
|
31
|
-
global.danger = undefined
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('should pass valid PR title', () => {
|
|
35
|
-
global.danger.github.pr.title = VALID_PR_TITLE
|
|
36
|
-
|
|
37
|
-
toptalPRTitle()
|
|
38
|
-
|
|
39
|
-
expect(global.fail).toHaveBeenCalledTimes(0)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
it('should fail PR title with missing ticket code', () => {
|
|
43
|
-
global.danger.github.pr.title = NO_TICKET_CODE_PR_TITLE
|
|
44
|
-
|
|
45
|
-
toptalPRTitle()
|
|
46
|
-
|
|
47
|
-
expect(global.fail).toHaveBeenCalledTimes(1)
|
|
48
|
-
expect(global.fail).toHaveBeenCalledWith(MISSING_TICKET_CODE_ERROR_MESSAGE)
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
it('should pass valid PR title with missing ticket code and no-jira label', () => {
|
|
52
|
-
global.danger.github.pr.title = NO_TICKET_CODE_PR_TITLE
|
|
53
|
-
global.danger.github.issue.labels = [{ name: 'no-jira' }]
|
|
54
|
-
|
|
55
|
-
toptalPRTitle()
|
|
56
|
-
|
|
57
|
-
expect(global.fail).toHaveBeenCalledTimes(0)
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
it('should fail invalid PR title', () => {
|
|
61
|
-
global.danger.github.pr.title = INVALID_PR_TITLE
|
|
62
|
-
|
|
63
|
-
toptalPRTitle()
|
|
64
|
-
|
|
65
|
-
expect(global.fail).toHaveBeenCalledTimes(1)
|
|
66
|
-
expect(global.fail).toHaveBeenCalledWith(DEFAULT_PR_TITLE_ERROR_MESSAGE)
|
|
67
|
-
})
|
|
68
|
-
})
|