Skip to content

Commit

Permalink
New CI Integration View
Browse files Browse the repository at this point in the history
Also fix displaying critical issues.
  • Loading branch information
RobiNino authored Jul 13, 2021
1 parent e9ed3f0 commit 858583d
Show file tree
Hide file tree
Showing 58 changed files with 1,916 additions and 255 deletions.
209 changes: 128 additions & 81 deletions README.md

Large diffs are not rendered by default.

86 changes: 72 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 61 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
"default": "false",
"scope": "application",
"markdownDescription": "Automatically trigger a scan upon code changes in go.sum or package-lock.json. Change will take effect after reload."
},
"jfrog.xray.ciIntegration.buildNamePattern": {
"type": "string",
"default": "",
"scope": "resource",
"markdownDescription": "A wildcards pattern, to match the name of builds published to Artifactory. Only builds which match the pattern are visible under the CI tab."
}
}
},
Expand All @@ -81,7 +87,8 @@
"icon": {
"light": "resources/light/refresh.png",
"dark": "resources/dark/refresh.png"
}
},
"enablement": "areCredentialsSet && !scanInProgress"
},
{
"command": "jfrog.xray.connect",
Expand All @@ -91,15 +98,17 @@
{
"command": "jfrog.xray.disconnect",
"title": "Disconnect",
"icon": "resources/disconnect.png"
"icon": "resources/disconnect.png",
"enablement": "!scanInProgress"
},
{
"command": "jfrog.xray.filter",
"title": "Filter",
"icon": {
"light": "resources/light/filter.png",
"dark": "resources/dark/filter.png"
}
},
"enablement": "areCredentialsSet && !scanInProgress"
},
{
"command": "jfrog.xray.showInProjectDesc",
Expand All @@ -119,29 +128,67 @@
{
"command": "jfrog.xray.copyToClipboard",
"title": "Copy"
},
{
"command": "jfrog.xray.builds",
"title": "Select build to display",
"icon": {
"light": "resources/light/build.png",
"dark": "resources/dark/build.png"
}
},
{
"command": "jfrog.xray.local",
"title": "Switch to local mode",
"icon": "$(home)",
"enablement": "!scanInProgress"
},
{
"command": "jfrog.xray.ci",
"title": "Switch to CI mode",
"icon": {
"light": "resources/light/ci.png",
"dark": "resources/dark/ci.png"
},
"enablement": "!scanInProgress"
}
],
"menus": {
"view/title": [
{
"command": "jfrog.xray.refresh",
"when": "view == jfrog.xray",
"group": "navigation"
"command": "jfrog.xray.builds",
"when": "view == jfrog.xray && isCi",
"group": "navigation@0"
},
{
"command": "jfrog.xray.local",
"when": "view == jfrog.xray && isCi",
"group": "navigation@1"
},
{
"command": "jfrog.xray.ci",
"when": "view == jfrog.xray && isLocal",
"group": "navigation@1"
},
{
"command": "jfrog.xray.connect",
"when": "view == jfrog.xray && !areCredentialsSet",
"group": "navigation"
"group": "navigation@2"
},
{
"command": "jfrog.xray.disconnect",
"when": "view == jfrog.xray && areCredentialsSet",
"group": "navigation"
"group": "navigation@2"
},
{
"command": "jfrog.xray.filter",
"when": "view == jfrog.xray",
"group": "navigation"
"group": "navigation@3"
},
{
"command": "jfrog.xray.refresh",
"when": "view == jfrog.xray",
"group": "navigation@4"
}
],
"view/item/context": [
Expand Down Expand Up @@ -187,15 +234,18 @@
"package": "vsce package"
},
"dependencies": {
"adm-zip": "^0.5.5",
"fs-extra": "~9.0.0",
"jfrog-client-js": "~2.0.2",
"keytar": "~7.3.0",
"nuget-deps-tree": "~0.2.0",
"p-queue": "^6.6.2",
"semver": "~7.3.2",
"typescript-collections": "~1.3.3",
"xmlbuilder2": "~2.1.2",
"xray-client-js": "~1.1.0"
"xmlbuilder2": "~2.1.2"
},
"devDependencies": {
"@types/adm-zip": "^0.4.34",
"@types/chai": "^4.2.14",
"@types/faker": "^4.1.11",
"@types/fs-extra": "^8.1.0",
Expand Down
Binary file added resources/dark/build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/dark/ci.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/light/build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/light/ci.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/readme/gifs/ci.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/readme/gifs/connect.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { TreesManager } from './main/treeDataProviders/treesManager';
import { WatcherManager } from './main/watchers/watcherManager';
import { LogManager } from './main/log/logManager';
import { DependencyUpdateManager } from './main/dependencyUpdate/dependencyUpdateManager';
import { BuildsManager } from './main/builds/buildsManager';

/**
* This method is called when the extension is activated.
Expand All @@ -28,12 +29,20 @@ export async function activate(context: vscode.ExtensionContext) {
let focusManager: FocusManager = new FocusManager().activate(context);
let exclusionManager: ExclusionsManager = new ExclusionsManager(treesManager).activate(context);
let dependencyUpdateManager: DependencyUpdateManager = new DependencyUpdateManager().activate(context);
let buildsManager: BuildsManager = new BuildsManager(treesManager).activate(context);

new DiagnosticsManager(treesManager).activate(context);
new WatcherManager(treesManager).activate(context);
new HoverManager(treesManager).activate(context);
new CodeLensManager().activate(context);
new CommandManager(logManager, connectionManager, treesManager, filterManager, focusManager, exclusionManager, dependencyUpdateManager).activate(
context
);
new CommandManager(
logManager,
connectionManager,
treesManager,
filterManager,
focusManager,
exclusionManager,
dependencyUpdateManager,
buildsManager
).activate(context);
}
47 changes: 47 additions & 0 deletions src/main/builds/buildsManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import * as vscode from 'vscode';
import { ExtensionComponent } from '../extensionComponent';
import { TreesManager } from '../treeDataProviders/treesManager';
import { BuildGeneralInfo } from '../types/buildGeneralinfo';
import { DependenciesTreeNode } from '../treeDataProviders/dependenciesTree/dependenciesTreeNode';
import { GeneralInfo } from '../types/generalInfo';

/**
* Manage the filters of the components tree.
*/
export class BuildsManager implements ExtensionComponent {
constructor(private _treesManager: TreesManager) {}

public activate(context: vscode.ExtensionContext) {
return this;
}

public async showBuildsMenu() {
let buildsMap: Map<string, GeneralInfo> = this.getBuilds();
let choice: string | undefined = await vscode.window.showQuickPick(Array.from(buildsMap.keys()), <vscode.QuickPickOptions>{
placeHolder: 'Build Name',
canPickMany: false
});
if (!!choice) {
const chosenBuild: BuildGeneralInfo | undefined = <BuildGeneralInfo>buildsMap.get(choice);
if (!chosenBuild) {
this._treesManager.logManager.logError(new Error('Failed choosing build'), false);
return;
}
this._treesManager.buildsTreesProvider.loadBuild(chosenBuild, () => {
this._treesManager.treeDataProviderManager.onChangeFire();
});
}
}

public getBuilds(): Map<string, GeneralInfo> {
let buildsMap: Map<string, GeneralInfo> = new Map<string, BuildGeneralInfo>();
const buildsTree: DependenciesTreeNode = this._treesManager.buildsTreesProvider.allBuildsTree;
if (!!buildsTree && !!buildsTree.children) {
for (const build of buildsTree.children) {
const gi: GeneralInfo = build.generalInfo;
buildsMap.set(gi.artifactId + ':' + gi.version, gi);
}
}
return buildsMap;
}
}
Loading

0 comments on commit 858583d

Please sign in to comment.