Skip to content

Commit 8900f86

Browse files
ykamartuskorbajan
andauthored
Moving remaining commits from 7.0.5 to master (#2665)
* System tests topology_spec, events_spec fix (#2654) * fixing imports in yamls files for component app blueprint * improve events spec * Blueprints and deployments view specs fix (#2655) * downgrade css loader (#2658) * NE-36163 Adjust deployments widget to breaking changes in manager (#2659) * Audit fix (#2663) * audit fix * increase size limit * Getting started system test fix (#2662) * loading all yaml files instead of one * increasing plugin upload service timeout as we started loading more items to the manager * providing tests improvements after changes * replacing AWS with GCP in blueprint catalog spec because one of the tests is not passing due to types issues in blueprint yaml file, GCP works correctly --------- Co-authored-by: yakub korbaczek <jakub.kuba.stepien@gmail.com>
1 parent 98861f1 commit 8900f86

20 files changed

Lines changed: 1501 additions & 1124 deletions

File tree

.size-limit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
{
99
"name": "Vendor JS bundle",
10-
"limit": "5.15 MB",
10+
"limit": "5.16 MB",
1111
"gzip": false,
1212
"path": "dist/static/js/vendor.bundle.js"
1313
},

app/components/overlays/gettingStarted/installation/process.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import log from 'loglevel';
2-
2+
import isEmpty from 'lodash/isEmpty';
33
import type { PostPluginsUploadQueryParams } from 'backend/routes/Plugins.types';
44
import StageUtils from '../../../../utils/stageUtils';
55
import type Internal from '../../../../utils/Internal';
@@ -29,14 +29,14 @@ const sleep = async (milliseconds: number) => new Promise(resolve => setTimeout(
2929

3030
// TODO(RD-1874): use common api for backend requests
3131
export const installPlugin = async (internal: Internal, plugin: PluginInstallationTask) => {
32-
if (!plugin.yamlUrl || !plugin.wagonUrl) {
32+
if (isEmpty(plugin.yamlUrls) || !plugin.wagonUrl) {
3333
return false;
3434
}
3535
const params = {
3636
visibility: 'tenant',
3737
title: plugin.title,
3838
iconUrl: plugin.icon,
39-
yamlUrl: plugin.yamlUrl,
39+
yamlUrl: plugin.yamlUrls,
4040
wagonUrl: plugin.wagonUrl
4141
};
4242
try {
@@ -167,7 +167,7 @@ export const createResourcesInstaller = (
167167

168168
const runInstallPluginStep = async (scheduledPlugin: PluginInstallationTask) => {
169169
let result = false;
170-
if (scheduledPlugin.yamlUrl && scheduledPlugin.wagonUrl) {
170+
if (!isEmpty(scheduledPlugin.yamlUrls) && scheduledPlugin.wagonUrl) {
171171
triggerProgressEvent(TaskType.Plugin, scheduledPlugin.name, TaskStatus.InstallationProgress);
172172
result = await installPlugin(internal, scheduledPlugin);
173173
if (destroyed) return;

app/components/overlays/gettingStarted/installation/tasks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { SecretsHook } from '../secrets/useFetchSecrets';
1212
import type { BlueprintsHook } from '../blueprints/useFetchBlueprints';
1313
import useFetchBlueprints from '../blueprints/useFetchBlueprints';
1414
import type { BlueprintResponse } from '../blueprints/model';
15-
import { getWagon, getYamlUrl } from '../../../../utils/shared/PluginUtils';
15+
import { getWagon, getYamlUrls } from '../../../../utils/shared/PluginUtils';
1616

1717
/**
1818
* Validates plugin version. If version pattern is not defined, any version is accepted.
@@ -89,7 +89,7 @@ const findScheduledPluginCandidate = (
8989
title: catalogPlugin.display_name ?? expectedPluginName,
9090
version: catalogPlugin.version,
9191
distribution: wagon.release,
92-
yamlUrl: getYamlUrl(catalogPlugin),
92+
yamlUrls: getYamlUrls(catalogPlugin),
9393
wagonUrl: wagon.url
9494
};
9595
};
@@ -123,7 +123,7 @@ export type PluginInstallationTask = {
123123
title: string;
124124
version: string;
125125
distribution?: string;
126-
yamlUrl?: URLString;
126+
yamlUrls?: URLString[];
127127
wagonUrl?: URLString;
128128
};
129129

app/utils/shared/PluginUtils.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import { find, last } from 'lodash';
1+
import { find } from 'lodash';
22
import type { PluginCatalogEntry } from 'backend/routes/Plugins.types';
33

4-
const latestDslVersion = 'cloudify_dsl_1_5';
5-
export function getYamlUrl(plugin: Pick<PluginCatalogEntry, 'yaml_urls'>) {
6-
const latestDslYamlUrl = find(plugin.yaml_urls, { dsl_version: latestDslVersion })?.url;
7-
const fallbackYamlUrl = last(plugin.yaml_urls)!.url;
8-
9-
return latestDslYamlUrl || fallbackYamlUrl;
4+
export function getYamlUrls(plugin: Pick<PluginCatalogEntry, 'yaml_urls'>) {
5+
return plugin.yaml_urls.map(item => item.url);
106
}
117

128
const fallbackDistributionPrefix = 'manylinux';
@@ -19,5 +15,5 @@ export function getWagon(plugin: Pick<PluginCatalogEntry, 'wagon_urls'>, current
1915

2016
export default {
2117
getWagon,
22-
getYamlUrl
18+
getYamlUrls
2319
};

0 commit comments

Comments
 (0)