Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

The `caches: -node` syntax in yml file marked as invalid in VSC with Atlassian integration.

Andrey Kolybelnikov August 8, 2019

The error says `Incorrect type. Expected "object"`

The caches: -node syntax is taken from the example on the chaching dependencies page right here:

https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html

        

1 answer

0 votes
Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 2, 2019

Hi Andrey,

Could you please post a full YAML sample as a "Code block" (ie. so we can see exactly how the YAML is formatted). You can find the "Code block" option in the "Formats" menu in the editor.

Andrey Kolybelnikov September 16, 2019

Hi Steven,

Thank you for the reply. Here is an example of how the YAML is formatted:

branches:    
master:      
step:          
nameTest & Build          
imagenode:11.9.0          
caches:            
node          
script:            
yarn            
yarn global add @angular/cli            
.................................
 
Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 16, 2019

The keywords "name", "image" etc. need to be indented further than the "step" keyword:

branches:    
master:      
step:          
nameTest & Build          
imagenode:11.9.0          
caches:            
node          
script:            
yarn            
yarn global add @angular/cli            
Andrey Kolybelnikov September 16, 2019

Apologies for the misleading post. Yes, they are in my yaml. VSC has a very strict setting and all the indentation errors are highlighted. 

The code block formatter did not work properly so I indented the lines manually here.

The point is that the line with ‘-node’ is marked as wrong syntax and I cannot find out why.

Andrey Kolybelnikov September 17, 2019

Screenshot 2019-09-17 at 10.08.32.png

Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 17, 2019

Ok, I see. And just to be clear, this is only marked as an error in VSC? If you commit the file with the error does it work in Pipelines?

Have you tried enclosing the string in quotes? Eg.

caches:
- 'node'
Andrey Kolybelnikov September 18, 2019

Yes, correct. It is only marked as an error in VSC, but the node modules get cached in the Pipelines anyways.

Enclosing it in quotes has no effect.

Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 18, 2019

I agree, it looks like a bug in the extension. I recommend you raise an issue as described here: https://community.atlassian.com/t5/Bitbucket-articles/Try-Atlassian-for-VS-Code-New-Bitbucket-and-Jira-Software-Cloud/ba-p/1017882?_ga=2.15029814.1036991494.1565704145-165653393.1544177540

Edit: In fact this issue is related and someone has already commented on the problem with "caches" https://bitbucket.org/atlassianlabs/atlascode/issues/66/yaml-validator-inconsistent-with-online

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events