-
Suggestion
-
Resolution: Fixed
-
None
-
Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.
Currently, the latest version of Bamboo that this plugin can be used with is 4.4.3: Bamboo SBT Task
Form Name |
---|
[BAM-13592] Update Bamboo SBT Task to be compatible with versions after 4.4.3
I've built new version of SBT plugin against Bamboo 5.10. Also I fixed the problem with successful build not being correctly recognized.
Go to https://bitbucket.org/atlassian/bamboo-sbt-plugin/downloads for most recent downloads.
I don't know – looks correct. Maybe the sbt version is the issue (I'm speculating).
Can you try with an updated version of sbt? (i have 0.13.8)
Here is a part of Failing log from build log after adding the environment variables.
build 23-May-2015 06:28:48 [0m[[0minfo[0m] [0m[32m- should list all certificates[0m[0m
build 23-May-2015 06:28:48 [0m[[0minfo[0m] [0mPassed: Total 34, Failed 0, Errors 0, Passed 34[0m
build 23-May-2015 06:28:48 [0m[[32msuccess[0m] [0mTotal time: 48 s, completed May 23, 2015 6:28:48 AM[0m
simple 23-May-2015 06:28:48 Failing task since text '[success]' was not found in last 250 log entries
simple 23-May-2015 06:28:48 Parsing test results under /data/atlassian/application-data/bamboo/xml-data/build-dir/5865473/JIMPORT-CE-CER...
simple 23-May-2015 06:28:48 Finished task 'SBT Task' with result: Failed
And here is a screenshot for my SBT task setting.
https://dl.dropboxusercontent.com/u/22797689/sbt_task_setting.png
FYI, sbt version: 0.13.1
Scala: 2.10.2
Can u post log again after adding JAVA_OPTS setting in the Environment variables section?
Also make sure you only have "clean test" in the builder.sbt.target section, no other stuff.
Setting JAVA_OPTS like that worked for me on same version of Bamboo and same SNAPSHOT plugin...
I added 'JAVA_OPTS="-Dsbt.log.noformat=true -Dsbt.log.format=false"' to Environment variables, but I still have same problem.
Perhaps it would make sense if the sbt task plugin checks for this argument (and add it when missing), or make it check the sbt return code instead of text (if text is the only option, improve the text check?).
build 22-May-2015 03:00:31 [0m[[0minfo[0m] [0mPassed: Total 34, Failed 0, Errors 0, Passed 34[0m
build 22-May-2015 03:00:31 [0m[[32msuccess[0m] [0mTotal time: 44 s, completed May 22, 2015 3:00:31 AM[0m
Thats the weird check it's doing.
Do you have in the Environment variables something like this:
JAVA_OPTS="-Dsbt.log.noformat=true -Dsbt.log.format=false"
I installed SNAPSHOT version and tried to run the build, but SBT Task Plugin could not understand `[success] (color coded)` string, even after added to `Environment variables` :
-Dsbt.log.format=false
Bamboo 5.8.1 build 5866
Here is the build log: https://dl.dropboxusercontent.com/u/22797689/JIMPORT-CE-JOB1-20.log
Ah yes, that works as well. I already had a few options in Environment variables but I did not enclose them in JAVA_OPTS.
Thanks.
Also, I didn't have to add it to the builder.sbt.target field. I added it to the Environment variables field as:
JAVA_OPTS="-Dsbt.log.format=false"
By the way - I thought Bamboo was determining success/failure based on the process exit code, not just by looking at strings in the log. I seem to remember there was such an option in Bamboo config, whether to determine success based on exit code.
@sebastian: Good catch! Using -Dsbt.log.format=false worked for me too!
@krystian: I think you should add this option as the default when invoking sbt, otherwise Bamboo can't find "[success]" properly.
@Krystian Brazulewicz
Thanks, the attached version worked, I had to add "-Dsbt.log.format=false" to my builder.sbt.target value otherwise it could not find [success] (color coded).
Should I not add this argument to the Environment variables input?
Using Bamboo version 5.8.1 build 5866 by the way.
@krystian:
server log: http://pastebin.com/ciU6299A
build log: http://pastebin.com/zcEtJbL5
Good enough?
sebas4 What I meant:
- download the attached plugin
- in Bamboo go to Administration / Manage add-ons
- upload the new version of plugin
- then run your plan with SBT task
If it still fails - let me know what Bamboo version you're using.
capitanu As I mentioned in my previous comment: paste the whole build log and attach logs from the agent that was building this job (or server logs if it was local agent).
1 job, 2 tasks.
job 1 is source code checkout
job 2 is sbt task (sbt task plugin version 4.0)
using sbt version 0.13.8
build 18-May-2015 09:42:17 Passed: Total 27, Failed 0, Errors 0, Passed 27 build 18-May-2015 09:42:17 success Total time: 40 s, completed May 18, 2015 9:42:17 AM error 18-May-2015 09:42:17 Error occurred while running Task 'Unit tests(2)' of type com.atlassian.bamboo.plugins.sbt:sbt. error 18-May-2015 09:42:17 com.atlassian.bamboo.task.TaskException: Failed to execute task error 18-May-2015 09:42:17 at com.atlassian.bamboo.plugins.sbt.task.SbtBuildTask.execute(SbtBuildTask.java:102) error 18-May-2015 09:42:17 at com.atlassian.bamboo.task.TaskExecutorImpl$2.call(TaskExecutorImpl.java:272) error 18-May-2015 09:42:17 at com.atlassian.bamboo.task.TaskExecutorImpl$2.call(TaskExecutorImpl.java:269) error 18-May-2015 09:42:17 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:198) error 18-May-2015 09:42:17 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:269) error 18-May-2015 09:42:17 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:105) error 18-May-2015 09:42:17 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75) error 18-May-2015 09:42:17 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:188) error 18-May-2015 09:42:17 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:112) error 18-May-2015 09:42:17 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:110) error 18-May-2015 09:42:17 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) error 18-May-2015 09:42:17 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) error 18-May-2015 09:42:17 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) error 18-May-2015 09:42:17 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) error 18-May-2015 09:42:17 at java.lang.Thread.run(Thread.java:745) error 18-May-2015 09:42:17 Caused by: java.lang.IncompatibleClassChangeError: Found interface com.atlassian.utils.process.ExternalProcess, but class was expected error 18-May-2015 09:42:17 at com.atlassian.bamboo.plugins.sbt.task.SbtBuildTask.execute(SbtBuildTask.java:80) error 18-May-2015 09:42:17 ... 14 more simple 18-May-2015 09:42:17 Running post build plugin 'Clover Results Collector' simple 18-May-2015 09:42:18 Running post build plugin 'Artifact Copier' simple 18-May-2015 09:42:18 Running post build plugin 'Docker Container Cleanup' simple 18-May-2015 09:42:18 Running post build plugin 'NCover Results Collector' simple 18-May-2015 09:42:18 Running post build plugin 'npm Cache Cleanup' simple 18-May-2015 09:42:18 Finalising the build... simple 18-May-2015 09:42:18 Stopping timer. simple 18-May-2015 09:42:18 Build ROD-ROD-JOB1-4 completed. simple 18-May-2015 09:42:18 Running on server: post build plugin 'Clover Delta Calculator' simple 18-May-2015 09:42:18 Running on server: post build plugin 'Build Hanging Detection Configuration' simple 18-May-2015 09:42:18 Running on server: post build plugin 'NCover Results Collector' simple 18-May-2015 09:42:18 Running on server: post build plugin 'Maven Dependencies Postprocessor' simple 18-May-2015 09:42:18 All post build plugins have finished
Not sure if this is enough ?
Can you paste the whole build log and attach logs from the agent that was building this job (or server logs if it was local agent)?
It partly works. It builds the project correctly, but the build itself is marked as "Failed" in Bamboo, even though it actually succeeded. These are the last lines from the build logs indicating success:
18-May-2015 17:52:59 [info] Done packaging.
18-May-2015 17:52:59 [success] Total time: 20 s, completed May 18, 2015 5:52:59 PM
The error Bamboo reports is:
No failed tests found, a possible compilation error occurred.
(however, this project doesn't have tests enabled — in the "SBT Task" the checkbox for "The build will produce test results." is unchecked)
I'll try it and report back — however, why is it "unsupported". At the risk of repeating myself, Bamboo is a product aimed at building things... it has support for Maven, Ant, and other such "builders"... yet (official) SBT support is sorely lacking. SBT is gaining a lot of popularity, especially in the Scala world.
This is one of the unsupported plugins so we provide new versions on best-effort basis.
I've attached SBT plugin compiled against Bamboo 5.6.2 (it should also work with 5.7.x and 5.8.x). It would be great if someone could try it and report if it works as expected.
By the looks of this Atlassian is not going to fix it any time soon.
So that pretty much ends my evaluation of bamboo (lets guess the result!).
Rest of the app seems to work fine, but again, useless if it's not properly working with sbt.
Teamcity/Jenkins are next (and I already know sbt work's on both).
We delayed our continuous integration deployment until this was available, so we didn't have to hack around it and maintain the hacks. Going on 8 months now, maybe we should just try to make some hacks
+1, I have to mimic it with command-line execution. But as all of my projects are Scala/SBT, it's a serious issue with Bamboo for me.
I'd mark it major as there isn't any indication that the plugin WILL NOT work correctly on new versions of bamboo.
It's probably marked minor because you can work around the issue by using two tasks:
Command and then JUnit parser to check that tests ran successfully.
Upvoted.
I'm not sure I understand how it's priority can be "Minor". This is the main functionality of Bamboo... to build things. If it fails at being able to do that, I'd say that's a "Major" issue.
Also existing Marketplace home of the plugin https://marketplace.atlassian.com/plugins/com.atlassian.bamboo.plugins.sbt.bamboo-sbt-plugin
was replaced by https://marketplace.atlassian.com/plugins/com.atlassian.bamboo.plugins.sbt.bamboo-sbt-plugin