Cruise control .net git log invalid change range
I managed to mess up Cruise Control projects.
I have been updating the Git URLs for the project repos on my CI server when migrating to the new source control node. I cut a bit and paste happy and pasted the wrong url for the repository at the beginning. So the next time Cruise Control made a try, it merged in and pulled a lot of things that shouldn't be in the repository.
As soon as I realized my mistake, I thought that this is not a problem, I will simply delete the offending repository and clone using the correct URL.
Except that Cruise Control seems to have memorized the last set of changes from the messed up repository, and when deciding if it needs to do a new build, it throws a hiss. It doesn't matter what I guess. When it issues the Git log command, it says it cannot find the changeset in the cleaned-out repository.
git log 66cd57438ea42b4f8cb6dbf033dc1162f61a4d54..origin/master --name-status --pretty=format:"Commit:%H%nTime:%ci%nAuthor:%an%nE-Mail:%ae%nMessage:%s%n%n%b%nChanges:" -m
Source control operation failed: fatal: Invalid revision range 66cd57438ea42b4f8cb6dbf033dc1162f61d5e65..origin/master
The changeset identifier definitely does not exist in the correct repository, but does exist in the incorrect repository merge.
How can I make Cruise Control.net forget the duff set id?
source to share
CruiseControl.net stores the ID of the last commit in a file
for each project. These are usually text files that are located in the server directory (c: \ Program Files (x86) \ CruiseControl.NET \ server)
eg. The state file can contain:
<IntegrationResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" scmError="false"> <ProjectName>Project1</ProjectName> ... <Label>188.8.131.52</Label> <Parameters> ... <NameValuePair name="$LastChangeNumber" value="66cd57438ea42b4f8cb6dbf033dc1162f61a4d54" /> </Parameters> <LastSuccessfulIntegrationLabel>184.108.40.206</LastSuccessfulIntegrationLabel> <SourceControl name="commit" value="66cd57438ea42b4f8cb6dbf033dc1162f61a4d54" /> </IntegrationResult>
You can modify this file to contain the commit ID that matches your correct repository; however, you must first stop CruiseControl. Restart the server / service when they have all changed and you should be fine.
The only line that needs to be changed:
<SourceControl name="commit" value="66cd57438ea42b4f8cb6dbf033dc1162f61a4d54" />
Other properties can be left as they are; these are just properties of the latest build.
source to share