Approach to compiling all changes in dependency tree

Hi.

I'm currently trying to build a plugin that takes a build's last successful date and uses it to list all changes to all snapshot dependencies (including transitive) on a single page.  I'm having trouble figuring out how to obtain the build history for a particular dependency since a given date.  I noticed that BuildHistory has methods I can use but that they are deprecated.  What is the recommended way to do this?

Any other advice on how I might approach collating this data and displaying it would be mroe than welcome.  It's intended to be a build tab.

Thanks
-Leon

3 comments
Comment actions Permalink

After some more investigation, it appears that SBuild.getChanges(Date) would be appropriate, but I'm unable to find how I determine which Snapshot Dependency SBuild objects contributed to the SBuild being investigated.  Since dependencies need to be queried at the SBuildType level, how do I go about building a tree of SBuilds that contributed to a build?

There is no SBuild.getChanges(Date).  I've found much of what I need as far as SBuild dependencies in getBuildPromotion, but I still can't figure out how to start with a BuildPromotion or SBuild and find the list of changes since a particular Date.

0
Comment actions Permalink

Is there information I can get to see how the built in dependencies tab calculates its change information?

0
Comment actions Permalink

Leon, if you need to show all of the changes from the build chain (builds combined by snapshot dependencies), you can do the following:
if you have some build from the chain (SBuild), take its BuildPromotion (promotion object represents build state):

BuildPromotion promotion = build.getBuildPromotion();

// next find topmost builds from the chain, i.e. builds depending on all other builds
BuildPromotion[] tops = promotion.findTops();

// note that because of builds reusing (the same build can belong to different build chains) there can be several top promotions
// we can take the last one, by comparing promotion ids (this is a simplified approach, but I suppose it will work in your case)
BuildPromotion top = // the last top
top.getContainingChanges(); // top node changes

Then traverse all other nodes recursively using getDependencies() method and call getContainingChanges() on all of them, merge lists of changes and show them.

0

Please sign in to leave a comment.