Skip to content
Permalink
Browse files

Merge pull request #14 from jglick/CCE-JENKINS-21310

[FIXED JENKINS-21310] CCE when a Queue.Task was not a Job
  • Loading branch information...
emsa23 committed Jan 9, 2014
2 parents 1e1336a + 5fbd7d9 commit 9c3fc0039aac147a8d2cc22582f116385acbcf98
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/main/java/jenkins/advancedqueue/PriorityConfiguration.java
@@ -204,7 +204,7 @@ public PriorityConfigurationCallback getPriority(Queue.Item item, PriorityConfig

private PriorityConfigurationCallback getPriorityInternal(Queue.Item item,
PriorityConfigurationCallback priorityCallback) {
Job<?, ?> job = (Job<?, ?>) item.task;
Queue.Task job = item.task;

// [JENKINS-8597]
// For MatrixConfiguration use the latest assigned Priority from the MatrixProject
@@ -225,8 +225,8 @@ private PriorityConfigurationCallback getPriorityInternal(Queue.Item item,
.getDefaultPriority());
}

if (PrioritySorterConfiguration.get().getAllowPriorityOnJobs()) {
AdvancedQueueSorterJobProperty priorityProperty = job.getProperty(AdvancedQueueSorterJobProperty.class);
if (job instanceof Job && PrioritySorterConfiguration.get().getAllowPriorityOnJobs()) {
AdvancedQueueSorterJobProperty priorityProperty = ((Job<?,?>) job).getProperty(AdvancedQueueSorterJobProperty.class);
if (priorityProperty != null && priorityProperty.getUseJobPriority()) {
int priority = priorityProperty.priority;
if (priority == PriorityCalculationsUtil.getUseDefaultPriorityPriority()) {
@@ -247,6 +247,7 @@ private PriorityConfigurationCallback getPriorityInternal(Queue.Item item,
.getDefaultPriority());
}

// TODO a simple jobName will not work for jobs in folders, and would be meaningless for non-Job Queue.Task’s
public JobGroup getJobGroup(PriorityConfigurationCallback priorityCallback, String jobName) {
for (JobGroup jobGroup : jobGroups) {
priorityCallback.addDecisionLog(0, "Evaluating JobGroup [" + jobGroup.getId() + "] ...");

0 comments on commit 9c3fc00

Please sign in to comment.
You can’t perform that action at this time.