Re: What is the best way to find out which revisions are in the current build at the start of the build
Hi That's what I'm doing at the moment. I'm currently calling http://yourjenkins/job/yourjob/yourrevision/api/xml?tree=changeSet[items[revision,msg]] which gives me an xml block with the revision and the message. However that only works if that build actually thinks it has changes (which it may not as per the reasons I provided). I guess the next step then is to find the previous build and try again? Also I was under the impression that the change set for the current build is only available after it is finished? On Thu, Apr 12, 2012 at 22:47, Ferenc Kovacs wrote: > > > On Thu, Apr 12, 2012 at 12:44 PM, Ferenc Kovacs wrote: >> >> >> >> On Thu, Apr 12, 2012 at 11:35 AM, Patrick >> wrote: >>> >>> Hi >>> >>> I'm trying to create a readme file based on the commit messages for all >>> the new revisions in the current build. Currently I do this by using the >>> Jenkins API to request the changesets for the last build (e.g. we're >>> currently building build #6 so the last build is #5). These changesets give >>> me the last revision number for my VCS and then I can find out what has >>> changed since. However this doesn't work quite that nicely because: >>> * The first build doesn't have a change set, which seems a bit silly >>> because obviously all the changes from all the commits until then are >>> included >>> * Sometimes a build fails at a point where there are no changes (e.g. >>> failure to clear the workspace). Then this build has no change set >>> * A build is run multiple times on a given VCS revision. >>> >>> So the question is what is the best / easiest way to determine which >>> revisions are new in the current build in relation to the last successful >>> build. >>> >>> Thanks >>> >>> Patrick >> >> >> what about using the Jenkins api? >> parsing xml output of >> http://yourjenkins/job/yourjob/yourrevision/api/xml?xpath=//changeSet >> > > but most importantly, why don't you fetch the changes of the current build? > I mean the changes in the current build that interests you. > The build will be created as soon as it starts, and when you buildstep kicks > in, you can already have the changeset for your current build (and you have > an environment variable which holds the current job number, so you have > everything to fetch the changes for the current build imo. > > -- > Ferenc Kovács > @Tyr43l - http://tyrael.hu
Re: What is the best way to find out which revisions are in the current build at the start of the build
On Thu, Apr 12, 2012 at 12:44 PM, Ferenc Kovacs wrote: > > > On Thu, Apr 12, 2012 at 11:35 AM, Patrick wrote: > >> Hi >> >> I'm trying to create a readme file based on the commit messages for all >> the new revisions in the current build. Currently I do this by using the >> Jenkins API to request the changesets for the last build (e.g. we're >> currently building build #6 so the last build is #5). These changesets >> give me the last revision number for my VCS and then I can find out what >> has changed since. However this doesn't work quite that nicely because: >> * The first build doesn't have a change set, which seems a bit silly >> because obviously all the changes from all the commits until then are >> included >> * Sometimes a build fails at a point where there are no changes (e.g. >> failure to clear the workspace). Then this build has no change set >> * A build is run multiple times on a given VCS revision. >> >> So the question is what is the best / easiest way to determine which >> revisions are new in the current build in relation to the last successful >> build. >> >> Thanks >> >> Patrick >> > > what about using the Jenkins api? > parsing xml output of > http://yourjenkins/job/yourjob/yourrevision/api/xml?xpath=//changeSet > > but most importantly, why don't you fetch the changes of the current build? I mean the changes in the current build that interests you. The build will be created as soon as it starts, and when you buildstep kicks in, you can already have the changeset for your current build (and you have an environment variable which holds the current job number, so you have everything to fetch the changes for the current build imo. -- Ferenc Kovács @Tyr43l - http://tyrael.hu
Re: What is the best way to find out which revisions are in the current build at the start of the build
On Thu, Apr 12, 2012 at 11:35 AM, Patrick wrote: > Hi > > I'm trying to create a readme file based on the commit messages for all > the new revisions in the current build. Currently I do this by using the > Jenkins API to request the changesets for the last build (e.g. we're > currently building build #6 so the last build is #5). These changesets > give me the last revision number for my VCS and then I can find out what > has changed since. However this doesn't work quite that nicely because: > * The first build doesn't have a change set, which seems a bit silly > because obviously all the changes from all the commits until then are > included > * Sometimes a build fails at a point where there are no changes (e.g. > failure to clear the workspace). Then this build has no change set > * A build is run multiple times on a given VCS revision. > > So the question is what is the best / easiest way to determine which > revisions are new in the current build in relation to the last successful > build. > > Thanks > > Patrick > what about using the Jenkins api? parsing xml output of http://yourjenkins/job/yourjob/yourrevision/api/xml?xpath=//changeSet -- Ferenc Kovács @Tyr43l - http://tyrael.hu
What is the best way to find out which revisions are in the current build at the start of the build
Hi I'm trying to create a readme file based on the commit messages for all the new revisions in the current build. Currently I do this by using the Jenkins API to request the changesets for the last build (e.g. we're currently building build #6 so the last build is #5). These changesets give me the last revision number for my VCS and then I can find out what has changed since. However this doesn't work quite that nicely because: * The first build doesn't have a change set, which seems a bit silly because obviously all the changes from all the commits until then are included * Sometimes a build fails at a point where there are no changes (e.g. failure to clear the workspace). Then this build has no change set * A build is run multiple times on a given VCS revision. So the question is what is the best / easiest way to determine which revisions are new in the current build in relation to the last successful build. Thanks Patrick