History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-1042
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Robin Shen
Reporter: Jan Koprowski
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Failed builds changeset is empty

Created: 14/Sep/11 01:41 PM   Updated: 27/Dec/12 01:32 PM
Component/s: None
Affects Version/s: 3.1.54
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
Methods .getChangesCount() or .getChanges() return 0 or empty list of changes for builds which failed.
I expect it will return the same informations as SCM Changes part of build summary.
Fixing this is very important for us.

 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [15/Sep/11 12:04 AM]
I tried with a simple case, a checkout step followed by a build step, and the build step fails. I checked the "build.getChanges().size()" in post-build script (advanced setting of the configuration) and it returns changes correctly. Can you please create a simple test case so that I can try here?

Jan Koprowski [20/Sep/11 10:37 AM]
I'm running jython (I'm use my own plugin to be able to use that script programming inside views) code in post-execution action of CHECKOUT step like:


f = open('/tmp/qb.changes', 'w+')
while build and build.getStatus().name() not in ('SUCCESSFUL', 'RECOMMENDED'):
    f.write("Build: " + str(build.getChanges().size()) + "\n")
    f.write("Change count: " + str(build.getChanges().size()) + "\n")
f.close()

and the output is

Build: BUILD_1.0.0
Change count: 0
Build: BUILD_1.0.1
Change count: 0
Build: BUILD_1.0.2
Change count: 0

whre BUILD_1.0.1 is failed and show me three changes in "SCM Changes (3)".

Jan Koprowski [20/Sep/11 12:40 PM]
Next details:

I have two configurations:
root/A/B
root/TEST

In root/A/B i have 10 builds. Build BUILD_5 is failed but it contain 3 SCM Changes

in root/TEST I wrote script similar to this

build = system.getConfiguration('root/A/B').getLatestBuild()
f = open('/tmp/' + filename, 'w+')
while build and build.getStatus().name() not in ('SUCCESSFUL', 'RECOMMENDED'):
       f.write("Build: " + str(build.getVersion()) + "\n")
       f.write("Change count: " + str(build.getChanges().size()) + "\n")
       build = build.getPrevious()
f.close()

I'm calling this script in three in root/TEST places (in each time 'filename' is different)

1) Called in Next Build Version of TEST configuration field return 3 SCM Changes for BUILD_5
2) In post-execute action of CHECKOUT step of TEST configuration - return 0 SCM Changes for BUILD_5
3) In post-build script of TEST configuration return 0 SCM Changes for BUILD_5

Jan Koprowski [20/Sep/11 01:07 PM]
The best test!

In root/TEST set script

${groovy:
build = system.getConfiguration('root/A/B').getLatestBuild()
while (build.getId() != 6111) build = build.getPrevious()
build.getChanges().size().toString()}

as Next Build Version. Before triggering build You will see '3' but triggered build will get build number '0'.
6111 is build-id with SCM-Changes from root/A/B

Robin Shen [20/Sep/11 11:42 PM]
Currently accessing changes of other builds from context of a running build has problems. We reworked the changes in QB4 and such problem will be resolved. QB4 will be released in the end of this month.