microsoft/azure-pipelines-vscode

Support validation of fully qualified task names (Especially for tasks installed as extensions).

Clockwork-Muse opened this issue · 2 comments

To allow for better discrimination of the source of tasks, it can be handy to include the fully qualified list of task names, eg:

- task: qetza.replacetokens.replacetokens-task.replacetokens@3
  displayName: Replace Tokens
  inputs:
    rootDirectory: $(TerraformDirectory)
    targetFiles: |
      variables.tf
    tokenPrefix: "#{"
    tokenSuffix: "}"
    actionOnMissing: fail
    escapeType: json
    enableTransforms: true

Unfortunately this currently fails to validate:
Fully qualified name fails to validate

Part of this is probably potentially due to the autogenerated (assumedly - I don't control it for my org) yaml schema, which looks like this:

// most properties elided
{
// ...
                        {
                            "description": "Replace tokens in files",
                            "doNotSuggest": false,
                            "ignoreCase": "value",
                            "enum": [
                                "replacetokens@3"
                            ]
                        },
// .....
                    "properties": {
                        "task": {
                            "description": "Replace Tokens\n\nReplace tokens in files",
                            "ignoreCase": "value",
                            "pattern": "^replacetokens@5$"
                        },
                        // ......
                    },
// .....

So it has no concept that there could be a fully qualified name....

50Wliu commented

Yes, I agree this is much needed :). Unfortunately not something this extension can handle - that knowledge comes from ADO itself, and you're correct in assuming that it does all the work necessary to generate that schema file.