Skip to content

Commit

Permalink
docs: add safeguard against undefined pack versions DOC-1583 (#5350) (#…
Browse files Browse the repository at this point in the history
…5357)

* docs: add safeguard against undefined pack versions DOC-1583

* ci: auto-formatting prettier issues

* docs: exclude VMO from packs

* ci: auto-formatting prettier issues

---------

Co-authored-by: addetz <[email protected]>
  • Loading branch information
addetz and addetz authored Jan 10, 2025
1 parent f8f0a98 commit 6cd16c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions plugins/packs-integrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ function getAggregatedVersions(registries, repositories, packUidMap) {
const previousVersiontagdata = previousVersions.find(
(prevVersion) => prevVersion.title === commonVersion.title
);
const previousVersionChildrenSet = new Set(
(previousVersiontagdata.children || []).map((verssion) => verssion.title)
);
const commonComputedChildren = commonVersion.children.filter((child) =>
const previousVersionChildrenSet = new Set(previousVersiontagdata.children.map((verssion) => verssion.title));
// Ensure that children are never undefined.
const commonVersionChildren = commonVersion.children || [];
const commonComputedChildren = commonVersionChildren.filter((child) =>
previousVersionChildrenSet.has(child.title)
);
if (commonComputedChildren.length) {
//merge non overlapping children in each parent version
const mergedNonOverlappingChildren = [
...commonVersion.children.filter((child) => !previousVersionChildrenSet.has(child.title)),
...commonVersionChildren.filter((child) => !previousVersionChildrenSet.has(child.title)),
...previousVersiontagdata.children.filter((child) => !previousVersionChildrenSet.has(child.title)),
];
commonComputedChildren.forEach((childComputedVersion) => {
Expand All @@ -216,7 +216,7 @@ function getAggregatedVersions(registries, repositories, packUidMap) {
//merging non-overlapping children with the previous version children
previousVersiontagdata.children = [...previousVersiontagdata.children, ...mergedNonOverlappingChildren];
} else {
previousVersiontagdata.children = [...previousVersiontagdata.children, ...commonVersion.children];
previousVersiontagdata.children = [...previousVersiontagdata.children, ...commonVersionChildren];
}
});
//merging the non-overlapping tags with the previous Versions
Expand Down
3 changes: 2 additions & 1 deletion static/packs-data/exclude_packs.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"ubuntu-coxedge",
"edge-os",
"spectro-zen-of-k8s",
"spectro-mgmt"
"spectro-mgmt",
"virtual-machine-orchestrator"
]

0 comments on commit 6cd16c3

Please sign in to comment.