@node-core/utils 7.3.0 → 7.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.
- package/lib/ci/resume_ci.js +4 -8
- package/package.json +1 -1
package/lib/ci/resume_ci.js
CHANGED
|
@@ -88,19 +88,13 @@ export class ResumePRJob {
|
|
|
88
88
|
cli.stopSpinner(`Found PR CI job ${job.jobid}`);
|
|
89
89
|
|
|
90
90
|
const build = new PRBuild(cli, request, job.jobid, undefined,
|
|
91
|
-
'result,building,actions[
|
|
91
|
+
'result,building,actions[parameters[name,value]]');
|
|
92
92
|
const { result, building, actions = [] } = await build.getBuildData();
|
|
93
93
|
if (building || (result !== 'FAILURE' && result !== 'ABORTED')) {
|
|
94
94
|
const status = building ? 'RUNNING' : result ?? 'RUNNING';
|
|
95
95
|
cli.error(`CI job ${job.jobid} is in status ${status}, skipping resume`);
|
|
96
96
|
return false;
|
|
97
97
|
}
|
|
98
|
-
if (!actions.some(action =>
|
|
99
|
-
action._class === 'com.tikal.jenkins.plugins.multijob.MultiJobResumeBuild')) {
|
|
100
|
-
cli.error(`CI job ${job.jobid} is not resumable`);
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
98
|
const approvedSHAs = new Set(actions.flatMap(action => action.parameters ?? [])
|
|
105
99
|
.filter(parameter => parameter.name === 'COMMIT_SHA_CHECK')
|
|
106
100
|
.map(parameter => parameter.value));
|
|
@@ -127,7 +121,9 @@ export class ResumePRJob {
|
|
|
127
121
|
}
|
|
128
122
|
|
|
129
123
|
cli.startSpinner(`Resuming PR CI job ${job.jobid}`);
|
|
130
|
-
|
|
124
|
+
// Jenkins does not export its resume action in the build API. Let the
|
|
125
|
+
// resume endpoint determine whether the action is available.
|
|
126
|
+
const response = await request.fetch(`${build.jobUrl}resume/`, {
|
|
131
127
|
method: 'POST',
|
|
132
128
|
headers: {
|
|
133
129
|
'Jenkins-Crumb': crumb
|