compute last successfuful build from current build