Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not processing YAML before sending for validation #233

Closed
JonathanWolfe opened this issue Oct 15, 2019 · 3 comments
Closed

Not processing YAML before sending for validation #233

JonathanWolfe opened this issue Oct 15, 2019 · 3 comments

Comments

@JonathanWolfe
Copy link

I was getting some strange errors from my .gitlab-ci.yml about how "Property << is not allowed" when I realized that for validation the plugin is sending the raw document for validation, not the processed document (allowing for merges and such to be done).

Example that incorrectly throws validation errors:

#----------------------------------------------------------------
# Templates
#----------------------------------------------------------------
.node-modules-cache: &node-modules-cache
    cache:
        key: $CI_PROJECT_NAME
        paths:
            - nodejs/node_modules
            - nodejs/{auth,dms,kpis}/node_modules # sub-project node_modules

#----------------------------------------------------------------
# Validate
#----------------------------------------------------------------
nodejs-tests:
    <<: *node-modules-cache
    stage: validate
    script:
        - cd nodejs
        - npm install
        - npm run test:coverage
    artifacts:
        expire_in: 1 day
        paths:
            - nodejs/coverage
@nfriend
Copy link

nfriend commented Oct 26, 2019

@JonathanWolfe This isn't a real solution, but I found renaming the file from .gitlab-ci.yml > .gitlab-ci.yaml fixed this issue. So it seems that this extension is treating these extensions differently. I'll try and find an existing issue or create a new one and link it here.

Scratch that, changing the file name is actually just removing the schema validation altogether and treating the file as a generic .yml file. I think this is the core issue: redhat-developer/yaml-language-server#180.

@JPinkney
Copy link
Contributor

This should be fixed in 0.7.0!

@FelixBenning
Copy link

FelixBenning commented Aug 12, 2020

.ssh-script: &ssh-script
  before_script:
    - apt-get update && apt-get install -y -qq ssh
    - eval $(ssh-agent -s)
    - echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add -
    - mkdir -p ~/.ssh && chmod 700 ~/.ssh
    - echo "${HOST_PUBLIC_SSH_KEY}" >> ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts

.ssh-dev-config: &ssh-dev-config
  image: ubuntu:latest
  variables: 
    HOST: ${DEV_SERVER_URL}
    HOST_PUBLIC_SSH_KEY: ${DEV_SERVER_SSH_ITS_PUBLIC_KEY}
    SSH_PRIVATE_KEY: ${DEV_SERVER_SSH_MY_PRIVATE_KEY}
  << : *ssh-script

Still getting the error Property << is not allowed with version 0.9.1

EDIT: now that I got this running I noticed: the environment variables of type file get converted to normal environment variables if redefined this way. So I had to change cat to echo. I should probably ask around whether that is a security risk. (https://gitlab.com/gitlab-org/gitlab/-/issues/30775)

bleach31 pushed a commit to bleach31/vscode-yaml that referenced this issue Jan 25, 2022
…Snippets-array-fix

Fix the way defaultSnippets behaves on array items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants