Skip to content

enhance-micro-app-debugging #4596

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

Merged
merged 2 commits into from
May 21, 2025
Merged
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
25 changes: 23 additions & 2 deletions shell-ui/src/initFederation/ConfigurationProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function useConfigRetriever(): {
retrieveConfiguration: ({ configType, name }) => {
if (configType !== 'build' && configType !== 'run') {
throw new Error(
`Invalid configType : it should be build or run but recieved ${configType}`,
`Invalid configType : it should be build or run but received ${configType}`,
);
}

Expand All @@ -108,13 +108,34 @@ export function useConfigRetriever(): {
})
.map((webFinger) => webFinger.data);
///TODO validate web fingers against JsonSchemas
return configs.find(
const config = configs.find(
(webFinger) =>
(webFinger.kind === 'MicroAppRuntimeConfiguration' &&
webFinger.metadata.name === name) ||
(webFinger.kind === 'MicroAppConfiguration' &&
webFinger.metadata.kind === apps[0].kind),
);

if (!config) {
const listOfKnownConfigurations = JSON.stringify(configs, null, 2);
if (configType === 'build') {
throw new Error(
`MicroApp's MicroAppConfiguration not found for app with kind ${apps[0].kind}.
This error usually happens when your app's "kind" in deployed-ui-apps does not match the MicroAppConfiguration.
Please check your MicroAppConfiguration. Here is a list of known configurations:
${listOfKnownConfigurations}`,
);
}
if (configType === 'run') {
throw new Error(
`MicroApp's RuntimeAppConfiguration not found for app with name ${name} and kind ${apps[0].kind}.
This error usually happens when your app's "name" and "kind" in deployed-ui-apps does not match the RuntimeAppConfiguration.
Please check your RuntimeAppConfiguration. Here is a list of known configurations:
${listOfKnownConfigurations}`,
);
}
}
return config;
},
};
}
Expand Down
Loading