Skip to content

Add new setting vrdev.buildTools.extraVroGroups #164

Description

@Indy-rbo

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

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"
}

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions