microsoft / azure-pipelines-vscode

VS Code extension for working with Azure Pipelines YAML files
MIT License
162 stars 102 forks source link

Docker@2 reports target as unexpected property #479

Open brsmyth opened 2 years ago

brsmyth commented 2 years ago

Consider a pipeline definition snippet like:

jobs:
- job: 
  container:
    image: mycontainer
    endpoint: container-reg
  steps:
  - task: Docker@2
    target: host
    inputs:
      command: build

The default tasks running in the job are to run in container mycontainer, but there are Docker@2 tasks that need to run on the host. The VS Code extension lists target as an unexpected property in the problems. Running the pipeline behaves as expected: the container build task is executed on the agent host.

50Wliu commented 2 years ago

Thanks for reporting @brsmyth. Looks like this is an issue with the YAML schema we're getting back from ADO. I'll file an issue on them and link to it here when I do.

Documentation on the target property for reference: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/tasks?view=azure-devops&tabs=yaml#step-target

jdthorpe commented 2 years ago

@50Wliu The same yaml schema has another error, which is that the command: pull raises this error even though "pull" is a valid value:

Value is not accepted. Valid values: "buildAndPush", "build", "push", "login", "logout", "start", "stop".

50Wliu commented 2 years ago

@jdthorpe Would you mind creating a new issue for that? I believe it should be easier to fix than this one :).

50Wliu commented 2 years ago

I'll file an issue on them and link to it here when I do.

Filed as https://developercommunity2.visualstudio.com/t/YAML-Schema-API-is-missing-target-proper/10085540.