vmware / vmware/vrealize-developer-tools

Add new setting vrdev.buildTools.extraVroGroups

Open
#164 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature-request
Dominant language
TypeScript
Stars
75
Forks
22
Avg merge
6h 16m
Merged PRs (30d)
2

Description

Description

We enjoy the usage of the lint rule ToolchainVersionRule in our monorepo, as it also informs colleagues on the team what the recommended BTVA version is for a package.

But for some projects in our monorepo we have a custom pom (which has the actual vmware.pscoe pom as parent) to override some behavior to fit our workflow.
When doing this, we lose the lint rules as they are mapped to specific parent artifactId:groupIds https://github.com/vmware/vrealize-developer-tools/blob/1cc7b69475bdb2966f780ef7a0b79b26614fdd9c/packages/node/vrdt-common/src/maven/PomFile.ts#L10-L19

Would it be possible to add a new extension setting, e.g. vrdev.buildTools.extraVroGroups? Here we could provide an object of key/values, similar to the already existing PomFile.ParentGroupByArtifact.

// package.json
{
  "contributes": {
    // ....
    "configuration": {
      // ....
      "vrdev.buildTools.extraVroGroups": {
        "type": "object",
        "required": false,
        "default": {},
        "description": "Extra Parent groups to consider as valid vRO Projects.",
        "scope": "resource"
      }
    }
  }
}

And then add something like:

    static readonly ParentGroupByArtifact = {
        "base-package": "com.vmware.pscoe.o11n",
        "actions-package": "com.vmware.pscoe.o11n",
        "xml-package": "com.vmware.pscoe.o11n",
        "typescript-project": "com.vmware.pscoe.o11n",
        "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",
+       ...vscode.workspace.getConfiguration().get<VrealizeSettings>("vrdev").buildTools.extraVroGroups || {}
    }

So the usage would be:

// .vscode/settings.json
{
    "vrdev.buildTools.defaultVersion": "4.6.0",
    "vrdev.buildTools.extraVroGroups": {
        "custom-package": "com.example.custom-vro"
    }
}
Alternatives

Creating custom lint rules for the XML files. But we'd like to keep it to this extension and ESLint.

Additional Context

I am willing to make a PR for this, but would like the input of the maintainers before starting.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/node/vrdt-common/src/maven/PomFile.ts and the ToolchainVersionRule reference, then inspect the extension configuration in package.json. Add the vrdev.buildTools.extraVroGroups setting and make configured parent groups participate in the existing validation; the example in .vscode/settings.json should be recognized for custom-package.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.