fix(workflows): retain container presence in export shape comparisons (#523)

Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
Rudy Mizrahi Celekli authored and GitHub committed 2026-10-05 14:59:35 +08:00
1 parent bcfb4072f2
commit 385445804a
2 files changed
+101 -2

No files matched your search

+20 -2
View File
@@ -251,8 +251,8 @@ const diffPair = (
const rightFields = new Map(right.fields.map((field) => [field.path, field]));
const paths = uniqueSorted([...leftFields.keys(), ...rightFields.keys()]);
return paths.flatMap((path) => {
const leftField = leftFields.get(path);
const rightField = rightFields.get(path);
const leftField = fieldAtPath(left, leftFields, path);
const rightField = fieldAtPath(right, rightFields, path);
const status = fieldChangeStatus({
leftShape: left,
rightShape: right,
@@ -282,6 +282,24 @@ const diffPair = (
});
};
const fieldAtPath = (
shape: Shape,
fields: ReadonlyMap<string, Field>,
path: string,
): Field | undefined => {
const field = fields.get(path);
if (field !== undefined) return field;
if (!shape.property_coverage.some((coverage) => coverage.path === path))
return undefined;
return {
path,
state: "unknown",
value: null,
reason:
"A static container is retained at this path, but no primitive field value is projected.",
};
};
interface FieldChangeInput {
readonly leftShape: Shape;
readonly rightShape: Shape;