azure-devops-extension-tasks icon indicating copy to clipboard operation
azure-devops-extension-tasks copied to clipboard

updateTasksId does not resolve task manifest path

Open charleszipp opened this issue 4 years ago • 6 comments

Hi there, I am trying to update my terraform task extension to use this for publishing/packaging.

I am unable to get the updateTasksId feature to update the task id's of the tasks in my extension. The tasks are compiled to a .dist directory before being packaged. For this to work, the vss-extension manifest has a files array that maps the path of the task files to the task name (see example below). It appears that the updateTasksId expects the task manifest to live in a directory with the same name as the extension and does not utilize the files array in the manifest to resolve the location.

The extension task publishes my extension without errors but, the task id is still the same as what I have defined in my manifest.

"files": [
        { "path": "tasks/terraform-cli/.dist", "packagePath": "TerraformCLI" },
        { "path": "tasks/terraform-installer/.dist", "packagePath": "TerraformInstaller" }
    ],
    "contributions": [
        {
            "id": "azure-pipelines-tasks-terraform-cli",
            "type": "ms.vss-distributed-task.task",
            "targets": [
                "ms.vss-distributed-task.tasks"
            ],
            "properties": {
                "name": "TerraformCLI",
                "supportsTasks": [
                    "721c3f90-d938-11e8-9d92-09d7594721b5"
                ]
            }
        },
        {
            "id": "azure-pipelines-tasks-terraform-installer",
            "type": "ms.vss-distributed-task.task",
            "targets": [
                "ms.vss-distributed-task.tasks"
            ],
            "properties": {
                "name": "TerraformInstaller",
                "supportsTasks": [
                    "11645770-d18e-11e8-8f5b-1b8b62612b3b"
                ]
            }
        }
    ]

charleszipp avatar Mar 01 '21 18:03 charleszipp

I was checking here and expecting some evaluation of the files property in the root manifest to locate the task root directory.

charleszipp avatar Mar 01 '21 18:03 charleszipp

Path redirection in the manifest is something we don't support yet.

The code assumes the tasks live in a folder that is bated on their contribution name.

You're the first to use this as far as I can tell.

jessehouwing avatar Mar 02 '21 06:03 jessehouwing

I'm open to a PR on this one.

jessehouwing avatar Mar 03 '21 16:03 jessehouwing

If I get some availability I would be open to tackling this. I will come back and assign myself if that happens.

@jessehouwing do you believe based on your experience, if the task id's are modified, could i support multiple tagged versions of the extension in a single org? For example if I have alpha, beta, rc, and ga (where ga is the only public version) that I could install all those and use them within a single org? If so that, would help dramatically reduce the overhead and complexity of my extensions' ci/cd pipeline

charleszipp avatar Mar 03 '21 16:03 charleszipp

For build tasks, yes you can have as many tasks deployed side by side as long as the have a unique taskid and a unique extensionid.

That is the purpose.

The alternative is to have separate organisations for each promotion level.

See also:

  • https://stackoverflow.com/a/56029399/736079

jessehouwing avatar Mar 03 '21 16:03 jessehouwing

Thanks @jessehouwing

charleszipp avatar Mar 03 '21 16:03 charleszipp