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

Error in implementing bamboo-specs feature for a plugin

Kapil Gupta July 2, 2023

I am trying to add bamboo-specs feature to matlab-bamboo-plugin so that users can specify their build configuration as a YAML file. While doing so, I am not able to verify the implemented changes on my bamboo local dev instance. The implemented changes are available here.

  • Is there any limitation for using bamboo-specs with a local instance? If not, am I missing something in my implementation?
  • What would be the task name when mentioning a task (from this plugin) in the YAML file (the key for <taskName> task in this plugin is 
    "com.mathworks.ci.matlab-bamboo-plugin:<taskName>")?

Any sort of guidance would be appreciated, thanks!

(FYI the plugin is not available on the Atlassian Marketplace. The users download the jar file from the mentioned repository and upload it to their bamboo)

1 answer

1 vote
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 10, 2023

Hello @Kapil Gupta,

Each app needs to implement its own Export methods so Bamboo can use them to build its Java and YAML Specs.

First, try to export your Plan to YAML Specs and use it as a model. If the app configuration doesn't show up on the YAML code, try exporting to Java Specs.

If you can export the Plan configuration to Java Specs and it contains the instructions for your Matlab app, you can try following the instructions on the KB below and adapt to your YAML code (not guaranteed to work):

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful--

Kapil Gupta July 10, 2023

Hey @Eduardo Alvarenga ,

Thanks for your reply!

I have implemented export methods for all my tasks (three in our MATLAB plugin). When I try to export my plan to Java Specs, it does show me my task's conversion (see image1 below), but when I try to export my plan to YAML specs instead of using a keyword related to my task, it uses any-task keyword along with the key to convert the plan to specs (see image2 below).

IMAGE 1:

Screenshot 2023-07-10 183947.png

IMAGE 2:

Screenshot 2023-07-10 184016.png

Few puzzles:

  • Is this how it is supposed to work? For example, it would use any-task keyword itself when I try to export my plan as YAML (but it would work fine for Java specs)
  • If not, how is the task keyword determined? I was expecting the YAML conversion to look something like this (see image3 below, the first line is the task keyword, i.e. runMATLABTest, instead of any-task). 

IMAGE 3:

Screenshot 2023-07-10 184526.png

Regards,

Kapil

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 10, 2023

Hello @Kapil Gupta 

Any-task is the generic implementation for apps that don't have a specific export/import structure. Each task is distinguished by its 'plugin-key' value. Just use the model on "Image 2" and it should be ok.

Thank you,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Like Steffen Opel _Utoolity_ likes this
Kapil Gupta July 10, 2023

Hey @Eduardo Alvarenga ,

That is what I'm trying to check. I have extended bamboo-specs feature for my plugin tasks (now it should be able to import/export; and it indeed can for "Java specs"), why is it still using any-task for conversion to "YAML specs".

  • I know model from Image 2 would work fine. I was just wondering if there is a way to use this task (which has extended bamboo specs) in my YAML file without using the any-task keyword and just some my-task specific keyword.
  • Is something like IMAGE 3 not applicable?

Regards,

Kapil

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 10, 2023

Your app needs to have a proper builder, properties and exporter classes to be able to fully export to YAML (and that needs to be implemented).

When that's not implemented, simply use any-task.

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Kapil Gupta July 10, 2023

Hey @Eduardo Alvarenga ,

I have implemented the required builder, properties and exporter classes for my plugin as per this doc. But still I'm not able to export my plan to YAML specs as expected (something like image 3). When I try to provide the code snippet from image 3 in my YAML file and run the pipeline, I get an incorrect document structure error (below image).

Screenshot 2023-07-10 195522.png

  • If bamboo-specs requirements are correctly implemented, should I see something like image 3 from previous replies?
  • Am I providing an incorrect task name? If so, how is the task name determined?

If you'd like to have a look at the implementation, it is available here.

Thanks and regards,

Kapil

Kapil Gupta July 20, 2023

Hey @Eduardo Alvarenga and team,

Any idea why we might be encountering this error with our implementation? Or we might be missing?

Regards,

Kapil

Kapil Gupta September 26, 2023

Hey @Eduardo Alvarenga and team,

We're still stuck here. It would be great if you could have a look and provide some guidance. Thanks in advance!

Regards,

Kapil

Kapil Gupta February 9, 2024

Hey @Eduardo Alvarenga and team,

It would be great if you could have a look and provide some guidance. Thanks in advance!

Regards,

Kapil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events