Versions affected
Bug was observed in QuickBuild 12.0.9 and 12.0.27.
Repro steps:
Create a new child Configuration under any Configuration that has an empty master Step or a master Step that only runs dummy Steps that are safe to run anytime.
Specify the following:
Name=anything you want. For this example, I used "scheduleBuildConditionScriptReturnFalse".
Next Build Version=Use specified version=1.2345.0
Reason: We are using a value other than the default of 1.0.0 so that it will easier to spot in the server log.
Schedule=Cron schedule
Expression=0 * * * * ?
paused=false
Random Range=0
Build Condition=If specified script evaluates to true
groovy:
logger.info('Returning false for Build Condition');
return false;
Click Save.
Watch the clock and wait for the next minute to roll around.
Observed:
the new Configuration runs once.
Expected:
The new Configuration does not run.
Additional notes:
After this first-time run of the Configuration, the Build Condition is respected as expected and the Configuration does not continue to run every minute.
So this bug where the Build Condition is ignored appears to happen only the first time the Configuration's Schedule is met.
This bug appears to also happen if you use a Periodical Schedule, or if you use a different Build Condition, such as "If specified variable evaluates to true" and you select a Variable that has a value of "false".
Server Log
In my example above, the Server Log contains the following.
Note that I have no other scheduled jobs on this server that would start at 17:48:00, so the log messages at 17:48:00 below all pertain to the new Configuration I added.
2023-01-30 17:48:00,041 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Processing build request (configuration:root/Test/stang/scheduleTest/scheduleBuildConditionScriptReturnFalse, request id:d2c43cca-d411-4bb8-8cbb-9b3247cbaeb8)
2023-01-30 17:48:00,044 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Checking build condition on node (address: myquickbuildserver:1443, ip: 10.17.203.172)...
2023-01-30 17:48:00,053 [pool-2-thread-2440] INFO com.pmease.quickbuild.CheckConditionJob - Taking repository snapshots...
2023-01-30 17:48:00,053 [pool-2-thread-2440] INFO com.pmease.quickbuild.CheckConditionJob - Evaluating build condition...
2023-01-30 17:48:00,053 [pool-2-thread-2440] INFO com.pmease.quickbuild.Context - Returning false for Build Condition
2023-01-30 17:48:00,167 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - New build version is calculated as '1.2345.0'.
2023-01-30 17:48:00,649 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'My Metrics'...
2023-01-30 17:48:00,649 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Java NCSS'...
2023-01-30 17:48:00,649 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'SonarQube Report'...
2023-01-30 17:48:00,649 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'SCM Changes'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'NCover Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Clover Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'JUnit Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'CPD Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'MSTest Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'TAP Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Bullseye Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Custom Statistics'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'FindBugs Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'JMeter Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Cobertura Report'...
2023-01-30 17:48:00,650 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'PMD Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'TestNG Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Valgrind Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'MBUnit Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'CodeNarc Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Coverity Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'CheckStyle Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Cppcheck Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Fxcop Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Jacoco Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'NUnit Report'...
2023-01-30 17:48:00,651 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Build Stats'...
2023-01-30 17:48:00,682 [pool-2-thread-2415] INFO com.pmease.quickbuild.plugin.report.buildstats.StepStatisticsGenerator - Deleting step records of current build 35399
2023-01-30 17:48:00,698 [pool-2-thread-2415] INFO com.pmease.quickbuild.plugin.report.engine.contribution.publisher.StatisticsReportPublisher - Finished collecting statistics data for report 'Build Stats' [configuration: 34053, build: 35399]
2023-01-30 17:48:00,698 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'EMMA Report'...
2023-01-30 17:48:00,698 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Busted Report'...
2023-01-30 17:48:00,698 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Collecting statistics 'Boost Test'...
2023-01-30 17:48:00,699 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Populating configuration data...
2023-01-30 17:48:00,699 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Sending build notifications...
2023-01-30 17:48:00,731 [pool-2-thread-2415] INFO com.pmease.quickbuild.DefaultBuildEngine - Build request has been processed.
The fact that the Server Log contains the following snippet:
2023-01-30 17:48:00,053 [pool-2-thread-2440] INFO com.pmease.quickbuild.CheckConditionJob - Evaluating build condition...
2023-01-30 17:48:00,053 [pool-2-thread-2440] INFO com.pmease.quickbuild.Context - Returning false for Build Condition
shows that it did in fact evaluate the Build Condition script, but ignored the result and ran the Configuration anyway.
The Build ID 35399 noted in the server log was the build ID of the Build of the new Configuration that unexpectedly ran.