@ckeditor/ckeditor5-dev-ci 47.1.1 → 48.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.
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { execSync } from 'child_process';
|
|
11
11
|
import minimist from 'minimist';
|
|
12
12
|
import processJobStatuses from '../lib/process-job-statuses.js';
|
|
13
|
+
import isWorkflowFinished from '../lib/utils/is-workflow-finished.js';
|
|
13
14
|
|
|
14
15
|
// This script allows the creation of a new job within a workflow that will be executed
|
|
15
16
|
// in the end, when all other jobs will be finished or errored.
|
|
@@ -81,17 +82,15 @@ async function waitForOtherJobsAndSendNotification() {
|
|
|
81
82
|
const jobs = processJobStatuses( await getOtherJobsData() )
|
|
82
83
|
.filter( job => !ignore.includes( job.name ) );
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// If any ignored job failed, all of its children will be marked as 'failed_parent', and thus will not trigger this check.
|
|
87
|
-
const anyJobsFailed = jobs.some( job => job.status === 'failed' );
|
|
88
|
-
|
|
89
|
-
if ( !workflowFinished ) {
|
|
85
|
+
if ( !isWorkflowFinished( jobs ) ) {
|
|
90
86
|
await new Promise( r => setTimeout( r, 30 * 1000 ) );
|
|
91
87
|
|
|
92
88
|
return waitForOtherJobsAndSendNotification();
|
|
93
89
|
}
|
|
94
90
|
|
|
91
|
+
// If any ignored job failed, all of its children will be marked as 'failed_parent', and thus will not trigger this check.
|
|
92
|
+
const anyJobsFailed = jobs.some( job => job.status === 'failed' );
|
|
93
|
+
|
|
95
94
|
if ( anyJobsFailed ) {
|
|
96
95
|
return execSync( task, { stdio: 'inherit' } );
|
|
97
96
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* eslint-env node */
|
|
7
|
+
|
|
8
|
+
const FINISHED_STATUSES = [
|
|
9
|
+
'success',
|
|
10
|
+
'failed',
|
|
11
|
+
'failed_parent',
|
|
12
|
+
// See: https://github.com/ckeditor/ckeditor5/issues/18359.
|
|
13
|
+
'skipped'
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Checks if a workflow could be considered as finished based on its jobs.
|
|
18
|
+
*
|
|
19
|
+
* @param {Array.<object>} jobs
|
|
20
|
+
* @returns {boolean}
|
|
21
|
+
*/
|
|
22
|
+
export default function isWorkflowFinished( jobs ) {
|
|
23
|
+
return jobs.every( job => FINISHED_STATUSES.includes( job.status ) );
|
|
24
|
+
}
|