Details
-
Bug
-
Resolution: Fixed
-
Low
-
5.8, 5.7.0
-
None
Description
User impact
can't generate report for plan with manual stage which was not started
Description
If plan has manual stage then buildDate field of AbstractResultSummary for this build is null until user manually run this particular stage.
This field is used on report generator to sort data on report preparation phase. If this field is null for some records it can put record into incorrect place of collection. Then we iterate on collection expecting that first element is the earliest event in series. If at the middle of collection we found element with getStatDate() earlier than current RegularTimePeriod we can't find next corresponding RegularTimePeriod and go over 9999 years limit of JFreeChart.
Also nullability of this field doesn't allow user to filter records by date on Reports UI
The following appear in the log files:
java.lang.IllegalArgumentException: Null 'key' argument. at org.jfree.data.DefaultKeyedValues2D.getRowIndex(DefaultKeyedValues2D.java:184) at org.jfree.data.DefaultKeyedValues2D.setValue(DefaultKeyedValues2D.java:321) at org.jfree.data.DefaultKeyedValues2D.addValue(DefaultKeyedValues2D.java:304) at org.jfree.data.time.TimeTableXYDataset.add(TimeTableXYDataset.java:219) at com.atlassian.bamboo.reports.collector.AbstractTimePeriodCollector.writeCollaterToDataSet(AbstractTimePeriodCollector.java:202) at com.atlassian.bamboo.reports.collector.AbstractTimePeriodCollector.getDataset(AbstractTimePeriodCollector.java:83) at com.atlassian.bamboo.ww2.actions.reports.ViewReport.runReport(ViewReport.java:171) at com.atlassian.bamboo.ww2.actions.reports.ViewReport.doGenerate(ViewReport.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
Workaround
- Run SQL query
update BUILDRESULTSUMMARY set BUILD_DATE=BUILD_COMPLETED_DATE where BUILD_DATE IS NULL and BUILD_TYPE='CHAIN';
- Rebuild indexes: https://confluence.atlassian.com/display/BAMBOO/Reindexing+data
Fix
We will skip AbstractResultSummary which have this field empty, because technically this build was not even started