Bamboo YAML import failed: Document structure is incorrect: Found following unused properties: plan-

Victorio Berra September 26, 2019
Bamboo YAML import failed: Document structure is incorrect: Found following unused properties: plan-permissions

 

 My YAML

 

---
version: 2
plan:
project-key: EEWTWS
  key: 'HEALTH2'  
name: Health
plan-permissions:
  - groups: '_Bamboo__Build_Admins'
    permissions: admin

 

 

I dont understand what im doing wrong. I want  _Bamboo__Build_Admins to be an admin on the plan when its created.

2 answers

1 accepted

1 vote
Answer accepted
Jack Nolddor _Sweet Bananas_
Atlassian Partner
September 26, 2019

Hi Victorio,

Manage plan permissions to control which users have access to various functions of the build plan using Bamboo YAML was introduced in Bamboo v6.1.0.

Which Bamboo version are you currently running? Could be this the root couse of your problem?

 

Anyway, do you mind to try using the following content?


bamboo.yaml

---
version: 2
plan:  
project-key: EEWTWS
  key: HEALTH2
name: Health

---
version: 2
plan: 
  key: EEWTWS-HEALTH2

plan-permissions:
- groups:
- _Bamboo__Build_Admins
  permissions: 
- admin

 

Victorio Berra September 26, 2019

6.9.2 build 60911 - 04 Jul 19

Victorio Berra September 26, 2019

Also im not alone. But his answer makes no sense. He probably doesnt even realize he disconnected the permissions from his plan by "moving them to a new block" whatever that means. Maybe we are looking at a real bug here?

Jack Nolddor _Sweet Bananas_
Atlassian Partner
September 26, 2019

Hi Victorio,

 

I've added a YAML proposal in my original answer.
Not sure if it is the same as you are currently using since the YAML you post in the original post seems to be malformed (I believe because copy & paste here)

Victorio Berra September 26, 2019

I have updated the formatting but yes the copy/paste was an issue.

 

Your code snippet did not work, I still have the same error "

Bamboo YAML import failed: Document structure is incorrect: Found following unused properties: plan-permissions

 

 I just saw you made some big edits and created an entirely new YAML. I will try that one second

Jack Nolddor _Sweet Bananas_
Atlassian Partner
September 26, 2019

Yes, sorry It is because reading the documentation it seems that the Plan Permissions entity is a first level entity and need to be placed in a separated file as denis.kot already suggested in his post.

Victorio Berra September 26, 2019

image.pngThe plan compiled now but the permissions were not applied.

Jack Nolddor _Sweet Bananas_
Atlassian Partner
September 26, 2019

I just realized after see the Alexander comment that I forgot to add the project key in the second file (planHEALTH2.yaml)

So the correct plan key is indeed EEWTWS-HEALTH2

Victorio Berra September 26, 2019

I can not get that to work @Jack Nolddor _Sweet Bananas_  its the same result, no permissions. Maybe I have to have those includes? II dont think its picking up planHEALTH2.yaml. Nothing is telling it to right?

Jack Nolddor _Sweet Bananas_
Atlassian Partner
September 26, 2019

Yeah, that seems to be the problem I've updated again my proposal and merged the two files into one.

Since I'm not pretty sure if plan key should be EEWTWS-HEALTH2 or plan key or HEALTH2 do you mind to try both options, please? (only in the permission section)

Victorio Berra September 26, 2019

That worked! Using the "full" key "EEWTWS-HEALTH2" and having everything in the same file.

Jack Nolddor _Sweet Bananas_
Atlassian Partner
September 26, 2019

Yeah! Congrats

I've updated my initial answer to reflect the final solution so you can mark the proposed solution as an 'Accepted answer'. This will help other people with the same or a quite similar problem to find a solution in a easy and faster way.

In addition, by doing this the post will automatically gain the "Solved:" prefix in search results to indicate other people that no further support is needed.

Kind Regards.

Victorio Berra September 26, 2019

I will say even though this is solved, this is incredibly counter intuitive and poorly documented.

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 3, 2019

Thanks @Jack Nolddor _Sweet Bananas_!

I've just started using YAML specs myself and found this while trying to figure out plan permissions.  This was very helpful.

0 votes
Alexander
Contributor
September 26, 2019

I'm fairly certain that plan permissions need to be in their own YAML document in order for Bamboo to use them, much like how build and deploy plans need to be separate from each other.

Ideally, it's best practice to keep your plans and permissions in their own file, and include them in your bamboo.yaml.

bamboo-specs
|-bamboo.yaml
|-build.yaml
|-permissions.yaml

bamboo.yaml:

---
!include 'build.yaml'
---
!include 'permissions.yaml'
...

build.yaml:

---
version: 2
plan:  
project-key: EEWTWS
  key: HEALTH2
name: Health

I'm not quite sure how the permissions.yaml needs to be formed, but here's my guess at it:

permissions.yaml

---
version: 2
plan: "EEWTWS-HEALTH2"

plan-permissions:
groups: "_Bamboo_Build_Admins"
permissions: admin
...

The three dashes in a YAML file mark the start of a new YAML document.

Victorio Berra September 26, 2019

My YAML all parses correctly but now I get a  new error:

 

There was an error when processing yaml file "bamboo.yaml". File structure is correct, contact Atlassian Support for assistance on resolving this issue.

Could not parse key 'HEALTH2'
java.lang.IllegalArgumentException: Could not parse key 'HEALTH2'


 

I didnt change any of the details, I just created the new files and added the includes

Alexander
Contributor
September 26, 2019

Ah, try this in your permissions.yaml:

plan: "EEWTWS-HEALTH2"

 I'll edit my above answer to put double quotes around that value as well.

Victorio Berra September 26, 2019

What is the difference between double and single quotes in your YAML?

Alexander
Contributor
September 26, 2019

There's no functional difference between the single and double quotes in my example. Good question, I'd suggest looking at some basic YAML syntax guides if you're new to the language.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events