Skip to content

Correction of queue and excutor filtering in view#394

Closed
lvotypko wants to merge 1 commit into
jenkinsci:masterfrom
lvotypko:master
Closed

Correction of queue and excutor filtering in view#394
lvotypko wants to merge 1 commit into
jenkinsci:masterfrom
lvotypko:master

Conversation

@lvotypko
Copy link
Copy Markdown
Member

@lvotypko lvotypko commented Mar 1, 2012

I change method getQueueItems() in class hudson.model.View, because it does not count on Matrix configurations - the filtered queue does not display configurations of matrix job, which are waiting in a queue.

The filtering of executors (method getComputers()), on which the jobs in view can be build, works for Matrix jobs incorrectly too. I add the labels of configurations and skip the Matrix job, because its build can run on all executors - the filtering would be useless.

@kohsuke
Copy link
Copy Markdown
Member

kohsuke commented Mar 6, 2012

Thanks for the change. However, I think it is better to fix this in a polymorphic fashion so that Views don't know too much about various subtypes of AbstractProject. I've implemented such a change in 48fc05d

@kohsuke kohsuke closed this Mar 6, 2012
@lvotypko
Copy link
Copy Markdown
Member Author

lvotypko commented Mar 6, 2012

Great, it is better way. Thanks!

@lvotypko
Copy link
Copy Markdown
Member Author

lvotypko commented Mar 6, 2012

But now I see there is one problem - it does not change executor filtering. You add MatrixProject label by method getAssignedLabel(), but this method always returns null for MatrixProject. This condition "labels.contains(null) && n.getMode() == Mode.NORMAL" is met by each node in normal mode if view contains matrix job. I think that a user does not expect this behaviour. He creates matrix job with configurations and he only wants to know where the configurations can run - this is the behaviour that he expects from filtering executors.
I think that the method in MatrixProject should be:
public Set getRelevantLabels() {
Set r = new HashSet();
for (MatrixConfiguration c : getActiveConfigurations())
r.add(c.getAssignedLabel());
return r;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants