Skip to content

Commit 1ee8b06

Browse files
committed
unconditionally remove needsExtends from job serialization
1 parent 84c0852 commit 1ee8b06

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.changeset/needsextends-cleanup.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"gitlab-ci-builder": patch
3+
---
4+
5+
ensure `needsExtends` is always removed from final output
6+
7+
Previously `needsExtends` (internal merge-order metadata) was only deleted in certain branches of the cleanup logic, causing it to leak into the final YAML when a job had a single remote `extends` reference. Now it's unconditionally removed from all jobs during serialization.

src/config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,15 +558,16 @@ export class Config {
558558

559559
if (filtered.length === 0) {
560560
delete job.extends
561-
delete job.needsExtends
562561
} else if (filtered.length === 1) {
563562
// Keep as string if only one extends remains (preserves original format)
564563
job.extends = filtered[0]
565564
} else {
566-
delete job.needsExtends
567565
job.extends = filtered
568566
}
569567
}
568+
569+
// Always delete needsExtends as it's internal metadata
570+
delete job.needsExtends
570571
}
571572
}
572573

0 commit comments

Comments
 (0)