Skip to content
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
5 changes: 5 additions & 0 deletions workspaces/marketplace/.changeset/friendly-pugs-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@red-hat-developer-hub/backstage-plugin-catalog-backend-module-marketplace': patch
---

Clear processors log messages
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ describe('DynamicPackageInstallStatusProcessor', () => {
);

expect(entity.spec?.installStatus).toBe(undefined);
expect(logger.warn).toHaveBeenCalledWith(
"Entity package:default/testpackage is missing spec.packageName, unable to determine 'spec.installStatus'",
expect(logger.debug).toHaveBeenCalledWith(
"Entity package:default/testpackage is missing 'spec.packageName', unable to determine 'spec.installStatus'",
);
});

Expand Down Expand Up @@ -199,8 +199,8 @@ describe('DynamicPackageInstallStatusProcessor', () => {
cache,
);
expect(result.spec?.installStatus).toBe(undefined);
expect(logger.warn).toHaveBeenCalledWith(
"Missing 'entity.spec.dynamicArtifact', unable to determine 'spec.installStatus'",
expect(logger.debug).toHaveBeenCalledWith(
"Entity package:default/testpackage is missing 'spec.dynamicArtifact', unable to determine 'spec.installStatus'",
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export class DynamicPackageInstallStatusProcessor implements CatalogProcessor {
installedPackages: Plugins,
): MarketplacePackageInstallStatus | undefined {
if (!marketplacePackage.spec?.packageName) {
this.logger.warn(
"Missing 'entity.spec.packageName', unable to determine 'spec.installStatus'",
this.logger.debug(
`Entity ${stringifyEntityRef(marketplacePackage)} is missing 'spec.packageName', unable to determine 'spec.installStatus'`,
);
return undefined;
}
Expand Down Expand Up @@ -133,8 +133,8 @@ export class DynamicPackageInstallStatusProcessor implements CatalogProcessor {
}

if (!marketplacePackage.spec?.dynamicArtifact) {
this.logger.warn(
"Missing 'entity.spec.dynamicArtifact', unable to determine 'spec.installStatus'",
this.logger.debug(
`Entity ${stringifyEntityRef(marketplacePackage)} is missing 'spec.dynamicArtifact', unable to determine 'spec.installStatus'`,
);
return undefined;
}
Expand All @@ -155,8 +155,8 @@ export class DynamicPackageInstallStatusProcessor implements CatalogProcessor {
): Promise<Entity> {
if (isMarketplacePackage(entity)) {
if (!entity.spec?.packageName) {
this.logger.warn(
`Entity ${stringifyEntityRef(entity)} is missing spec.packageName, unable to determine 'spec.installStatus'`,
this.logger.debug(
`Entity ${stringifyEntityRef(entity)} is missing 'spec.packageName', unable to determine 'spec.installStatus'`,
);
return entity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ export class LocalPackageInstallStatusProcessor implements CatalogProcessor {

return null;
} catch (error) {
console.warn('xxx', error);
console.warn(
`Error occurred while processing local install status of ${packageName}`,
error,
);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('PluginInstallStatusProcessor', () => {
);

expect(entity.spec?.installStatus).toBe(undefined);
expect(logger.warn).toHaveBeenCalledWith(
expect(logger.debug).toHaveBeenCalledWith(
"Entity plugin:default/plugin1 is missing packages, unable to determine 'spec.installStatus'",
);
});
Expand Down Expand Up @@ -290,8 +290,8 @@ describe('PluginInstallStatusProcessor', () => {
);

expect(entity.spec?.installStatus).toBe(undefined);
expect(logger.warn).toHaveBeenCalledWith(
"Missing all definitions for plugin:marketplace-plugin-demo/marketplace packages installStatus, unable to determine 'spec.installStatus'",
expect(logger.debug).toHaveBeenCalledWith(
"Entity plugin:marketplace-plugin-demo/marketplace is missing all definitions of 'spec.installStatus' in its packages, unable to determine 'spec.installStatus'",
);
});

Expand All @@ -314,8 +314,8 @@ describe('PluginInstallStatusProcessor', () => {
);

expect(entity.spec?.installStatus).toBe(undefined);
expect(logger.warn).toHaveBeenCalledWith(
"Missing all definitions for plugin:marketplace-plugin-demo/marketplace packages installStatus, unable to determine 'spec.installStatus'",
expect(logger.debug).toHaveBeenCalledWith(
"Entity plugin:marketplace-plugin-demo/marketplace is missing all definitions of 'spec.installStatus' in its packages, unable to determine 'spec.installStatus'",
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export class PluginInstallStatusProcessor implements CatalogProcessor {
);

if (!pluginPackageRefs || pluginPackageRefs.length === 0) {
this.logger.warn(
this.logger.debug(
`Entity ${stringifyEntityRef(marketplacePlugin)} is missing 'spec.packages', unable to determine 'spec.installStatus'`,
);
return undefined;
Expand All @@ -205,8 +205,8 @@ export class PluginInstallStatusProcessor implements CatalogProcessor {
const pluginPackageStatuses =
await this.getPluginPackageInstallStatuses(pluginPackageRefs);
if (pluginPackageRefs.length !== pluginPackageStatuses.length) {
this.logger.warn(
`Missing all definitions for ${stringifyEntityRef(marketplacePlugin)} packages installStatus, unable to determine 'spec.installStatus'`,
this.logger.debug(
`Entity ${stringifyEntityRef(marketplacePlugin)} is missing all definitions of 'spec.installStatus' in its packages, unable to determine 'spec.installStatus'`,
);
return undefined;
}
Expand Down Expand Up @@ -261,7 +261,7 @@ export class PluginInstallStatusProcessor implements CatalogProcessor {
): Promise<Entity> {
if (isMarketplacePlugin(entity)) {
if (!entity.spec?.packages || entity.spec.packages.length === 0) {
this.logger.warn(
this.logger.debug(
`Entity ${stringifyEntityRef(entity)} is missing packages, unable to determine 'spec.installStatus'`,
);
return entity;
Expand Down