redhat-developer / redhat-developer/vscode-yaml

Azure pipeline expressions causing linter error

Open
#1,056 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

Describe the bug

In one of our Azure pipeline files we have the following part:

      publishDocs:
        - docsArtifact: 'doorstop-html'
          docsSubdirectory: ''
          ${{ if eq(parameters.debugrun, true) }}:
            docsName: '$(docsName)-test'
          ${{ else }}:
            docsName: '$(docsName)'
          docsDescription: '$(docsDescription)'
          ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') }}:
            excludeBuildNumber: true
          ${{ else }}:
            excludeBuildNumber: false

This causes a linter error at the last ${{ else }}: saying that "Map keys must be unique"

Expected Behavior

No linter error

Current Behavior

Azure pipeline expressions seems to be parsed as map keys

Steps to Reproduce

See example in description

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Azure pipeline example in the issue and trace the linter diagnostic for the final ${{ else }}: expression. Determine where these expressions are treated as YAML map keys, then add regression coverage for the example and verify that it produces no duplicate-key error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.