I am developing a bamboo plugin using the Atlassian-SDK. This plugin would add a new tab to the Bamboo Jobs page that would display an HTML report (present in artifact) in the same tab.
My Atlassian-plugin.xml looks like
<xwork key="viewRobotReport" name="View Robot Report">
<package name="RobotPlugin" extends="buildResultView">
<action name="viewRobotReport" class="robot.RobotReport">
<result name="success" type="freemarker">viewRobotReport.ftl</result>
</action>
</package>
</xwork>
<web-item key="RobotJob-${planKey}-${buildNumber}" name="RobotReport" section="results.subMenu/results" weight="80">
<label key="Robot Report"/>
<link linkId="RobotBuild-${planKey}-${buildNumber}">/build/result/viewRobotReport.action?buildKey=${planKey}&buildNumber=${buildNumber}
</link>
<condition class="robot.RobotReportViewCondition"/>
</web-item>
I am extending my class RobotReport from ViewBuildResults so that I can fetch the artifact details.
After I click on the tab I get an error
Apologies, this page could not be properly decorated (data is missing)The URL for the page is 172.xx.x.x0:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPRO1-TPLAN1-JOB1&buildNumber=1
From the logs I can see the below errors
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,724 INFO [http-nio-6990-exec-12] [AccessLogFilter] admin GET http://172.20.1.30:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPRO1-TPLAN1-JOB1&buildNumber=1&_=1525264904397 177957kb
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,725 ERROR [http-nio-6990-exec-12] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/build/result] and action name [viewRobotReport] associated with context path [/bamboo].
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,788 INFO [http-nio-6990-exec-9] [AccessLogFilter] admin GET http://172.20.1.30:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPRO1-TPLAN1-JOB1&buildNumber=1 76808kb
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,789 ERROR [http-nio-6990-exec-9] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/build/result] and action name [viewRobotReport] associated with context path [/bamboo].
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,819 ERROR [http-nio-6990-exec-9] [runtime] Error executing FreeMarker template
[INFO] [talledLocalContainer] FreeMarker template error:
[INFO] [talledLocalContainer] The following has evaluated to null or missing:
[INFO] [talledLocalContainer] ==> navigationContext [in template "decorators/resultDecorator.ftl" at line 17, column 18]
[INFO] [talledLocalContainer]
I understand that BambooStruts cannot find action in the namespace /build/result in /bamboo.
My freemarker template contains only this bit.
<html>
<head>
<meta name="decorator" content="result"/>
</head>
<body>
</body>
</html>
What is the correct way of adding action (viewRobotReport) in bamboo's /build/result namespace?
Bamboo Developer Forums doesn't have a guideline for implementing this. Somewhere it mentions "setter injection" but not sure what that is.
Any tiny hint would be highly appreciated. Thanks in advance.
I found what the problem was when I was looking at all the logs of atlas-run. I could the the below in the logs..
I fixed it in the code by doing the below..
Useful link
https://community.developer.atlassian.com/t/spring-autowiring-issues-when-extending-viewbuildresults/14766/2