Skip to content

Commit

Permalink
[JENKINS-51584] do not store actions from TransientActionFactory.
Browse files Browse the repository at this point in the history
The code was updated to use the non deprecated getAllActions() to obtain
the list of actions, however this was persisted in the actions causing
the actions from TransientActionFactories to be persisted in Builds.
  • Loading branch information
jtnord committed May 30, 2018
1 parent c4215dc commit 8ca8038
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/src/main/java/hudson/model/Queue.java
Expand Up @@ -2196,8 +2196,10 @@ protected Item(Task task, List<Action> actions, long id, FutureImpl future, long
for (Action action: actions) addAction(action);
}

@SuppressWarnings("deprecation") // JENKINS-51584
protected Item(Item item) {
this(item.task, new ArrayList<Action>(item.getAllActions()), item.id, item.future, item.inQueueSince);
// do not use item.getAllActions() here as this will persist actions from a TransientActionFactory
this(item.task, new ArrayList<Action>(item.getActions()), item.id, item.future, item.inQueueSince);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/queue/WorkUnitContext.java
Expand Up @@ -67,8 +67,8 @@ public WorkUnitContext(BuildableItem item) {
this.item = item;
this.task = item.task;
this.future = (FutureImpl)item.getFuture();
this.actions = new ArrayList<Action>(item.getAllActions());

// JENKINS-51584 do not use item.getAllActions() here.
this.actions = new ArrayList<Action>(item.getActions());
// +1 for the main task
int workUnitSize = task.getSubTasks().size();
startLatch = new Latch(workUnitSize) {
Expand Down

0 comments on commit 8ca8038

Please sign in to comment.