Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
In a single job definition in Hudson, it would be very nice if the sonar build would run only on the nightly (periodic) build, and not during the day when there is a lot of scm churn.
I see two ways of doing this:
1) Disable sonar when triggered by scm (the patch I submitted).
- Single config option checkbox to Skip sonar when SCM triggered
2) Provide time window when Sonar should run (must be in sync with the cron definitions of Poll SCM and Build Periodicially)
I chose to implement choice #1 because:
a) It was easier (no date formatting, etc).
b) Seems like a better option for distributed teams that may be on vastly different time zones.
Hi Ben,
That's a really interesting proposal, particularly the first implementation.
But your patch does not work if there are only periodical builds, for example only nightly builds. Sonar will not be executed if there are SCM updates.
The following code of SonarPublisher :
if (sonarInstallation.isSkipOnScm() && !build.getChangeSet().isEmptySet()) {checks if there are SCM updates. In fact it should check if the build was triggered by an hudson.triggers.TimeTrigger but not by an hudson.triggers.SCMTrigger.
Do you know how can we do that ?