-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins v1.432, AccuRev Plugin v0.6.18
This feature should be usable per job setting so that each job/project can either use the old style or this style because not every project likes to have the extra required stream.
– -- – -- –
Here is a suggestion for a more effective AccuRev polling to decide whether a CI build should be started.
1) One time only: Create a sub-stream of Project named Project_Last_CI and set time-basis to "now"
accurev mkstream -s Project_Last_CI -b Project -t now
2) On each polling cycle, check to see if there are any changes in Project (promotes into Project, its parent, its grandparent, any xlinks, etc.)
accurev diff -a -i -v Project -V Project_Last_CI
3) If the accurev diff command produces any output, it is time to kick off a CI build
a) Update Last_CI stream time-basis
accurev chstream -s Project_Last_CI -t now
b) Perform regular hist information being done today to capture transactions
c) workspace update
d) build
Because the diff command normally takes just 4-5 seconds, even for a large stream, this will create a significant load reduction. It should actually enable the project to run the polling more frequently while simultaneously creating less load on the AccuRev server.
Once you know a transaction ID, you can probably quickly check for changes using the accurev update command.
This does not provide you with a means to get all the individual transactions, but it does allow you to check for changes with a single command (and if changes are found, the current mechanism can still be used to list the actual changes).
The command would like this:
accurev update -s "Some Stream Name" -t 219585-now -fx
...in which Some Stream Name is ofcourse the name of the stream and 219585 is the ID of the last transaction that was built.
In case of no changes it will return an empty acResponse element:
Otherwise it will list the elements that have newer versions available, something like:
This should also work for workspaces, regardless of the fact if they have been checked out or not (can be done from any machine).