youngmon/atlassian-qna huggingface dataset:
JUnit Parser reports some but not all test results
Asked by spstromberg:

We are running Bamboo Server

Testing my code on bamboo produces an accurate output.xml file. I run 84 tests; 4 are skipped, 4 fail, and 76 pass.

The JUnit parser returns that the build failed, red bar, that's accurate. But, the "Build and Unit Test" page for the job says 54 tests in total ran (not the actual 84), and it shows no Failed tests: ![BambooCapture.PNG](/t5/image/serverpage/image-id/2633iF1745C2E66D455B6/image-size/large?v=v2&px=999 "BambooCapture.PNG")

The tests that are missed that are failing are named:

test_flow_frame_signal_for_flow_through_flow_cell  
test_flow_frame_signal_for_bypass_flow  
test_syringe_start_button_signal_for_wash_flow  
test_syringe_start_button_signal_for_air_flow

These have kind of long names. Doest Bamboo's JUnit Parser fail to count tests with names 36 characters long or longer? (54 of my tests have names that are less than 36 characters).

Any other ideas as to the discrepency between total tests and passed tests?

Also, how can I file a bug report with Atlassian?

Thank you!


Answers:
author: Cristiano Mariano
body: Hi Sean! How are you doing?

I have seen this behavior when tests have duplicate names. In order to make sure Bamboo does't show duplicates, they prefer to omit them.

Does it make sense in your scenario?

Hope this helps!

Thanks,

Cristiano

comments: author: spstromberg
body: Thank you Cristiano,

Atlassian looked into it and created a bug report:

<https://jira.atlassian.com/browse/BAM-18510>

Their assessment might be related to what you are saying. My tests have unique names, but the classname for 30 of the tests is null.

I tests and create the xml output using pytest which doesn't require a class. While they fix the bug I can just put those tests into a class.

Thanks for your suggestion!

Sean


Tags: junit
Email notification contain list of jira issues on finished deployment
Asked by Rob MacGregor:

as part of our deployment workflow, we want to be able to send a list of jira issues included in the release (the diff between latest release and previous release), to a specific email address.

The standard notification contain a link to the diff. We want to display the actual diff.

How can we do this?


Answers:
author: Alexey Chystoprudov
body: The only way to do it is to create own Notification plugin

comments: author: Rob MacGregor
body: Thanks!

Do you know what event is thrown after a successful manual deployment and also are the target environment name and issue diff available to the within the context of the event?


author: Alexey Chystoprudov
body: com.atlassian.bamboo.deployments.execution.events.DeploymentFinishedEvent

You can check <https://bitbucket.org/atlassianlabs/bamboo-after-deployment-trigger> to see how works with result and get all required information

Also look at <https://bitbucket.org/atlassianlabs/bamboo-agent-notification-plugin> to see how to create new Notification and send it via Email or IM
best practice configuring SPA application using Bamboo
Asked by siriousje:

What is the best practice to continuously build and deploy a static javascript/css/html application (SPA)?  

Coming from a backend development world, normally we build once and then deploy to various targets where the configuration sits in the environment. So for a basic Java web app, we'd just setup one build in Bamboo, but link it to various deployments.  

However, we're moving towards more SPA type applications and these all run in the client browser. So, there is no environment to get configuration from. In this case I'm using a React/Redux app that is bundled/wrapper using Webpack and it's build using npm/node.

The only way I have found to be able to configure this correctly is by having the environment/configuration injected during the npm build phase. Because, basically, after that, you're left with a folder of minified and uglified and hashed javascript files so it's virtually impossible to do post-build variable updates.  

So, now I have one project that has as many builds as that it has deployment targets and then for each I have to create one single deployment task.

Given that I'm surely not the only one building SPA type applications, I was wondering what the best practice for this is?  

Are you perhaps doing the npm build during the deployment task? And instead of having the build folder as artifact, use the entire source tree?


Answers:
author: devpartisan
body: To restate your problem, Bamboo's deployment model depends upon the notion of a fixed "artifact" (like a Java jar), while Webpack's build model is about binding configuration into the web files (like URLs). The "difference of opinion" is confusing.

One thing that I would recommend is taking more of a continuous deployment approach. Namely, don't worry about deploying into multiple environments, just deploy straight to production. That doesn't necessarily mean that every deployment is immediately visible to your users. Rather, use Webpack's understanding of the whole dependency tree to create "versions" of your SPA. Then use your web server/load balancer to point to the version that you want to reveal.

Use Bamboo's deployment projects to manage the "pointer". For example, users access "app.example.com" but it points to "app.example.com/1/". Testers access "test.app.example.com" but it points to "app.example.com/2/". When you want to "deploy", Bamboo changes the configuration of the web server, rather than moving any real artifacts.

It feels like this approach would avoid too much conflict between the tools. That said, there are many ways to solve this one.


Tags: javascript

node.js
Disconecting JIRA as Bamboo's user repository
Asked by Joseph Murphy:

I'm currently using JIRA Server to authenticate users in Bamboo. I would like to now disconect JIRA as my user repository and use Bamboo's internal user repository.

If I disconnect JIRA as per the following instructions, will I need to manually create my usrs and groups and associate them with all my Bamboo projects, etc?

<https://confluence.atlassian.com/bamkb/bamboo-lost-connection-to-the-external-user-directory-preventing-users-from-logging-in-678691207.html>


Answers:
author: somethingblue
body: Hi Joseph,

That is correct. Since the users will exist in JIRA, if you remote JIRA from the equation the users and groups will follow JIRA.

Cheers,

Branden

comments: author: Joseph Murphy
body: Thanks Branden. That's exactly what I was looking for!


author: somethingblue
body: No problem Joseph! I'm happy I was able to help albeit a bit late :/


Tags: jira
Does adding Executable Capability using API work?
Asked by Reynaldo Adji:

I have added a specific Executable capability (Powershell) to remote Bamboo agents. However, while the new Executable capability is listed in the Agent summary's Capabilities, it is NOT recognized to meet the requirement.

Hence, I cannot run Bamboo plan on those agents unless I add the powershell Executable capability by hand.

Any idea?


Answers:
author: somethingblue
body: Hi Reynaldo,

There are a couple things here:

You stated you have to manually add the executable by hand. There is a knowledge base article titled [Defining a new executable capability](https://confluence.atlassian.com/bamboo/defining-a-new-executable-capability-289277164.html) that lists the supported executables.

Next, I would review the [About capabilities and requirements](https://confluence.atlassian.com/bamboo/about-capabilities-and-requirements-289277171.html) knowledge base article to review how capabilites and requirements work together.

Finally, since you're getting the message that the listed agent is NOT recognized to meet the requirement you'll want to review the knowledge base article [No agents meet this job's requirements](https://confluence.atlassian.com/bamkb/no-agents-meet-this-job-s-requirements-833942890.html).

Cheers,

Branden
Trouble running NUnit Parser in Bamboo
Asked by Paul Boulos:

For QA, we run some website interface tests (Telerik), which are run through NUnit. Up until now, we have been running them manually through VS/Console and just waiting for it to run, but I have been looking to automate it. I saw that Bamboo had an NUnit test runner/parser task, so I set it up with the tests we run, defined the tests, and defined a results file. The set up is below.  

However, when running the test, it gets to a point in the logs where it initializes the test, acknowledges the test list and everything, but then just hangs indefinitely with no logs after after. I have kept it running for around 25 minutes sometimes before having to manually cancelling it. I am not sure where it is getting hung since there is no log files or anything after the test initializes, so I imagine it is running into an error even just opening a browsers. I can log into the account it uses and run the tests manually through console, but when trying to automate it, it just doesn't want to run, with no log of what is wrong.  

![QATest.PNG](/t5/image/serverpage/image-id/2585i8457255E672D99EB/image-size/large?v=v2&px=999 "QATest.PNG")![QALog.PNG](/t5/image/serverpage/image-id/2586iB8EE696359951FE9/image-size/large?v=v2&px=999 "QALog.PNG")


Answers:
author: somethingblue
body: Hi Paul,

I found an old case where Telerik addressed this issue. Their advice was to make sure that the CI agent service is **not** running as a **LOCAL SYSTEM** service and to make sure it's running as a local user per the [Running Bamboo as a Windows service as the local user](https://confluence.atlassian.com/bamboo/running-bamboo-as-a-windows-service-as-the-local-user-416580754.html) knowledge base article.

Before making those changes, one thing you can do is to try running this from the Command line to see if that provides the results you want.

Cheers,

Branden

comments: author: Paul Boulos
body: I have seen such an article, and it isnt running at local system, it is set up to run as a certain user. When I manually log into the server and run the same script through command line, it works just fine. When I try to automate it though, it just hangs indefinitely, as stated above


Tags: nunit
Permission via bamboo-specs
Asked by Johannes_Brunswicker:

Hi,

is it possible to define permissions for a bamboo plan in the bamboo-specs? I can't find anything regarding to that.

If it is not possible i have two follow up questions:

1. Will it be possible at a point in the (hopefuly near) future
2. Is there a workaround to set permission for bamboo plans programatically (i.e. REST)

Thanks for the help!

Johannes


Answers:
author: Steffen Opel _Utoolity_
body: **Update**

[Bamboo 6.1](https://confluence.atlassian.com/bamboo/bamboo-6-1-release-notes-932387968.html) has been released the other week and addresses the most notable Bamboo Specs gaps from release 6.0, including [plan permissions](https://docs.atlassian.com/bamboo-specs-docs/latest/specs.html#plan-permissions):
> * Manage plan permissions to control which users have access to various functions of the build plan.
> * Set up notifications about build results so that you can find out immediately about the success or failure of your builds.
> * Configure Miscellaneous plugins used for various additional functionalities for plans and jobs like Build expiry.
> * Define dependencies between various plans.

**Initial Answer**

Permissions are one of the [Bamboo Specs](https://confluence.atlassian.com/bamboo/bamboo-specs-894743906.html) items that have been skipped for Bamboo 6.0 (also: deployment projects and notifications), but are apparently scheduled for [Bamboo 6.1](https://jira.atlassian.com/projects/BAM/versions/71390) - please watch and vote for the following issue to register your interest:

* [Add support for Permissions with Bamboo Specs (BAM-18468)](https://jira.atlassian.com/browse/BAM-18468)

I'm not aware of a REST API based workaround from the top of my head (might well exist), but maybe [Granting plan permissions in bulk](https://confluence.atlassian.com/bamboo/granting-plan-permissions-in-bulk-289277232.html) would be sufficient to bridge the time until 6.1 arrives (don't know the ETA though)?

comments: author: Steffen Opel _Utoolity_
body: [@Johannes_Brunswicker](/t5/user/viewprofilepage/user-id/307196) - I have updated my answer regarding the meanwhile available [Bamboo 6.1](https://confluence.atlassian.com/bamboo/bamboo-6-1-release-notes-932387968.html) release, which now supports [plan permissions](https://docs.atlassian.com/bamboo-specs-docs/latest/#plan-permissions) in Bamboo Specs.


Tags: spec
Custom task not running on remote agent.
Asked by vbvaghela952:

So, I have created a sample task that is getting the values from the task UI and calling an API with these form data as parameters.

This custom task worked perfectly on the Bamboo server instance on my machine. When I installed a remote agent and tried running the task in there, it gives me error saying:

**"Could not execute task 'Default Custom Task' no Plugin with key 'com.custom.bamboo-plugin-demo:CustomPlugin' is installed."**

When I checked the logs of remote agent it showed a few suspiciously errorneous stuff. I am sharing here for the community to better understand the problem.

*Few errors in log like these and finally the last error is plugin not installed:*

**INFO \| jvm 1 \| 2017/06/27 17:27:38 \| 2017-06-27 17:27:38,552 ERROR \[ThreadPoolAsyncTaskExecutor::Thread 6\] \[OsgiPlugin\] Unable to start the plugin container for plugin 'com.custom.bamboo-plugin-demo'**

**INFO \| jvm 1 \| 2017/06/27 17:27:38 \| org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace \[<http://www.atlassian.com/schema/atlassian-scanner>\]**

**INFO \| jvm 1 \| 2017/06/27 17:27:38 \| 2017-06-27 17:27:38,569 ERROR \[ThreadPoolAsyncTaskExecutor::Thread 6\] \[ExtenderConfiguration\] Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.custom.bamboo-plugin-demo, config=osgibundle:/META-INF/spring/\*.xml))**

**INFO \| jvm 1 \| 2017/06/27 17:27:38 \| 2017-06-27 17:27:38,570 ERROR \[ThreadPoolAsyncTaskExecutor::Thread 6\] \[DependencyWaiterApplicationContextExecutor\] Unable to create application context for \[com.custom.bamboo-plugin-demo\], unsatisfied** **dependencies: none**

*AND FINALLY, THIS ERROR:*

**INFO \| jvm 1 \| 2017/06/27 17:30:25 \| 2017-06-27 17:30:24,958 ERROR \[3-BAM::10.20.28.33::Agent:pool-6-thread-1\] \[TaskExecutorImpl\] Could not execute task 'Default custom Task' no Plugin with key 'com.custom.bamboo-plugin-demo.CustomPlugin' is installed.**

*Few warnings in log like these:*

**INFO \| jvm 1 \| 2017/06/27 13:49:55 \| 2017-06-27 13:49:55,828 WARN \[AgentRunnerThread\] \[PropertyPlaceholderConfigurer\] Could not load properties from class path resource \[bamboo-init.properties\]: class path resource \[bamboo-init.properties\] cannot be opened because it does not exist**

<br />

**INFO \| jvm 1 \| 2017/06/27 13:49:55 \| 2017-06-27 13:49:55,834 WARN \[AgentRunnerThread\] \[PropertyPlaceholderConfigurer\] Could not load properties from class path resource \[bamboo-init.properties\]: class path resource \[bamboo-init.properties\] cannot be opened because it does not exist**


Answers:
author: Przemek Bruski
body: Which version of Bamboo do you have? Support for Atlassian scanner on remote agent was added in Bamboo 6 IIRC.

comments: author: Chris Farris
body: I'm running Bamboo 6.1.1 myself and I'm having the same problem.
Moving the folder for a Bamboo remote agent
Asked by David Mills:

Of the 10 remote agents we have, three used a different base path - which was annoying. So I stopped them, moved them, updated both bamboo-agent.cfg.xml and wrapper.conf and restarted.

2 of the three are functioning correctly. But one always attempts to create a deploy job's "Build working directory" using the old path. How can I correct this?


Answers:
author: David Mills
body: Figured this one out. The server on which the Agent resided had been moved from an internal datacentre to AWS. The team that moved it had failed to stop the original server instance (even though the name no longer resolved to it) and its copy of the Bamboo agent was still running.

Once this was resolved, I revoked the access for the old server instance (again), and accepted the new one, restarted everything and then it started working correctly.


author: Cristiano Mariano
body: Hi David! How are you doing?

When you restarted, did you check whether the processes were killed in the operating system? Maybe the one that is not correct yet failed to stop and is still using an old process.

Hope this helps!

Thanks,

Cristiano

comments: author: David Mills
body: We rebooted the whole server - but no help. So it can't be that.
Bamboo - cancel deployment actions
Asked by jvelapol:

We have deployment plans (NOT BUILD PLANS!) that a user may want to cancel for whatever reason. When the user presses the cancel button, there doesn't appear any way to capture that fact during the Deployment process. We'd like to then do something after a user cancels a deployment. For background, we have a custom-made deployment mechanism that handles deployments asynchronously. Namely:

1. Send Deployment product to server
2. Poll server endpoing to see when deployment is "done"
3. Report success/failure

The problem is that if the end user clicks, in Bamboo, "cancel", we'd like to then send a "cancel deployment" command to the deployment mechanism (simple REST call does the trick). However, I can't seem to find anything like "final" tasks in the Deployment stack, or any variables that suggest that the deployment was manually cancelled. Is there a way to capture that some how? I can't figure out what Bamboo does to the active running tasks on the Deployment side (issue a kill -N signal that I could trap in a script?) when you cancel an active deployment.

Note - this is for DEPLOYMENT PLANS, not BUILD PLANS.


Answers:
author: somethingblue
body: Hi Jon,

In a deployment project you should see a line that says Final Tasks and you can drag items under the Final Task to make sure they run even if the other tasks failed:

![Screen Shot 2017-07-18 at 1.43.50 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/3301iA2B49579EB2792E0/image-size/large?v=v2&px=999 "Screen Shot 2017-07-18 at 1.43.50 PM.png")

In regards to who completed the plan, if you view the full deployment log, you can search for "**Request to Stop.**"

Cheers,

Branden

comments: author: jvelapol
body: OK, but how would I use that *programmatically*? I can always manually observe a log file to see if "Request to Stop" happened. Are you saying that I should create some kind of parser that runs that does a grep on the output log (wherever it's stored locally) for a given deployment, and then execute on that? I can't find a "parse deployment log file" task.


author: jvelapol
body: Hrm. It appears that I can (probably fragile-ly) construct a path to grep in a log from:

```
#!/bin/bash

BASE=/path/to/bamboo-home/xml-data/builds
BUILD_DIR_BASE=$(echo $bamboo_working_directory | awk -F / '{printf $NF}')
BUILD_LOG_BASE=$(echo $bamboo_resultsUrl | awk -F = '{print $NF}')
BUILD_LOG=${BASE}/${BUILD_DIR_BASE}/download-data/build_logs/${BUILD_DIR_BASE}-${BUILD_LOG_BASE}.log

if grep -E -q "command.*Request to stop.*${BUILD_DIR_BASE}-${BUILD_LOG_BASE}" ${BUILD_LOG} ; then
  echo "doing some additional action based on user requesting a stop"
else
  echo "Nothing to do, happy enjoying!"
fi
```

Is that what's expected? I didn't see any values that pointed to the existing build log (like a $bamboo_build_log) set in any of the deployment log.
CPU miner malware
Asked by Laurent POCHON:

Hi,

We have bamboo in production and get attacked.

<https://security.stackexchange.com/questions/162829/struts2-3-zero-day-attack-exploited-cronjob-getting-created>

The consequence is a really high usage of CPU and memory.

This seems to be linked to one exploit available on struts (before version 2.5.10.1).

<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5638>

Are you aware of this ? Is this vulnerability fixed on the new bamboo version ?


Answers:
author: Steffen Opel _Utoolity_
body: Atlassian has addressed the referenced [CVE-2017-5638](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5638) via its resp. [Bamboo Security Advisory 2017-03-10 ( Remote code execution caused by Apache Struts 2)](https://confluence.atlassian.com/bamboo/bamboo-security-advisory-2017-03-10-876857850.html):

*"This advisory discloses a **critical severity** security vulnerability that was introduced in version 5.1.0 of Bamboo.Versions of Bamboofrom 5.1.0 but less than 5.14.5 (the fixed version for 5.14.x), and from 5.15.0 but less than 5.15.3 (the fixed version for 5.15.x), are affected by this vulnerability.*

*\[...\]* *"*

The vulnerabiltiy has been fixed in the following Bamboo versions:

1. Bambooversion 5.14.5
2. Bambooversion 5.15.3

comments: author: Laurent POCHON
body: thanks


author: Laurent POCHON
body: linked to this : <https://jira.atlassian.com/browse/BAM-18242>

comments: author: Laurent POCHON
body: can close the ticket
How to find deployment task which are assigned to a bamboo agent
Asked by Martin Duris:

Hi,

we have following issue. We have a lot of bamboo build plans and deployment jobs. One of our agents became DEDICATED and i need to find out which DEPLOYMENT job is ASSIGNED to agent (so i can remove it from this jog and start using agent fro building).

Is there any administration page for this ?

Thank you very much !

Martin


Answers:
author: Steffen Opel _Utoolity_
body: This is indeed not explicated on [Dedicating an agent](https://confluence.atlassian.com/display/BAMBOO/Dedicating+an+agent) and slightly non intuitive given the page name, though reasonably straight forward as such:

1. Go to the *Agents* management page - all dedicated agents are marked as such:  

   ![image2015-8-7 17-11-39.png](https://community.atlassian.com/t5/image/serverpage/image-id/2515iB226C13E88E7E6FD/image-dimensions/356x198?v=v2 "image2015-8-7 17-11-39.png")
2. Go to the agent in question by clicking its name or *View* .  

3. Click the *Dedicate agent* button, which happens to also be the dedication management page:  

   ![image2015-8-7 17-16-39.png](https://community.atlassian.com/t5/image/serverpage/image-id/2514i379406FDD4EF54DF/image-dimensions/400x136?v=v2 "image2015-8-7 17-16-39.png")  

4. Click the *Delete* icon on the specific dedication you want to remove:  

   ![image2015-8-7 17-8-27.png](https://community.atlassian.com/t5/image/serverpage/image-id/2516iE38A13E69C40D5B3/image-dimensions/404x145?v=v2 "image2015-8-7 17-8-27.png")


author: Alexey Chystoprudov
body: You can go to Administration \> Agents.

Click on View link against Agent name in a list of agents. Then click on Dedicate agent button. There you can see list of jobs and deployment environments assigned to agent


Tags: bamboo-administration
How to copy a folder between 2 stages?
Asked by gprasath:

I have 3 stages in my Plan.

1. Build Stage,

2. Deploy Stage,

3. Robot Tests Stage.

As part of Build stage, we check-in our Robot Test Cases. Hence the Robot Tests are available during Build Stage itself. But the problem is I need to run the cases only during the Robot Tests Stage.

At 3rd Stage, the build directory is a different folder altogether in Bamboo and I am not able to run my Test cases. So, I have to copy the folder with Robot Tests available in Build Stage to a another folder in Robot Tests Stage.

How to go about this?


Answers:
author: Cristiano Mariano
body: Hi! How are you doing?

As Jobs and Stages can run on different agents, located in different machines, by design the build directory is different for each one of them.

In your case, you could get files from version control in each one of the stages or you could use artifact sharing in order to acomplish what you need.

Hope this helps!

Thanks,

Cristiano