Skip to content

Commit

Permalink
fix: support for workspaces with directory(s) that do not contain kno…
Browse files Browse the repository at this point in the history
…wn manifests #244 (#245)

* fix: support for workspaces with directory(s) that do not contain known manifests #244

Signed-off-by: Paul Horton <[email protected]>

* fix: support for workspaces with directory(s) that do not contain known manifests #244

Signed-off-by: Paul Horton <[email protected]>

---------

Signed-off-by: Paul Horton <[email protected]>
  • Loading branch information
madpah authored Feb 24, 2023
1 parent 31227cd commit 315b08b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ext-src/models/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class Application implements TreeableModel {
string,
ComponentEntry
>();
public scannable: boolean = true;

constructor(readonly name: string, readonly workspaceFolder: string, readonly options: ComponentModelOptions) {
this.reloadConfig();
Expand Down Expand Up @@ -66,10 +67,16 @@ export class Application implements TreeableModel {
}

public getTooltip(): string {
if (!this.scannable) {
return `${this.name} is not scannable - no recognised manifest files found!`
}
return `Application: ${this.name}\nNexus IQ ID: ${this.nexusIqApplicationId}\nLocation: ${this.workspaceFolder}`;
}

public iconName(): string {
if (!this.scannable) {
return 'pink-icon-fix-issues.png'
}
return `policy_badge.png`;
}

Expand Down
5 changes: 4 additions & 1 deletion ext-src/models/IqMultiProjectComponentModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,14 @@ export class IqMultiProjectComponentModel implements ComponentModel {
} catch (ex) {
this.logger.log(LogLevel.ERROR, `Nexus IQ Extension Failure moving forward`, ex);
window.showErrorMessage(`Nexus IQ extension failure, moving forward, exception: ${ex}`);
return
}
}
progress.report({ message: "Packaging ready", increment: 35 });
} else {
throw new TypeError("No valid formats available to scan for this project.");
this.logger.log(LogLevel.WARN, `No known manifests found for application ${application.name} - skipping`)
application.scannable = false
throw new Error(`Unable to scan "${application.name}" - no known manifests found!`);
}

this.logger.log(LogLevel.DEBUG, `Getting Internal ID from Public ID: ${application.nexusIqApplicationId}`);
Expand Down
1 change: 0 additions & 1 deletion ext-src/packages/ComponentContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export class ComponentContainer {
logger.log(LogLevel.DEBUG, `${this.Valid.length} package muncher(s) set`);
} else {
logger.log(LogLevel.WARN, `No package munchers appear valid`);
throw new Error("No supported scan type exists for the open workspace");
}
}
}
Binary file added resources/pink-icon-fix-issues.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 315b08b

Please sign in to comment.