/** * Convenience method that returns a read only view of the {@link Cause}s associated with this item in the queue. * * @return can be empty but never null * @since 1.343 */ public final List<Cause> getCauses() { CauseAction ca = getAction(CauseAction.class); if (ca!=null) return Collections.unmodifiableList(ca.getCauses()); return Collections.emptyList(); }
/** * Convenience method that returns a read only view of the {@link Cause}s associated with this item in the queue. * * @return can be empty but never null * @since 1.343 */ public final List<Cause> getCauses() { CauseAction ca = getAction(CauseAction.class); if (ca!=null) return Collections.unmodifiableList(ca.getCauses()); return Collections.emptyList(); }
/** * Convenience method that returns a read only view of the {@link Cause}s associated with this item in the queue. * * @return can be empty but never null * @since 1.343 */ public final List<Cause> getCauses() { CauseAction ca = getAction(CauseAction.class); if (ca!=null) return Collections.unmodifiableList(ca.getCauses()); return Collections.emptyList(); }
/** * Folds this Action into another action already associated with item * from {@link FoldableAction} */ public void foldIntoExisting(Queue.Item item, Queue.Task owner, List<Action> otherActions) { // only do this if we are asked to. if(combineCommits) { RevisionParameterAction existing = item.getAction(RevisionParameterAction.class); if (existing!=null) { //because we cannot modify the commit in the existing action remove it and add self item.getActions().remove(existing); item.getActions().add(this); return; } // no CauseAction found, so add a copy of this one item.getActions().add(this); } }
/** * Test that it should block item if patchset is replicated to a slave * Before the Change Merged event is received. */ @Test public void shouldBlockItemUntilIfPatchSetIsReplicatedToOneSlaveBeforeDraftPublished() { //send the replication event before draft published event dispatcher.gerritEvent(Setup.createRefReplicatedEvent("someProject", "refs/changes/1/1/1", "someGerritServer", "slaveA", RefReplicated.SUCCEEDED_STATUS)); DraftPublished dp = Setup.createDraftPublished("someGerritServer", "someProject", "refs/changes/1/1/1"); Item item = createItem(dp, new String[] {"slaveA"}); assertNull("Item should not be blocked", dispatcher.canRun(item)); assertNull("Item should not be tagged with replicationFailedAction", item.getAction(ReplicationFailedAction.class)); }
/** * Convenience method that returns a read only view of the * {@link Cause}s associated with this item in the queue. * * @return can be empty but never null * @since 1.343 */ public final List<Cause> getCauses() { CauseAction ca = getAction(CauseAction.class); if (ca != null) { return Collections.unmodifiableList(ca.getCauses()); } return Collections.emptyList(); }
public boolean isInQueue(@Nonnull AbstractBuild<?,?> build) { for (Item item : JenkinsHelper.getInstance().getQueue().getItems(this)) if (item.getAction(PromotionTargetAction.class).resolve(this)==build) return true; return false; }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing!=null) { existing.causes.addAll(this.causes); return; } // no CauseAction found, so add a copy of this one item.getActions().add(new CauseAction(this)); }
public void foldIntoExisting(Queue.Item item, Task owner, List<Action> otherActions) { RevisionParameterAction existing = item.getAction(RevisionParameterAction.class); if (existing!=null) { existing.mergeRevisions(this.revisions); return; } // no RevisionParameterAction found, so add a copy of this one item.getActions().add(new RevisionParameterAction(this)); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing!=null) { existing.causes.addAll(this.causes); return; } // no CauseAction found, so add a copy of this one item.getActions().add(new CauseAction(this)); }
public void foldIntoExisting(Queue.Item item, Task owner, List<Action> otherActions) { RevisionParameterAction existing = item.getAction(RevisionParameterAction.class); if (existing!=null) { existing.mergeRevisions(this.revisions); return; } // no RevisionParameterAction found, so add a copy of this one item.getActions().add(new RevisionParameterAction(this)); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing!=null) { existing.causes.addAll(this.causes); return; } // no CauseAction found, so add a copy of this one item.getActions().add(new CauseAction(this)); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing != null) { existing.causes.addAll(this.causes); return; } // no CauseAction found, so add a copy of this one item.getActions().add(new CauseAction(this)); }
public List<ParameterValue> getParametersFromQueueItem(Queue.Item item) { List<ParameterValue> paramsList; ParametersAction params = item.getAction(ParametersAction.class); if (params != null) { paramsList = params.getParameters(); } else { paramsList = new ArrayList<ParameterValue>(); } return paramsList; }
public void foldIntoExisting(Queue.Item item, Task owner, List<Action> otherActions) { RevisionParameterAction existing = item.getAction(RevisionParameterAction.class); if (existing!=null) { existing.mergeRevisions(this.revisions); return; } // no RevisionParameterAction found, so add a copy of this one item.getActions().add(new RevisionParameterAction(this)); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing!=null) { existing.addCauses(getCauses()); return; } // no CauseAction found, so add a copy of this one item.addAction(new CauseAction(this)); }
/** * Convenience method that returns a read only view of the {@link Cause}s associated with this item in the queue. * * @return can be empty but never null * @since 1.343 */ public final List<Cause> getCauses() { CauseAction ca = getAction(CauseAction.class); if (ca!=null) return Collections.unmodifiableList(ca.getCauses()); return Collections.emptyList(); }
@Override public void foldIntoExisting(Queue.Item item, Queue.Task owner, List<Action> otherActions) { // there may be >1 upstream builds (or other unrelated causes) for a single downstream build BuildTriggerAction existing = item.getAction(BuildTriggerAction.class); if (existing == null) { item.addAction(this); } else { synchronized (existing.triggers) { existing.triggers.addAll(triggers); } } LOGGER.log(Level.FINE, "coalescing actions for {0}", item); }
/** * Convenience method that returns a read only view of the {@link Cause}s associated with this item in the queue. * * @return can be empty but never null * @since 1.343 */ public final List<Cause> getCauses() { CauseAction ca = getAction(CauseAction.class); if (ca!=null) return Collections.unmodifiableList(ca.getCauses()); return Collections.emptyList(); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing!=null) { existing.addCauses(getCauses()); return; } // no CauseAction found, so add a copy of this one item.addAction(new CauseAction(this)); }