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.
{
"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
Based on your description, the
*.js
and*.js.map
files are in theAddFeedStatusV1
folder and the folder has been included in thevss-extension.json
.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
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.
There are a few things you should know:
So. When you’re making changes to the task you must always do the following:
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: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: