Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[version-4-1] docs: add safeguard against undefined pack versions DOC-1583 (#5350) #5352

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions plugins/packs-integrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,15 @@ function getAggregatedVersions(registries, repositories, packUidMap) {
(prevVersion) => prevVersion.title === commonVersion.title
);
const previousVersionChildrenSet = new Set(previousVersiontagdata.children.map((verssion) => verssion.title));
const commonComputedChildren = commonVersion.children.filter((child) =>
// 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 @@ -214,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"
]
Loading