AzureDevOps - поведение, отличное от настраиваемой задачи для служб и сервера

Я создал настраиваемую задачу, используя документацию, однако она работает в Azure DevOps Services, но на сервере выдает ошибку

An error occurred while loading the YAML build pipeline. Value cannot be null. Parameter name: key

Мои первые мысли: "Какой параметр отсутствует?" поэтому я заполнил все доступные и возможные параметры и продолжил с ошибкой.

После этого я зашел в средство просмотра событий на машине, на которой запущен Azure DevOps Server, и получил эту ошибку:

Detailed Message: The subscriber Pipelines Check Run: build completed event listener raised an exception while being notified of event Microsoft.TeamFoundation.Build2.Server.BuildCompletedEvent.
Exception Message: Value cannot be null.
Parameter name: definition and repository (type ArgumentNullException)
Exception Stack Trace:    at Microsoft.TeamFoundation.Pipelines.Server.Providers.TfsGitProvider.TfsGitConnectionCreator.IsProviderDefinition(IVssRequestContext requestContext, BuildDefinition definition)
   at Microsoft.TeamFoundation.Pipelines.Server.Extensions.BuildCompletedEventListener2.HandleCompletedEvent(IVssRequestContext requestContext, IReadOnlyBuildData build, BuildDefinition definition)
   at Microsoft.TeamFoundation.Pipelines.Server.Extensions.BuildCompletedEventListener.ProcessEvent(IVssRequestContext requestContext, NotificationType notificationType, Object notificationEvent, Int32& statusCode, String& statusMessage, ExceptionPropertyCollection& properties)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationEventService.SubscriptionList.Notify(IVssRequestContext requestContext, NotificationType notificationType, Object notificationEventArgs, String& statusMessage, ExceptionPropertyCollection& properties, Exception& exception)

task.json:

{
    "id": "25156245-9317-48e2-bcf4-7dab4c130a3e",
    "name": "ping-pong-build-trigger",
    "friendlyName": "Ping Pong Build Trigger",
    "description": "Randomly trigger builds to find a sequenced build order",
    "helpMarkDown": "https://github.com/brunomartinspro/Ping-Pong-Build-Trigger-AzureDevOps",
    "category": "Build",
    "author": "Bruno Martins (brunomartins.pro)",
    "version": {
        "Major": 1,
        "Minor": 0,
        "Patch": 0
    },
    "instanceNameFormat": "Ping Pong Build Trigger",
    "properties": {
        "mode": {
            "type": "string",
            "description": "Mode to be used",
            "label": "Mode",
            "required": "true"
        },
        "apiKey": {
            "type": "string",
            "label": "PAT",
            "defaultValue": "",
            "description": "Personal Access Token.",
            "required": "true"
        },
        "source": {
            "type": "string",
            "label": "AzureDevOps Project URI",
            "defaultValue": "http://kamina.azuredevops.local/DefaultCollection/Kamina",
            "description": "AzureDevOps Project URI.",
            "required": "true"
        },
        "projectName": {
            "type": "string",
            "label": "AzureDevOps Project Name",
            "defaultValue": "Kamina",
            "description": "AzureDevOps Project Name.",
            "required": "true"
        },
        "sourceBranch": {
            "type": "string",
            "label": "Git Source Branch",
            "defaultValue": "develop",
            "description": "The branch the builds will trigger",
            "required": "true"
        },
        "lastKnownFile": {
            "type": "string",
            "label": "Sequence Location",
            "defaultValue": "",
            "description": "The location of the Build Order.",
            "required": "true"
        },
        "maxErrorCycles": {
            "type": "int",
            "label": "Maximum Error Cycles",
            "defaultValue": 10,
            "description": "The number of fails allowed.",
            "required": "true"
        },
        "infiniteCycles": {
            "type": "string",
            "label": "Infinite Cycles",
            "defaultValue": "false",
            "description": "Infinite Cycles - only ends until everything succeeds.",
            "required": "true"
        }
    },
    "inputs": [{
            "name": "mode",
            "type": "string",
            "label": "Mode",
            "defaultValue": "AzureDevOps",
            "helpMarkDown": "Mode to be used.",
            "required": "true"
        },
        {
            "name": "apiKey",
            "type": "string",
            "label": "PAT",
            "defaultValue": "",
            "helpMarkDown": "Personal Access Token.",
            "required": "true"
        },
        {
            "name": "source",
            "type": "string",
            "label": "AzureDevOps Project URI",
            "defaultValue": "http://kamina.azuredevops.local/DefaultCollection/Kamina",
            "helpMarkDown": "AzureDevOps Project URI.",
            "required": "true"
        },
        {
            "name": "projectName",
            "type": "string",
            "label": "AzureDevOps Project Name",
            "defaultValue": "Kamina",
            "helpMarkDown": "AzureDevOps Project Name.",
            "required": "true"
        },
        {
            "name": "sourceBranch",
            "type": "string",
            "label": "Git Source Branch",
            "defaultValue": "develop",
            "helpMarkDown": "The branch the builds will trigger",
            "required": "true"
        },
        {
            "name": "lastKnownFile",
            "type": "string",
            "label": "Sequence Location",
            "defaultValue": "",
            "helpMarkDown": "The location of the Build Order.",
            "required": "true"
        },
        {
            "name": "maxErrorCycles",
            "type": "int",
            "label": "Maximum Error Cycles",
            "defaultValue": 10,
            "helpMarkDown": "The number of fails allowed.",
            "required": "true"
        },
        {
            "name": "infiniteCycles",
            "type": "string",
            "label": "Infinite Cycles",
            "defaultValue": "false",
            "helpMarkDown": "Infinite Cycles - only ends until everything succeeds.",
            "required": "true"
        }
    ],
    "execution": {
        "PowerShell": {
            "target": "ping-pong-build-trigger.ps1",
            "argumentFormat": ""
        }
    }
}

vss-extension.json

{
    "manifestVersion": 1,
    "id": "ping-pong-build-trigger-task",
    "name": "Ping Pong Build Trigger",
    "version": "1.0.0",
    "publisher": "BrunoMartinsPro",
    "targets": [{
        "id": "Microsoft.VisualStudio.Services"
    }],
    "description": "Randomly trigger builds to find a sequenced build order",
    "categories": [
        "Azure Pipelines"
    ],
    "icons": {
        "default": "extensionIcon.png"
    },
    "files": [{
        "path": "task"
    }],
    "contributions": [{
        "id": "ping-pong-build-trigger",
        "type": "ms.vss-distributed-task.task",
        "targets": [
            "ms.vss-distributed-task.tasks"
        ],
        "properties": {
            "name": "task"
        }
    }]
}

Как я могу использовать настраиваемую задачу как в Службах, так и в Сервере?

.Vsix можно загрузить на странице выпуска репозитория Github: https://github.com/brunomartinspro/Ping-Pong-Build-Trigger-AzureDevOps

Сообщество разработчиков: https://developercommunity.visualstudio.com/content/problem/715570/server-and-services-have-different-behavior.html.


person BrunoMartinsPro    schedule 28.08.2019    source источник


Ответы (1)


Таким образом, похоже, что в расширениях есть какой-то механизм кеширования, мне нужно 3 версии сервера Azure DevOps для отладки. Первый использовался для разработки, второй - также для разработки, но был удален и установлен снова, третий - для тестирования общедоступных выпусков. Я не смог найти физический каталог, в котором хранится кеш, если он вообще есть.

person BrunoMartinsPro    schedule 29.08.2019
comment
Создан developercommunity.visualstudio.com/content/problem / 720080 / - person BrunoMartinsPro; 02.09.2019