Skip to content

Commit 35ddb73

Browse files
committed
Fixed bug, where jobs started by needs satisfaction and had when:never, were actually started
Print when:never's and when:manual's as early as possible.
1 parent ed04674 commit 35ddb73

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/commander.ts

+24-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,29 @@ export class Commander {
1010
const stages = parser.getStages().concat();
1111
const stageNames = parser.getStageNames();
1212

13+
const skippingNever = [];
14+
const skippingManual = [];
15+
for (const st of stages) {
16+
const jobsInStage = st.getJobs();
17+
for (const job of jobsInStage) {
18+
if (job.isManual() && !manualArgs.includes(job.name) && !job.isFinished()) {
19+
skippingManual.push(job);
20+
continue;
21+
}
22+
23+
if (job.isNever() && !job.isFinished()) {
24+
skippingNever.push(job);
25+
}
26+
}
27+
}
28+
29+
if (skippingNever.length > 0) {
30+
process.stdout.write(`${skippingNever.map((j) => j.name).join(', ')} ${c.magentaBright("skipped")} when:never\n`);
31+
}
32+
if (skippingManual.length > 0) {
33+
process.stdout.write(`${skippingManual.map((j) => j.name).join(', ')} ${c.magentaBright("skipped")} when:manual\n`);
34+
}
35+
1336
let stage = stages.shift();
1437
while (stage !== undefined) {
1538
const jobsInStage = stage.getJobs();
@@ -26,13 +49,11 @@ export class Commander {
2649
for (const job of jobsInStage) {
2750

2851
if (job.isManual() && !manualArgs.includes(job.name) && !job.isFinished()) {
29-
process.stdout.write(`${job.getJobNameString()} ${c.magentaBright("skipped")} when:manual\n`);
3052
job.setFinished(true);
3153
continue;
3254
}
3355

3456
if (job.isNever() && !job.isFinished()) {
35-
process.stdout.write(`${job.getJobNameString()} ${c.magentaBright("skipped")} when:never\n`);
3657
job.setFinished(true);
3758
continue;
3859
}
@@ -47,7 +68,7 @@ export class Commander {
4768

4869
// Find jobs that can be started, because their needed jobs have finished
4970
for (const job of jobs) {
50-
if ((job.isManual() && !manualArgs.includes(job.name)) || job.isRunning() || job.isFinished() || job.needs === null) {
71+
if ((job.isManual() && !manualArgs.includes(job.name)) || job.isRunning() || job.isFinished() || job.needs === null || job.isNever()) {
5172
continue;
5273
}
5374

0 commit comments

Comments
 (0)