Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why plan created in bamboo_specs/bamboo.yml is default to read only?

Vinh Hong July 12, 2019

Hi I'm new to Bamboo and would love to use YAML specs for setting up plan for each of my service application.  Currently when my attempt of creating a plan, I'm getting read only plan which no one can use.  I've tried using the "plan-permissions:" as part of the plan, it is throwing exception that "plan-permissions" is an unknown property of the plan.

 

I'm using Bamboo 6.9.2 and plan permission only work when running through Java Specs.

 

Thanks,

Vinny

2 answers

1 vote
Jens Mühlenhoff July 24, 2019

Half a day lost because the documentation on

https://docs.atlassian.com/bamboo-specs-docs/6.9.0/specs.html?yaml#plan-permissions

did not pointed out to write it in this way.

 

Side note:

I see a lot of documentation and implemetation and this is by far the worst one

WebSphere in its first version was better than this. Sorry.

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 24, 2019

Hi @Jens Mühlenhoff

Thank you for the feedback.

Do you mind sharing your ideas on how this document could be improved?

I recently created a couple of requests to improve this doc, but I'm pretty sure there is more to be done. 

Thank you!

Tim Watts December 10, 2019

@Daniel Santos  Maybe the bamboo yaml file settings should be mentioned somewhere on this page: https://confluence.atlassian.com/bamboo/configuring-a-plan-s-permissions-289276858.html andpossibly mentioned on this page since it is a related topic:  https://confluence.atlassian.com/bamboo/configuring-project-permissions-938840042.html 

Like Daniel Santos likes this
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 26, 2019

Thank you so much @Tim Watts

I'll raise a request for that to our tech writers!!!

1 vote
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2019

Hi @Vinh Hong ,

Thank you for raising this question.

Why plan created in bamboo_specs/bamboo.yml is default to read only?

The intention of this design is to be able to control the plan configuration only from the repository side. This allows you to always have a way to restore an old configuration and also assure your code will be built with the correct build configuration.

Regarding the plan permissions, it is a different story. We recently implemented multiple document sections (called documents) in a YAML file. They are better described here:

It means that you need a different section to declare the plan permissions and that is why Bamboo was not able to identify the "plan-permissions" property.

This is an example that would work. It has two document parts:

version: 2
plan:
project-key: SPEC
key: PLAN
name: My Plan

stages:
- Stage 1:
jobs:
- Job 1

Job 1:
tasks:
- script:
- echo 'Hello from YAML Specs'

---
version: 2

plan: SPEC-PLAN
plan-permissions:
- users: admin
groups: bamboo-admin
roles: logged-in
permissions: view


You may be asking why we have this implementation. We did it to allow these document parts to be set in a completely different repository with different ownership/permissions.

Assuming the information about the different documents was not clear, I've created the following ticket as an improvement suggestion:

I hope that helps you to move forward.

Vinh Hong July 16, 2019

I've attemped above multi-documents in a single yaml file, I'm getting this error.

Bamboo YAML import failed: Invalid format of the YAML file: expected a single document in the stream
 in 'reader', line 1, column 1:
    version: 2
    ^
but found another document
 in 'reader', line 77, column 1:
    --- 

 Here is my bamboo.yml

version: 2
plan:
  project-key: VINNY
  key: PLAN
  name: Test Plan

stages:
  - Default Stage:
      jobs:
        - Build Application

Build Application:
  requirements:
#    - Maven 3
#    - os: centos \d+
    - JDK 1.8

  artifacts:
    - name: Shell Application
      location: target
      pattern: 'my_app.sh'
      shared: true

  tasks:
    - clean
    - script: |
         #!/bin/bash
         mkdir target
         my_app=my_app.sh
         cat >target/${my_app} <<EOT
         ls -l
         pwd
         echo "Welcome to my test app"
         echo "======================================="
         env
         EOT
         war=target/testapp.war
         touch ${war}
         echo "Not a war file" > ${war}
         echo "Trigger build run" >> ${war}
ls -l
         ls -l target/*
         echo "Build Completed"

---
version: 2
plan: SPEC-PLAN
plan-permissions:
  - users: admin
    groups: bamboo-admin
    roles: logged-in
    permissions: view

Anyway, I like the concept of YAML Specs as it is simple to use and learn.  This allows developers to quickly adopt to the product where a great learning curve is need to navigate the UI.

 

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2019

It might be an issue related to the plan key used for the plan permissions. Try changing

plan: SPEC-PLAN

to 

plan: VINNY-PLAN

 and let me know what happens.

I was able to make it work with this change.

Vinh Hong July 16, 2019

Same error.

 

It seems it doesn't like multi-documents.  Is there specific setting that I need to activate?

Vinh Hong July 16, 2019

Anyway, found a work around by having my bamboo_specs/bamboo.yml pull in each of the doc.

!include 'planA.yml'
---
!include 'planAPermssions.yml'
Like # people like this
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 17, 2019

Hi @Vinh Hong

I'm glad you found a workaround, but as I mentioned I was able to make it work in 6.9.2 with the same code you posted here.

I noticed a strange thing, you have an error in line 77, but the code posted here don't have 77 lines. Maybe the error was in a different part that was omitted?

If you don't want to investigate what caused the error I understand, but that made me curious.

By the way, thank you for sharing your workaround. I learned something new!

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events