skip to Main Content

Currently, I am implementing an extension for Azure DevOps cloud & Server.
This extension is something that will add a pipeline task.
When I was testing this extension I encountered an issue. After that, I fixed the problem and reinstalled the extension with a newer version.

Then I found out that newly added files are not reflected.
Can anyone assist with this?

I tried compiling the Tasks and re install with the newer version.

Extension structure

{
    "manifestVersion": 1,
    "id": "dev",
    "name": "test",
    "version": "8.0",
    "publisher": "coder",
    "targets": [
        {
            "id": "Microsoft.VisualStudio.Services"
        }
    ],
    "description": "Manage your day-to-day work items, sprints, and releases in test",
    "categories": [
        "Azure Pipelines"
    ],

    "icons": {
        "default": "static/icon.png"
    },
    "content": {
        "details": {
            "path": "overview.md"
        }
    },

    "files": [
        {
            "path": "Tasks/AddFeedStatusV1"
        },
        {
            "path": "static",
            "addressable": true
        }
    ],
    "contributions": [
        {
            "id": "service-endpoint",
            "description": "Service endpoint type for devuser connections",
            "type": "ms.vss-endpoint.service-endpoint-type",
            "targets": [
                "ms.vss-endpoint.endpoint-types"
            ],
            "properties": {
                "name": "devuser",
                "displayName": "devuser server connection",
                "url": {
                    "displayName": "Server Url",
                    "helpText": "Url for the devuser server to connect to."
                },
                "inputDescriptors": [
                    {
                        "id": "integ_scope_id",
                        "name": "integ_scope_id",
                        "description": "",
                        "inputMode": "textbox",
                        "isConfidential": false,
                        "validation": {
                            "isRequired": true,
                            "dataType": "string",
                            "maxLength": 300
                        }
                    },
                    {
                        "id": "conenction_function_uuid",
                        "name": "conenction_function_uuid",
                        "description": "",
                        "inputMode": "textbox",
                        "isConfidential": false,
                        "validation": {
                            "isRequired": true,
                            "dataType": "string",
                            "maxLength": 300
                        }
                    },
                    {
                        "id": "conenction_function_version",
                        "name": "conenction_function_version",
                        "description": "",
                        "inputMode": "textbox",
                        "isConfidential": false,
                        "validation": {
                            "isRequired": true,
                            "dataType": "string",
                            "maxLength": 300
                        }
                    },
                    {
                        "id": "app_install_id",
                        "name": "app_install_id",
                        "description": "",
                        "inputMode": "textbox",
                        "isConfidential": false,
                        "validation": {
                            "isRequired": true,
                            "dataType": "string",
                            "maxLength": 300
                        }
                    },
                    {
                        "id": "extension_id",
                        "name": "extension_id",
                        "description": "",
                        "inputMode": "textbox",
                        "isConfidential": false,
                        "validation": {
                            "isRequired": true,
                            "dataType": "string",
                            "maxLength": 300
                        }
                    }
                ],
                "authenticationSchemes": [
                    {
                        "type": "ms.vss-endpoint.endpoint-auth-scheme-token"
                    }
                ],
                "dataSources": [],
                "helpMarkDown": "<a href="url-to-documentation" target="_blank"><b>Learn More</b></a>"
            }
        },
        {
            "id": "zs-addfeedstatus-task",
            "type": "ms.vss-distributed-task.task",
            "targets": [
                "ms.vss-distributed-task.tasks"
            ],
            "properties": {
                "name": "Tasks/AddFeedStatusV1"
            }
        }
    ]
}

2

Answers


  1. Based on your description, the *.js and *.js.map files are in the AddFeedStatusV1 folder and the folder has been included in the vss-extension.json.

    "files": [
        {
            "path": "Tasks/AddFeedStatusV1"
        },
        {
            "path": "static",
            "addressable": true
        }
    ],
    

    When you package the extension, the updated files should be included in the extension.

    The cause of the issue could be that the task version is not update, Azure DevOps will not update the task configuration file. Updating the extension’s version (in the manifest file) is not enough.

    You can try to update the task version in the task.json file.

    For example:

    task.json

    {
     "$schema": "https://raw.githubusercontent.com/Microsoft/azure-pipelines-task-lib/master/tasks.schema.json",
     "id": "a4234567-b49c-22d3-f456-526614176030",
     "name": "xx",
     "friendlyName": "xx",
     "description": "xx",
     "helpMarkDown": "",
     "category": "Utility",
     "author": "A",
     "version": {
         "Major": 0,
         "Minor": 4,
         "Patch": 0
     },
    .....
    

    Then you can package the extension again and install the new extension.

    In this case, you can check if the updated files will be reflected.

    Login or Signup to reply.
  2. There are a few things you should know:

    • An extension must always ship with a new (higher) version number.
    • An extension doesn’t have to increase the individual task’s version numbers included in the extension.
    • If the task doesn’t have a new version number, the server/agent will assume it’s unchanged.

    So. When you’re making changes to the task you must always do the following:

    • Increase the version number of the extension
    • Increase the version number of the task (patch will do).

    Then republish the extension and wait for the updated extension to be installed into your Azure DevOps Organization (may take a few minutes), then re-run the pipeline.


    There are ways to simplify this workflow.

    1 Private agent

    If you’re running a private build agent, you can overwrite the contents of the task in the _tasks folder of the agent and re-run the pipeline. The agent will see it already has the task downloaded and will run the overwritten version immediately.

    Make sure the agent isn’t configured to extract the tasks for every job it is assigned.

    2 Upload the task directly to the Organization

    Instead of repackaging the extension, publishing it to the marketplace and waiting for the extension and task to be updated, you can push an updated version of your task to the Azure DevOps Organization/Server directly, overwriting the files.

    Use the tfx commandline to do so:

    tfx build tasks delete --task-id guid-of-the-task
    tfx build tasks upload --task-path pathtotask 
    

    This way you don’t need to overwrite version numbers at all and will be able to force Azure DevOps to use a new task without packaging and publishing an extension each time.

    Then when you’re done, increase the task version number and the extension version number and release a new version of the extension.


    To simplify the whole versioning scheme, I’ve built and maintain the Azure DevOps Extension Tasks, a collection of Azure Pipelines Tasks that can help with the packaging and publication of Azure DevOps Extensions.

    I’ve documented the versioning strategies you can use with that in a previous answer:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search