gitlab-radiator 5.0.0 → 5.2.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/.github/copilot-instructions.md +55 -0
- package/.github/workflows/test.yml +22 -0
- package/.nvmrc +1 -0
- package/README.md +1 -0
- package/bin/gitlab-radiator.js +1 -1
- package/build-npm +22 -0
- package/eslint.config.mjs +31 -0
- package/package.json +4 -4
- package/public/client.less +4 -0
- package/screenshot.png +0 -0
- package/src/client/arguments.ts +61 -0
- package/src/client/groupedProjects.tsx +18 -0
- package/src/client/groups.tsx +50 -0
- package/src/client/index.tsx +79 -0
- package/src/client/info.tsx +16 -0
- package/src/client/jobs.tsx +57 -0
- package/src/client/projects.tsx +82 -0
- package/src/client/stages.tsx +18 -0
- package/src/client/timestamp.tsx +37 -0
- package/src/client/tsconfig.json +24 -0
- package/src/common/gitlab-types.d.ts +1 -0
- package/src/config.ts +24 -24
- package/src/dev-assets.ts +15 -0
- package/src/gitlab/client.ts +1 -1
- package/src/gitlab/index.ts +1 -0
- package/src/gitlab/projects.ts +1 -1
- package/test/gitlab-integration.ts +457 -0
- package/tsconfig.build.json +14 -0
- package/tsconfig.json +25 -0
- package/webpack.common.cjs +25 -0
- package/webpack.dev.cjs +13 -0
- package/webpack.prod.cjs +9 -0
- package/public/client.js +0 -2
- package/public/client.js.LICENSE.txt +0 -43
package/src/config.ts
CHANGED
|
@@ -18,6 +18,7 @@ const GitlabSchema = z.strictObject({
|
|
|
18
18
|
branch: z.string().min(1).optional(),
|
|
19
19
|
caFile: z.string().optional(),
|
|
20
20
|
offlineRunners: z.literal(['all', 'default', 'none']).default('default'),
|
|
21
|
+
commitAsTitle: z.boolean().default(false),
|
|
21
22
|
projects: z.strictObject({
|
|
22
23
|
excludePipelineStatus: z.array(JobStatusSchema).optional(),
|
|
23
24
|
include: z.string().min(1).optional(),
|
|
@@ -29,7 +30,7 @@ const GitlabSchema = z.strictObject({
|
|
|
29
30
|
throw new Error('Mandatory gitlab access token missing from configuration (and none present at GITLAB_ACCESS_TOKEN env variable)')
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
const {url, ignoreArchived, maxNonFailedJobsVisible, caFile, branch,offlineRunners, projects} = gitlab
|
|
33
|
+
const {url, ignoreArchived, maxNonFailedJobsVisible, caFile, branch, offlineRunners, commitAsTitle, projects} = gitlab
|
|
33
34
|
const ca = caFile && fs.existsSync(caFile) ? fs.readFileSync(caFile, 'utf-8') : undefined
|
|
34
35
|
|
|
35
36
|
return {
|
|
@@ -40,34 +41,13 @@ const GitlabSchema = z.strictObject({
|
|
|
40
41
|
ca,
|
|
41
42
|
offlineRunners,
|
|
42
43
|
'access-token': accessToken,
|
|
44
|
+
commitAsTitle,
|
|
43
45
|
projects
|
|
44
46
|
}
|
|
45
47
|
})
|
|
46
48
|
|
|
47
49
|
export type Gitlab = z.infer<typeof GitlabSchema>
|
|
48
50
|
|
|
49
|
-
const ColorSchema = z.literal([
|
|
50
|
-
'background',
|
|
51
|
-
'created-background',
|
|
52
|
-
'created-text',
|
|
53
|
-
'dark-text',
|
|
54
|
-
'error-message-background',
|
|
55
|
-
'error-message-text',
|
|
56
|
-
'failed-background',
|
|
57
|
-
'failed-text',
|
|
58
|
-
'group-background',
|
|
59
|
-
'light-text',
|
|
60
|
-
'pending-background',
|
|
61
|
-
'pending-text',
|
|
62
|
-
'project-background',
|
|
63
|
-
'running-background',
|
|
64
|
-
'running-text',
|
|
65
|
-
'skipped-background',
|
|
66
|
-
'skipped-text',
|
|
67
|
-
'success-background',
|
|
68
|
-
'success-text'
|
|
69
|
-
])
|
|
70
|
-
|
|
71
51
|
const OrderSchema = z.literal(['status', 'name', 'id', 'nameWithoutNamespace', 'group'])
|
|
72
52
|
|
|
73
53
|
const ConfigSchema = z.strictObject({
|
|
@@ -80,7 +60,27 @@ const ConfigSchema = z.strictObject({
|
|
|
80
60
|
groupSuccessfulProjects: z.boolean().default(false),
|
|
81
61
|
projectsOrder: z.array(OrderSchema).default(['name']),
|
|
82
62
|
gitlabs: z.array(GitlabSchema).min(1, {message: 'Mandatory gitlab properties missing from configuration file'}),
|
|
83
|
-
colors: z.
|
|
63
|
+
colors: z.strictObject({
|
|
64
|
+
background: z.string(),
|
|
65
|
+
'created-background': z.string(),
|
|
66
|
+
'created-text': z.string(),
|
|
67
|
+
'dark-text': z.string(),
|
|
68
|
+
'error-message-background': z.string(),
|
|
69
|
+
'error-message-text': z.string(),
|
|
70
|
+
'failed-background': z.string(),
|
|
71
|
+
'failed-text': z.string(),
|
|
72
|
+
'group-background': z.string(),
|
|
73
|
+
'light-text': z.string(),
|
|
74
|
+
'pending-background': z.string(),
|
|
75
|
+
'pending-text': z.string(),
|
|
76
|
+
'project-background': z.string(),
|
|
77
|
+
'running-background': z.string(),
|
|
78
|
+
'running-text': z.string(),
|
|
79
|
+
'skipped-background': z.string(),
|
|
80
|
+
'skipped-text': z.string(),
|
|
81
|
+
'success-background': z.string(),
|
|
82
|
+
'success-text': z.string()
|
|
83
|
+
}).partial().optional(),
|
|
84
84
|
auth: z.strictObject({
|
|
85
85
|
username: z.string(),
|
|
86
86
|
password: z.string()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {createRequire} from 'module'
|
|
2
|
+
import webpack from 'webpack'
|
|
3
|
+
import webpackDevMiddleware from 'webpack-dev-middleware'
|
|
4
|
+
import webpackHotMiddleware from 'webpack-hot-middleware'
|
|
5
|
+
import type {Configuration} from 'webpack'
|
|
6
|
+
import type {Express} from 'express'
|
|
7
|
+
|
|
8
|
+
const require = createRequire(import.meta.url)
|
|
9
|
+
|
|
10
|
+
export function bindDevAssets(app: Express) {
|
|
11
|
+
const config = require('../webpack.dev.cjs') as Configuration
|
|
12
|
+
const compiler = webpack(config)
|
|
13
|
+
app.use(webpackDevMiddleware(compiler))
|
|
14
|
+
app.use(webpackHotMiddleware(compiler))
|
|
15
|
+
}
|
package/src/gitlab/client.ts
CHANGED
|
@@ -2,7 +2,7 @@ import axios from 'axios'
|
|
|
2
2
|
import https from 'https'
|
|
3
3
|
import url from 'url'
|
|
4
4
|
import type {AxiosInstance} from 'axios'
|
|
5
|
-
import type {Gitlab} from '../config'
|
|
5
|
+
import type {Gitlab} from '../config.ts'
|
|
6
6
|
|
|
7
7
|
export type PartialGitlab = Pick<Gitlab, 'url' | 'access-token' | 'ca' | 'branch'>
|
|
8
8
|
|
package/src/gitlab/index.ts
CHANGED
package/src/gitlab/projects.ts
CHANGED
|
@@ -2,7 +2,7 @@ import {gitlabRequest} from './client.ts'
|
|
|
2
2
|
import type {Gitlab} from '../config.ts'
|
|
3
3
|
import type {Project} from '../common/gitlab-types.d.ts'
|
|
4
4
|
|
|
5
|
-
export type PartialProject = Omit<Project, 'pipelines' | 'maxNonFailedJobsVisible' | 'status'>
|
|
5
|
+
export type PartialProject = Omit<Project, 'pipelines' | 'maxNonFailedJobsVisible' | 'commitAsTitle' | 'status'>
|
|
6
6
|
|
|
7
7
|
interface GitlabProjectResponse {
|
|
8
8
|
id: number
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import {expect} from 'chai'
|
|
2
|
+
import {fetchLatestPipelines} from '../src/gitlab/pipelines.ts'
|
|
3
|
+
import {fetchProjects} from '../src/gitlab/projects.ts'
|
|
4
|
+
import {update} from '../src/gitlab/index.ts'
|
|
5
|
+
|
|
6
|
+
const gitlab = {
|
|
7
|
+
url: 'https://gitlab.com',
|
|
8
|
+
'access-token': 'glpat-kC8nLT6EZqYfbcv6WHqg',
|
|
9
|
+
maxNonFailedJobsVisible: 10,
|
|
10
|
+
ignoreArchived: true,
|
|
11
|
+
branch: undefined,
|
|
12
|
+
ca: undefined,
|
|
13
|
+
offlineRunners: 'none' as const,
|
|
14
|
+
commitAsTitle: false,
|
|
15
|
+
projects: undefined
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe('Gitlab client', () => {
|
|
19
|
+
it('Should find five projects with no filtering ', async () => {
|
|
20
|
+
const config = {...gitlab}
|
|
21
|
+
const projects = await fetchProjects(config)
|
|
22
|
+
expect(projects).to.deep.equal([
|
|
23
|
+
{archived: false, default_branch: 'master', group: 'gitlab-radiator-test', id: 39541352, name: 'gitlab-radiator-test/project-with-child-pipeline', nameWithoutNamespace: 'project-with-child-pipeline', topics: [], url: 'https://gitlab.com/gitlab-radiator-test/project-with-child-pipeline'},
|
|
24
|
+
{archived: false, default_branch: 'master', group: 'gitlab-radiator-test', id: 5385889, name: 'gitlab-radiator-test/ci-skip-test-project', nameWithoutNamespace: 'ci-skip-test-project', topics: [], url: 'https://gitlab.com/gitlab-radiator-test/ci-skip-test-project'},
|
|
25
|
+
{archived: false, default_branch: 'master', group: 'gitlab-radiator-test', id: 5304923, name: 'gitlab-radiator-test/empty-test', nameWithoutNamespace: 'empty-test', topics: [], url: 'https://gitlab.com/gitlab-radiator-test/empty-test'},
|
|
26
|
+
{archived: false, default_branch: 'master', group: 'gitlab-radiator-test', id: 5290928, name: 'gitlab-radiator-test/integration-test-project-2', nameWithoutNamespace: 'integration-test-project-2', topics: [], url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2'},
|
|
27
|
+
{archived: false, default_branch: 'master', group: 'gitlab-radiator-test', id: 5290865, name: 'gitlab-radiator-test/integration-test-project-1', nameWithoutNamespace: 'integration-test-project-1', topics: ['display-1'], url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1'}
|
|
28
|
+
])
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('Should find one project with inclusive filtering', async () => {
|
|
32
|
+
const config = {...gitlab, projects: {include: '.*project-1'}}
|
|
33
|
+
const projects = await fetchProjects(config)
|
|
34
|
+
expect(projects).to.deep.equal([
|
|
35
|
+
{archived: false, default_branch: 'master', id: 5290865, group: 'gitlab-radiator-test', name: 'gitlab-radiator-test/integration-test-project-1', nameWithoutNamespace: 'integration-test-project-1', topics: ['display-1'], url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1'}
|
|
36
|
+
])
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('Should find four projects with exclusive filtering', async () => {
|
|
40
|
+
const config = {...gitlab, projects: {exclude: '.*project-1'}}
|
|
41
|
+
const projects = await fetchProjects(config)
|
|
42
|
+
expect(projects).to.deep.equal([
|
|
43
|
+
{archived: false, default_branch: 'master', group: 'gitlab-radiator-test', id: 39541352, name: 'gitlab-radiator-test/project-with-child-pipeline', nameWithoutNamespace: 'project-with-child-pipeline', topics: [], url: 'https://gitlab.com/gitlab-radiator-test/project-with-child-pipeline'},
|
|
44
|
+
{archived: false, default_branch: 'master', id: 5385889, group: 'gitlab-radiator-test', name: 'gitlab-radiator-test/ci-skip-test-project', nameWithoutNamespace: 'ci-skip-test-project', topics: [], url: 'https://gitlab.com/gitlab-radiator-test/ci-skip-test-project'},
|
|
45
|
+
{archived: false, default_branch: 'master', id: 5304923, group: 'gitlab-radiator-test', name: 'gitlab-radiator-test/empty-test', nameWithoutNamespace: 'empty-test', topics: [], url: 'https://gitlab.com/gitlab-radiator-test/empty-test'},
|
|
46
|
+
{archived: false, default_branch: 'master', id: 5290928, group: 'gitlab-radiator-test', name: 'gitlab-radiator-test/integration-test-project-2', nameWithoutNamespace: 'integration-test-project-2', topics: [], url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2'}
|
|
47
|
+
])
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('Should find latest non-skipped pipeline for project', async () => {
|
|
51
|
+
const config = {...gitlab}
|
|
52
|
+
const pipelines = await fetchLatestPipelines(5385889, config, false)
|
|
53
|
+
expect(pipelines).to.deep.equal(
|
|
54
|
+
[{
|
|
55
|
+
commit: {
|
|
56
|
+
author: 'Heikki Pora',
|
|
57
|
+
title: '[ci skip] do nothing'
|
|
58
|
+
},
|
|
59
|
+
id: 1261086942,
|
|
60
|
+
ref: 'master',
|
|
61
|
+
stages: [{
|
|
62
|
+
jobs: [{
|
|
63
|
+
finishedAt: '2024-04-20T08:24:58.581Z',
|
|
64
|
+
id: 6674648871,
|
|
65
|
+
name: 'test',
|
|
66
|
+
startedAt: '2024-04-20T08:24:31.697Z',
|
|
67
|
+
status: 'success',
|
|
68
|
+
url: 'https://gitlab.com/gitlab-radiator-test/ci-skip-test-project/-/jobs/6674648871'
|
|
69
|
+
}],
|
|
70
|
+
name: 'test'
|
|
71
|
+
}],
|
|
72
|
+
status: 'success'
|
|
73
|
+
}]
|
|
74
|
+
)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('Should find latest pipelines for project (feature branch + master) with stages and retried jobs merged to one entry', async () => {
|
|
78
|
+
const config = {...gitlab}
|
|
79
|
+
const pipelines = await fetchLatestPipelines(5290928, config, false)
|
|
80
|
+
expect(pipelines).to.deep.equal(
|
|
81
|
+
[{
|
|
82
|
+
id: 234613306,
|
|
83
|
+
status: 'success',
|
|
84
|
+
commit: {
|
|
85
|
+
title: 'Fail more',
|
|
86
|
+
author: 'Heikki Pora'
|
|
87
|
+
},
|
|
88
|
+
ref: 'feature/test-branch',
|
|
89
|
+
stages: [
|
|
90
|
+
{
|
|
91
|
+
name: 'test',
|
|
92
|
+
jobs: [
|
|
93
|
+
{
|
|
94
|
+
id: 932599898,
|
|
95
|
+
status: 'success',
|
|
96
|
+
name: 'fail_randomly_long_name',
|
|
97
|
+
startedAt: '2020-12-26T13:59:35.397Z',
|
|
98
|
+
finishedAt: '2020-12-26T14:00:11.845Z',
|
|
99
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2/-/jobs/932599898'
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'build',
|
|
105
|
+
jobs: [
|
|
106
|
+
{
|
|
107
|
+
id: 932599715,
|
|
108
|
+
status: 'success',
|
|
109
|
+
name: 'build_my_stuff',
|
|
110
|
+
startedAt: '2020-12-26T14:00:12.710Z',
|
|
111
|
+
finishedAt: '2020-12-26T14:00:53.946Z',
|
|
112
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2/-/jobs/932599715'
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 234613296,
|
|
120
|
+
status: 'failed',
|
|
121
|
+
commit: {
|
|
122
|
+
author: 'Heikki Pora',
|
|
123
|
+
title: 'Fail more'
|
|
124
|
+
},
|
|
125
|
+
ref: 'master',
|
|
126
|
+
stages: [
|
|
127
|
+
{
|
|
128
|
+
jobs: [
|
|
129
|
+
{
|
|
130
|
+
finishedAt: '2020-12-26T14:01:11.815Z',
|
|
131
|
+
id: 932600811,
|
|
132
|
+
name: 'fail_randomly_long_name',
|
|
133
|
+
startedAt: '2020-12-26T14:00:39.928Z',
|
|
134
|
+
status: 'failed',
|
|
135
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2/-/jobs/932600811'
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
name: 'test'
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
jobs: [
|
|
142
|
+
{
|
|
143
|
+
finishedAt: '2020-12-26T13:59:28.050Z',
|
|
144
|
+
id: 932599688,
|
|
145
|
+
name: 'build_my_stuff',
|
|
146
|
+
startedAt: '2020-12-26T13:58:54.325Z',
|
|
147
|
+
status: 'success',
|
|
148
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2/-/jobs/932599688'
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
name: 'build'
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
}]
|
|
155
|
+
)
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
it('Should find two projects with two pipelines for the first and one for the second (and exclude projects without pipelines)', async () => {
|
|
159
|
+
const gitlabs = [{...gitlab, projects: {exclude: '.*-with-child-pipeline'}}]
|
|
160
|
+
const projects = await update(gitlabs, false)
|
|
161
|
+
expect(projects).to.deep.equal(
|
|
162
|
+
[
|
|
163
|
+
{
|
|
164
|
+
archived: false,
|
|
165
|
+
default_branch: 'master',
|
|
166
|
+
group: 'gitlab-radiator-test',
|
|
167
|
+
id: 5385889,
|
|
168
|
+
commitAsTitle: false,
|
|
169
|
+
maxNonFailedJobsVisible: 10,
|
|
170
|
+
name: 'gitlab-radiator-test/ci-skip-test-project',
|
|
171
|
+
nameWithoutNamespace: 'ci-skip-test-project',
|
|
172
|
+
topics: [],
|
|
173
|
+
url: 'https://gitlab.com/gitlab-radiator-test/ci-skip-test-project',
|
|
174
|
+
pipelines: [
|
|
175
|
+
{
|
|
176
|
+
id: 1261086942,
|
|
177
|
+
status: 'success',
|
|
178
|
+
commit: {
|
|
179
|
+
author: 'Heikki Pora',
|
|
180
|
+
title: '[ci skip] do nothing'
|
|
181
|
+
},
|
|
182
|
+
ref: 'master',
|
|
183
|
+
stages: [{
|
|
184
|
+
jobs: [{
|
|
185
|
+
finishedAt: '2024-04-20T08:24:58.581Z',
|
|
186
|
+
id: 6674648871,
|
|
187
|
+
name: 'test',
|
|
188
|
+
startedAt: '2024-04-20T08:24:31.697Z',
|
|
189
|
+
status: 'success',
|
|
190
|
+
url: 'https://gitlab.com/gitlab-radiator-test/ci-skip-test-project/-/jobs/6674648871'
|
|
191
|
+
}],
|
|
192
|
+
name: 'test'
|
|
193
|
+
}]
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
status: 'success'
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
archived: false,
|
|
200
|
+
default_branch: 'master',
|
|
201
|
+
group: 'gitlab-radiator-test',
|
|
202
|
+
id: 5290928,
|
|
203
|
+
commitAsTitle: false,
|
|
204
|
+
maxNonFailedJobsVisible: 10,
|
|
205
|
+
name: 'gitlab-radiator-test/integration-test-project-2',
|
|
206
|
+
nameWithoutNamespace: 'integration-test-project-2',
|
|
207
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2',
|
|
208
|
+
topics: [],
|
|
209
|
+
pipelines: [
|
|
210
|
+
{
|
|
211
|
+
id: 234613306,
|
|
212
|
+
status: 'success',
|
|
213
|
+
commit: {
|
|
214
|
+
title: 'Fail more',
|
|
215
|
+
author: 'Heikki Pora'
|
|
216
|
+
},
|
|
217
|
+
ref: 'feature/test-branch',
|
|
218
|
+
stages: [
|
|
219
|
+
{
|
|
220
|
+
name: 'test',
|
|
221
|
+
jobs: [
|
|
222
|
+
{
|
|
223
|
+
id: 932599898,
|
|
224
|
+
status: 'success',
|
|
225
|
+
name: 'fail_randomly_long_name',
|
|
226
|
+
startedAt: '2020-12-26T13:59:35.397Z',
|
|
227
|
+
finishedAt: '2020-12-26T14:00:11.845Z',
|
|
228
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2/-/jobs/932599898'
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: 'build',
|
|
234
|
+
jobs: [
|
|
235
|
+
{
|
|
236
|
+
id: 932599715,
|
|
237
|
+
status: 'success',
|
|
238
|
+
name: 'build_my_stuff',
|
|
239
|
+
startedAt: '2020-12-26T14:00:12.710Z',
|
|
240
|
+
finishedAt: '2020-12-26T14:00:53.946Z',
|
|
241
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2/-/jobs/932599715'
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
id: 234613296,
|
|
249
|
+
ref: 'master',
|
|
250
|
+
status: 'failed',
|
|
251
|
+
commit: {
|
|
252
|
+
title: 'Fail more',
|
|
253
|
+
author: 'Heikki Pora'
|
|
254
|
+
},
|
|
255
|
+
stages: [
|
|
256
|
+
{
|
|
257
|
+
name: 'test',
|
|
258
|
+
jobs: [
|
|
259
|
+
{
|
|
260
|
+
id: 932600811,
|
|
261
|
+
status: 'failed',
|
|
262
|
+
name: 'fail_randomly_long_name',
|
|
263
|
+
startedAt: '2020-12-26T14:00:39.928Z',
|
|
264
|
+
finishedAt: '2020-12-26T14:01:11.815Z',
|
|
265
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2/-/jobs/932600811'
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: 'build',
|
|
271
|
+
jobs: [
|
|
272
|
+
{
|
|
273
|
+
id: 932599688,
|
|
274
|
+
status: 'success',
|
|
275
|
+
name: 'build_my_stuff',
|
|
276
|
+
startedAt: '2020-12-26T13:58:54.325Z',
|
|
277
|
+
finishedAt: '2020-12-26T13:59:28.050Z',
|
|
278
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-2/-/jobs/932599688'
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
status: 'failed'
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
archived: false,
|
|
289
|
+
default_branch: 'master',
|
|
290
|
+
group: 'gitlab-radiator-test',
|
|
291
|
+
id: 5290865,
|
|
292
|
+
commitAsTitle: false,
|
|
293
|
+
maxNonFailedJobsVisible: 10,
|
|
294
|
+
name: 'gitlab-radiator-test/integration-test-project-1',
|
|
295
|
+
nameWithoutNamespace: 'integration-test-project-1',
|
|
296
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1',
|
|
297
|
+
topics: ['display-1'],
|
|
298
|
+
pipelines: [
|
|
299
|
+
{
|
|
300
|
+
id: 234493901,
|
|
301
|
+
ref: 'master',
|
|
302
|
+
status: 'success',
|
|
303
|
+
commit: {
|
|
304
|
+
title: 'Fail manual step',
|
|
305
|
+
author: 'Heikki Pora'
|
|
306
|
+
},
|
|
307
|
+
stages: [
|
|
308
|
+
{
|
|
309
|
+
name: 'test',
|
|
310
|
+
jobs: [
|
|
311
|
+
{
|
|
312
|
+
id: 932213321,
|
|
313
|
+
status: 'success',
|
|
314
|
+
name: 'api-test',
|
|
315
|
+
startedAt: '2020-12-25T20:02:42.733Z',
|
|
316
|
+
finishedAt: '2020-12-25T20:03:36.383Z',
|
|
317
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1/-/jobs/932213321'
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
id: 932213322,
|
|
321
|
+
status: 'success',
|
|
322
|
+
name: 'browser-test',
|
|
323
|
+
startedAt: '2020-12-25T20:02:43.020Z',
|
|
324
|
+
finishedAt: '2020-12-25T20:03:28.386Z',
|
|
325
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1/-/jobs/932213322'
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
id: 932213319,
|
|
329
|
+
status: 'success',
|
|
330
|
+
name: 'eslint',
|
|
331
|
+
startedAt: '2020-12-25T20:02:42.444Z',
|
|
332
|
+
finishedAt: '2020-12-25T20:03:34.931Z',
|
|
333
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1/-/jobs/932213319'
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
id: 932213320,
|
|
337
|
+
status: 'success',
|
|
338
|
+
name: 'verify',
|
|
339
|
+
startedAt: '2020-12-25T20:02:42.663Z',
|
|
340
|
+
finishedAt: '2020-12-25T20:03:35.364Z',
|
|
341
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1/-/jobs/932213320'
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: 'build',
|
|
347
|
+
jobs: [
|
|
348
|
+
{
|
|
349
|
+
id: 932213323,
|
|
350
|
+
status: 'success',
|
|
351
|
+
name: 'package-my-stuff',
|
|
352
|
+
startedAt: '2020-12-25T20:03:37.107Z',
|
|
353
|
+
finishedAt: '2020-12-25T20:04:22.618Z',
|
|
354
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1/-/jobs/932213323'
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: 'deploy',
|
|
360
|
+
jobs: [
|
|
361
|
+
{
|
|
362
|
+
id: 932213324,
|
|
363
|
+
status: 'success',
|
|
364
|
+
name: 'deploy-my-awesome-stuff',
|
|
365
|
+
startedAt: '2020-12-25T20:04:23.450Z',
|
|
366
|
+
finishedAt: '2020-12-25T20:05:14.167Z',
|
|
367
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1/-/jobs/932213324'
|
|
368
|
+
}
|
|
369
|
+
]
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: 'finnish',
|
|
373
|
+
jobs: [
|
|
374
|
+
{
|
|
375
|
+
id: 932213325,
|
|
376
|
+
status: 'manual',
|
|
377
|
+
name: 'manual_step-1',
|
|
378
|
+
finishedAt: null,
|
|
379
|
+
startedAt: null,
|
|
380
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1/-/jobs/932213325'
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
id: 932213326,
|
|
384
|
+
status: 'manual',
|
|
385
|
+
name: 'manual_step-2',
|
|
386
|
+
finishedAt: null,
|
|
387
|
+
startedAt: null,
|
|
388
|
+
url: 'https://gitlab.com/gitlab-radiator-test/integration-test-project-1/-/jobs/932213326'
|
|
389
|
+
}
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
}
|
|
394
|
+
],
|
|
395
|
+
status: 'success'
|
|
396
|
+
}]
|
|
397
|
+
)
|
|
398
|
+
})
|
|
399
|
+
|
|
400
|
+
it('Should include triggered child pipeline for project', async () => {
|
|
401
|
+
const config = {...gitlab}
|
|
402
|
+
const pipelines = await fetchLatestPipelines(39541352, config, false)
|
|
403
|
+
expect(pipelines).to.deep.equal(
|
|
404
|
+
[{
|
|
405
|
+
commit: {
|
|
406
|
+
author: 'Heikki Pora',
|
|
407
|
+
title: 'Add job triggering another project'
|
|
408
|
+
},
|
|
409
|
+
id: 1261086879,
|
|
410
|
+
ref: 'master',
|
|
411
|
+
stages: [{
|
|
412
|
+
jobs: [{
|
|
413
|
+
finishedAt: '2024-04-20T08:24:30.130Z',
|
|
414
|
+
id: 6674648615,
|
|
415
|
+
name: 'start-job',
|
|
416
|
+
startedAt: '2024-04-20T08:24:03.377Z',
|
|
417
|
+
status: 'success',
|
|
418
|
+
url: 'https://gitlab.com/gitlab-radiator-test/project-with-child-pipeline/-/jobs/6674648615'
|
|
419
|
+
}],
|
|
420
|
+
name: 'start'
|
|
421
|
+
}, {
|
|
422
|
+
jobs: [{
|
|
423
|
+
finishedAt: '2024-04-20T08:24:58.581Z',
|
|
424
|
+
id: 6674648871,
|
|
425
|
+
name: 'test',
|
|
426
|
+
startedAt: '2024-04-20T08:24:31.697Z',
|
|
427
|
+
status: 'success',
|
|
428
|
+
url: 'https://gitlab.com/gitlab-radiator-test/ci-skip-test-project/-/jobs/6674648871'
|
|
429
|
+
}],
|
|
430
|
+
name: 'run-child:test'
|
|
431
|
+
}, {
|
|
432
|
+
jobs: [{
|
|
433
|
+
finishedAt: '2024-04-20T08:24:58.344Z',
|
|
434
|
+
id: 6674648869,
|
|
435
|
+
name: 'build',
|
|
436
|
+
startedAt: '2024-04-20T08:24:31.526Z',
|
|
437
|
+
status: 'success',
|
|
438
|
+
url: 'https://gitlab.com/gitlab-radiator-test/project-with-child-pipeline/-/jobs/6674648869'
|
|
439
|
+
}],
|
|
440
|
+
name: 'run-child:build'
|
|
441
|
+
},{
|
|
442
|
+
jobs: [{
|
|
443
|
+
finishedAt: '2024-04-20T08:25:26.496Z',
|
|
444
|
+
id: 6674648870,
|
|
445
|
+
name: 'test',
|
|
446
|
+
startedAt: '2024-04-20T08:24:58.597Z',
|
|
447
|
+
status: 'success',
|
|
448
|
+
url: 'https://gitlab.com/gitlab-radiator-test/project-with-child-pipeline/-/jobs/6674648870'
|
|
449
|
+
}],
|
|
450
|
+
name: 'run-child:test'
|
|
451
|
+
}],
|
|
452
|
+
status: 'success'
|
|
453
|
+
}]
|
|
454
|
+
)
|
|
455
|
+
})
|
|
456
|
+
|
|
457
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2024",
|
|
4
|
+
"module": "nodenext",
|
|
5
|
+
"moduleResolution": "nodenext",
|
|
6
|
+
"outDir": "build/src",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"importsNotUsedAsValues": "remove",
|
|
9
|
+
"preserveValueImports": false,
|
|
10
|
+
"rewriteRelativeImportExtensions": true,
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/**/*.ts"],
|
|
13
|
+
"exclude": ["node_modules", "src/client/**/*"]
|
|
14
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2024",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"lib": ["es2024", "dom"],
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"allowImportingTsExtensions": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"jsx": "react"
|
|
16
|
+
},
|
|
17
|
+
"include": [
|
|
18
|
+
"src/**/*",
|
|
19
|
+
"test/**/*",
|
|
20
|
+
"bin/**/*"
|
|
21
|
+
],
|
|
22
|
+
"exclude": [
|
|
23
|
+
"node_modules"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const webpack = require('webpack')
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
module: {
|
|
6
|
+
rules: [
|
|
7
|
+
{
|
|
8
|
+
test: /\.(js|jsx|ts|tsx)$/,
|
|
9
|
+
use: 'ts-loader',
|
|
10
|
+
exclude: /node_modules/,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
test: /\.(ttf|html)$/i,
|
|
14
|
+
type: 'asset/resource'
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
output: {
|
|
19
|
+
filename: 'client.js',
|
|
20
|
+
path: path.resolve(__dirname, 'build/public')
|
|
21
|
+
},
|
|
22
|
+
resolve: {
|
|
23
|
+
extensions: ['.js', '.ts', '.tsx']
|
|
24
|
+
}
|
|
25
|
+
}
|
package/webpack.dev.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const common = require('./webpack.common.cjs')
|
|
2
|
+
const {merge} = require('webpack-merge')
|
|
3
|
+
const webpack = require('webpack')
|
|
4
|
+
|
|
5
|
+
module.exports = merge(common, {
|
|
6
|
+
mode: 'development',
|
|
7
|
+
entry: [
|
|
8
|
+
'./src/client/index.tsx',
|
|
9
|
+
'webpack-hot-middleware/client'
|
|
10
|
+
],
|
|
11
|
+
plugins: [new webpack.HotModuleReplacementPlugin()],
|
|
12
|
+
devtool: 'inline-source-map'
|
|
13
|
+
})
|