question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Concourse] Outline view not loaded with VSCode Concourse CI extension when pipeline.yaml not complete

See original GitHub issue

Hi,

I have big pipeline descriptors with a lot of anchors and references which make VSC Concourse extension not work (cf. https://github.com/spring-projects/sts4/issues/483).

In order to navigate easily in my pipeline files, I tried to split these files into several ones (that I merge before load into my Concourse CI instance). But the problem is that the extension doesn’t load the outline view anymore. I don’t have content assist either by the way…

Here an exemple of a splitted file:

- name: deploy
  serial: true
  public: true
  plan:
  - in_parallel:
    - get: git-ci
    - get: metadata
    - get: git-tests
    - get: version-back
      trigger: true
      passed:
      - build
    - get: version-front
      trigger: true
      passed:
      - build

  - task: kustomize update
    file: git-ci/ci/tasks/kustomize/task.yaml
    input_mapping:
      git-ci: git-ci
      version-back: version-back
      version-front: version-front
    output_mapping:
      git-ci: git-ci
      k8s: k8s

  - task: Control
    file: git-ci/ci/tasks/control/task.yaml
    input_mapping:
      to_validate: k8s
      pipeline_data: metadata

  <<: *notifications

What’s the requirement for the files to be correctly parsed by the extension? Do I have to write every sections (resources, jobs, groups, …) in order it to work? Do the references have to be resolved in the same file ? Does the yaml only has to be valid?

Thanks for your answer

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kdvoldercommented, Nov 12, 2020

These questions are not actually very easy to answer. But in general things will ‘break’ in various ways for incomplete or invalid files. The editor implicitly assumes that you have your pipeline in one file and it cannot know that or how you are running it through any kind of processor before actually passing it to concourse cli.

How badly things breaks is somewhat dependent on implementation details.

We use snakeyaml to parse a file. If snakeyaml cannot parse a file, most things will not work. That’s probably what happens with the anchors. I think snakeyaml will try to resolve the anchors so if it cannot find the anchor it will error.

for my job files to be parsed, do I have to specify a job in top of each of them? If so, I would have to find a way to merge my files (maybe with yq) rather than just concatenate them.

Probably not to be parsed as yml. But the editor will be confused about the file structure if it doesn’t have enough context. So, for example it won’t know this is actually a job and you’ll get various errors reported because of that.

do every mandatory sections (resources & jobs) have to be present in the files? Here again, I would have to merge the file rather than concatenate them.

Not to parse things, but the editor does make checks such as whether when you refer a resource, it is defined elsewhere in the file. So you’ll get warnings for ‘missing resources’.

1reaction
kdvoldercommented, Nov 10, 2020

… (because of #483)

I’m sorry that didn’t yet get round to fixing that. I’ll try and fit it in soon. There’s probably something we can do to make it work better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Concourse CI Pipeline Editor - Visual Studio Marketplace
This extension provides validation, content assist and documentation hovers for editing Concourse Pipeline and Task configuration files. Usage.
Read more >
1.6.1 Setting Pipelines - Concourse CI
The pipeline configuration can contain Vars which may be replaced with static values or loaded at runtime. This allows for credentials to be...
Read more >
Demo: Concourse CI Pipeline Editing in Visual Studio Code
Kris DeVolder shows us the new pipeline editor tools for concourse. ci in Visual Studio Code.
Read more >
outline view in vscode not available - Stack Overflow
I've moved the outline view to the right size bar when working with workspace on a remote linux host a while ago; and...
Read more >
Modern CI is too complex and misdirected - Hacker News
- Use `drone exec` to run the whole Drone pipeline locally, but using docker-in-docker. This is slower and has no caching, but is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found