From de3609337d16fdb8a607f087c0258f812b46aded Mon Sep 17 00:00:00 2001 From: Georgi Yankov Date: Tue, 27 Oct 2026 16:53:19 +0200 Subject: [PATCH 1/4] Present VCFA and vROPS default tasks --- extension/src/client/constants.ts | 4 ++- .../client/provider/task/DefaultTasksJson.ts | 25 +++++++++++++++++++ .../__fixtures__/base-single-module.pom.xml | 19 ++++++++++++++ .../vrdt-common/src/__tests__/maven.spec.ts | 6 +++++ .../node/vrdt-common/src/maven/PomFile.ts | 7 ++++-- 5 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 packages/node/vrdt-common/src/__tests__/__fixtures__/base-single-module.pom.xml diff --git a/extension/src/client/constants.ts b/extension/src/client/constants.ts index 77bf7a57..263be00e 100644 --- a/extension/src/client/constants.ts +++ b/extension/src/client/constants.ts @@ -108,7 +108,9 @@ export enum ProjectArchetypes { Xml = "com.vmware.pscoe.o11n:xml-package", Vra = "com.vmware.pscoe.vra:vra-package", VraNg = "com.vmware.pscoe.vra-ng:vra-ng-package", - Polyglot = "com.vmware.pscoe.polyglot:polyglot-project" + Polyglot = "com.vmware.pscoe.polyglot:polyglot-project", + VcfaAllApps = "com.vmware.pscoe.vcf:all-apps-package", + Vrops = "com.vmware.pscoe.vrops:vrops-package" } export enum LanguageServerConfig { diff --git a/extension/src/client/provider/task/DefaultTasksJson.ts b/extension/src/client/provider/task/DefaultTasksJson.ts index afc5e18f..7c1937ba 100644 --- a/extension/src/client/provider/task/DefaultTasksJson.ts +++ b/extension/src/client/provider/task/DefaultTasksJson.ts @@ -149,5 +149,30 @@ export const TASKS_BY_TOOLCHAIN_PARENT: Record + + 4.0.0 + + com.vmware.pscoe.o11n + test-pom + 1.0.0 + pom + + + actions + + + + com.vmware.pscoe.o11n + base-package + 1.0.0 + + diff --git a/packages/node/vrdt-common/src/__tests__/maven.spec.ts b/packages/node/vrdt-common/src/__tests__/maven.spec.ts index a9d08a17..91f51462 100644 --- a/packages/node/vrdt-common/src/__tests__/maven.spec.ts +++ b/packages/node/vrdt-common/src/__tests__/maven.spec.ts @@ -13,6 +13,7 @@ describe("Maven", () => { const PARTIAL_POM_PATH = path.join(__dirname, "__fixtures__/partial.pom.xml") const UNKNOWN_POM_PATH = path.join(__dirname, "__fixtures__/unknown.pom.xml") const BASE_POM_PATH = path.join(__dirname, "__fixtures__/base.pom.xml") + const BASE_SINGLE_MODULE_POM_PATH = path.join(__dirname, "__fixtures__/base-single-module.pom.xml") const ACTIONS_POM_PATH = path.join(__dirname, "__fixtures__/actions.pom.xml") describe("PomFile", () => { @@ -54,5 +55,10 @@ describe("Maven", () => { expect(basePom.isBase).toBe(true) expect(basePom.modules).toEqual(["actions", "workflows", "vra"]) }) + + it("Can read pom.xml with a single module", () => { + const basePom = new PomFile(BASE_SINGLE_MODULE_POM_PATH) + expect(basePom.modules).toEqual(["actions"]) + }) }) }) diff --git a/packages/node/vrdt-common/src/maven/PomFile.ts b/packages/node/vrdt-common/src/maven/PomFile.ts index 6741ccfc..46276b8b 100644 --- a/packages/node/vrdt-common/src/maven/PomFile.ts +++ b/packages/node/vrdt-common/src/maven/PomFile.ts @@ -15,7 +15,9 @@ export class PomFile { "typescript-project-all": "com.vmware.pscoe.o11n", "vra-package": "com.vmware.pscoe.vra", "vra-ng-package": "com.vmware.pscoe.vra-ng", - "polyglot-project": "com.vmware.pscoe.polyglot" + "polyglot-project": "com.vmware.pscoe.polyglot", + "all-apps-package": "com.vmware.pscoe.vcf", + "vrops-package": "com.vmware.pscoe.vrops" } readonly jsonContent: any @@ -51,7 +53,8 @@ export class PomFile { return [] } - return modules.module || [] + // a single is parsed as a string rather than an array + return modules.module ? [].concat(modules.module) : [] } constructor(public readonly filePath: string) { From 732fc833c125e9524c8a259a34e5a89ec609c652 Mon Sep 17 00:00:00 2001 From: Georgi Yankov Date: Tue, 27 Oct 2026 16:54:14 +0200 Subject: [PATCH 2/4] Filter more profile types --- .../src/client/command/ChangeMavenProfile.ts | 4 +++- .../src/client/system/ConfigurationManager.ts | 16 +++++++++++++--- extension/src/client/ui/StatusBarController.ts | 18 +++++++++++++++--- .../node/vrdt-common/src/maven/MavenProfile.ts | 3 ++- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/extension/src/client/command/ChangeMavenProfile.ts b/extension/src/client/command/ChangeMavenProfile.ts index 630e329f..a94d310c 100644 --- a/extension/src/client/command/ChangeMavenProfile.ts +++ b/extension/src/client/command/ChangeMavenProfile.ts @@ -35,7 +35,9 @@ class MavenProfileItem implements vscode.QuickPickItem { } get description(): string { - return `(${this.profile["vro.host"]})` || "" + const host = ConfigurationManager.profileHostKeys.map(key => this.profile[key]).find(value => !!value) + + return host ? `(${host})` : "" } constructor(entry: [string, MavenProfile]) { diff --git a/extension/src/client/system/ConfigurationManager.ts b/extension/src/client/system/ConfigurationManager.ts index 5e06d7da..93c971d5 100644 --- a/extension/src/client/system/ConfigurationManager.ts +++ b/extension/src/client/system/ConfigurationManager.ts @@ -9,6 +9,7 @@ import { AutoWire, BaseConfiguration, Logger, + MavenProfile, MavenProfilesMap, MavenProfileWrapper, VrealizeSettings @@ -26,6 +27,15 @@ export class ConfigurationManager extends BaseConfiguration implements Registrab private homeDir = process.env[process.platform === "win32" ? "USERPROFILE" : "HOME"] ?? "~" private readonly logger = Logger.get("ConfigurationManager") + /** A Maven profile is listed when it defines at least one of these hosts */ + static readonly profileHostKeys: (keyof MavenProfile)[] = [ + "vro.host", + "vrang.host", + "vcd.host", + "vrops.host", + "vcfa.host" + ] + readonly settingsXmlPath: string = path.resolve(this.homeDir, ".m2", "settings.xml") constructor() { @@ -45,7 +55,7 @@ export class ConfigurationManager extends BaseConfiguration implements Registrab try { return super.activeProfile } catch (e) { - vscode.window.showErrorMessage(e.message) + vscode.window.showErrorMessage((e as Error).message) throw e } } @@ -118,7 +128,7 @@ export class ConfigurationManager extends BaseConfiguration implements Registrab for (const profile of allProfiles) { const propKeys = Object.keys(profile.properties || {}) - if (propKeys.some(key => key === "vro.host")) { + if (propKeys.some(key => ConfigurationManager.profileHostKeys.includes(key as keyof MavenProfile))) { vroProfiles[profile.id] = { id: profile.id, ...profile.properties @@ -126,7 +136,7 @@ export class ConfigurationManager extends BaseConfiguration implements Registrab } } - this.logger.info("Found vRO profiles: ", vroProfiles) + this.logger.info("Found profiles: ", vroProfiles) this.allProfiles = vroProfiles this._onDidChangeProfiles.fire(vroProfiles) } diff --git a/extension/src/client/ui/StatusBarController.ts b/extension/src/client/ui/StatusBarController.ts index 645ebfd6..bbd5d9e6 100644 --- a/extension/src/client/ui/StatusBarController.ts +++ b/extension/src/client/ui/StatusBarController.ts @@ -59,16 +59,23 @@ export class StatusBarController implements Registrable, vscode.Disposable { const serverConfIsValid = !!this.profileName if (serverConfIsValid) { - if (this.env.hasRelevantProject()) { + const profile = this.config.activeProfile + + // hint collection is only possible against vRO; other profiles (vROps, VCD, VCFA) have no vro.host + if (this.env.hasRelevantProject() && profile.getOptional("vro.host", "")) { this.collectionButton.show() this.collectionButton.text = "$(cloud-download)" this.collectionButton.command = Commands.TriggerServerCollection this.collectionButton.tooltip = "Trigger vRO hint collection" this.collectionButton.color = undefined + } else { + this.collectionButton.hide() } - const hostname = this.config.activeProfile.get("vro.host") + const hostname = ConfigurationManager.profileHostKeys + .map(key => profile.getOptional(key, "")) + .find(value => !!value) this.collectionStatus.text = `$(server) ${this.profileName} (${hostname})` this.collectionStatus.tooltip = "Change active profile" this.collectionStatus.command = Commands.ChangeProfile @@ -91,7 +98,12 @@ export class StatusBarController implements Registrable, vscode.Disposable { private onConfigurationOrProfilesChanged() { const currentProfileName = this.config.hasActiveProfile() ? this.config.activeProfile.get("id") : undefined - if (this.verifyConfiguration() && currentProfileName !== this.profileName && this.env.hasRelevantProject()) { + if ( + this.verifyConfiguration() && + currentProfileName !== this.profileName && + this.env.hasRelevantProject() && + this.config.activeProfile.getOptional("vro.host", "") + ) { vscode.commands.executeCommand(Commands.TriggerServerCollection) } } diff --git a/packages/node/vrdt-common/src/maven/MavenProfile.ts b/packages/node/vrdt-common/src/maven/MavenProfile.ts index 0c384542..27e37f51 100644 --- a/packages/node/vrdt-common/src/maven/MavenProfile.ts +++ b/packages/node/vrdt-common/src/maven/MavenProfile.ts @@ -11,7 +11,7 @@ export interface MavenProfile extends Partial> id: string } -type MavenProfileKeys = VroProfileKeys | VraProfileKeys +type MavenProfileKeys = VroProfileKeys | VraProfileKeys | OtherHostKeys type VroProfileKeys = | "vro.host" | "vro.port" @@ -28,3 +28,4 @@ type VraProfileKeys = | "vrang.password" | "vrang.tenant" | "vrang.refresh.token" +type OtherHostKeys = "vcd.host" | "vrops.host" | "vcfa.host" From 3ffe6c269250df4e0b20300f31bd80cbac9ec8af Mon Sep 17 00:00:00 2001 From: Georgi Yankov Date: Tue, 27 Oct 2026 16:55:28 +0200 Subject: [PATCH 3/4] Fix development process --- .vscode/tasks.json | 22 ++++++++++++---------- package.json | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 619ad129..52969896 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,15 +1,14 @@ { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format + // Tasks are shell tasks calling the local gulp, so they don't depend on VS Code's + // gulp task auto-detection (gulp.autoDetect is "off" by default). "version": "2.0.0", - "command": "gulp", - "type": "shell", - "args": ["--simple-tasks --no-color"], - "isBackground": true, "tasks": [ { - "type": "gulp", - "task": "watch", + "label": "gulp: watch", + "type": "shell", + "command": "npx gulp watch --no-color", "problemMatcher": ["$tsc-watch"], "isBackground": true, "group": { @@ -18,8 +17,9 @@ } }, { - "type": "gulp", - "task": "lint", + "label": "gulp: lint", + "type": "shell", + "command": "npx gulp lint --no-color", "presentation": { "reveal": "always", "panel": "shared" @@ -27,8 +27,10 @@ "problemMatcher": ["$eslint-stylish"] }, { - "type": "gulp", - "task": "test", + "label": "gulp: test", + "type": "shell", + "command": "npx gulp test --no-color", + "problemMatcher": [], "group": { "kind": "test", "isDefault": true diff --git a/package.json b/package.json index cbdb7398..cc0c4b88 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "onCommand:vrdev.blueprint.upload", "onCommand:vrdev.blueprint.deploy" ], - "main": "./extension/dist/extension", + "main": "./extension/out/extension", "icon": "assets/logo.png", "contributes": { "viewsContainers": { From d060d4177b60073079abd65b2e1494d127c621e7 Mon Sep 17 00:00:00 2001 From: Georgi Yankov Date: Tue, 27 Oct 2026 17:47:21 +0200 Subject: [PATCH 4/4] Fix formating --- extension/src/client/provider/task/DefaultTasksJson.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extension/src/client/provider/task/DefaultTasksJson.ts b/extension/src/client/provider/task/DefaultTasksJson.ts index 7c1937ba..1e159ca7 100644 --- a/extension/src/client/provider/task/DefaultTasksJson.ts +++ b/extension/src/client/provider/task/DefaultTasksJson.ts @@ -151,7 +151,7 @@ export const TASKS_BY_TOOLCHAIN_PARENT: Record