? Messages.AbstractProject_WorkspaceOffline() : Messages.AbstractProject_NoWorkspace()); if (isInQueue()) { listener.getLogger().println(Messages.AbstractProject_AwaitingBuildForWorkspace()); return NO_CHANGES;
if (lb==null) { listener.getLogger().println(Messages.AbstractProject_NoBuilds()); return isInQueue() ? NO_CHANGES : BUILD_NOW;
@Override protected CharSequence getMessageForJob(AbstractProject<?, ?> project) { StringBuilder msg = new StringBuilder(32); msg.append(project.getFullDisplayName()); if (project.isDisabled()) { msg.append("(disabled) "); // a project which is building and additionally in queue should be reported as building } else if (project.isBuilding()) { msg.append("(BUILDING: ").append(project.getLastBuild().getDurationString()).append(")"); } else if (project.isInQueue()) { msg.append("(in queue) "); } msg.append(": "); AbstractBuild<?, ?> lastBuild = project.getLastBuild(); while ((lastBuild != null) && lastBuild.isBuilding()) { lastBuild = lastBuild.getPreviousBuild(); } if (lastBuild != null) { msg.append("last build: ").append(lastBuild.getNumber()).append(" (") .append(lastBuild.getTimestampString()).append(" ago): ").append(lastBuild.getResult()).append(": ") .append(MessageHelper.getBuildURL(lastBuild)); } else { msg.append("no finished build yet"); } return msg; }
@Override protected CharSequence getMessageForJob(AbstractProject<?, ?> project) { StringBuilder msg = new StringBuilder(32); msg.append(project.getFullDisplayName()); if (project.isDisabled()) { msg.append("(disabled) "); // a project which is building and additionally in queue should be reported as building } else if (project.isBuilding()) { msg.append("(BUILDING: ").append(project.getLastBuild().getDurationString()).append(")"); } else if (project.isInQueue()) { msg.append("(in queue) "); } msg.append(": "); AbstractBuild<?, ?> lastBuild = project.getLastBuild(); while ((lastBuild != null) && lastBuild.isBuilding()) { lastBuild = lastBuild.getPreviousBuild(); } if (lastBuild != null) { msg.append("last build: ").append(lastBuild.getNumber()).append(" (") .append(lastBuild.getTimestampString()).append(" ago): ").append(lastBuild.getResult()).append(": ") .append(MessageHelper.getBuildURL(lastBuild)); } else { msg.append("no finished build yet"); } return msg; }
} else if (project.isBuilding()) { msg.append("(BUILDING: ").append(project.getLastBuild().getDurationString()).append(")"); } else if (project.isInQueue()) { msg.append("(in queue)");
} else if (project.isBuilding()) { msg.append("(BUILDING: ").append(project.getLastBuild().getDurationString()).append(")"); } else if (project.isInQueue()) { msg.append("(in queue)");
/** * Determines whether any of the upstream project are either * building or in the queue. * * This means eventually there will be an automatic triggering of * the given project (provided that all builds went smoothly.) * * @param downstreamProject * The AbstractProject we want to build. * @param excludeProject * An AbstractProject to exclude - if we see this in the transitive * dependencies, we're not going to bother checking to see if it's * building. For example, pass the current parent project to be sure * that it will be ignored when looking for building dependencies. * @return * True if any upstream projects are building or in queue, false otherwise. */ private boolean areUpstreamsBuilding(AbstractProject downstreamProject, AbstractProject excludeProject) { DependencyGraph graph = Hudson.getInstance().getDependencyGraph(); Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject); for (AbstractProject tup : tups) { if(tup!=excludeProject && (tup.isBuilding() || tup.isInQueue())) return true; } return false; } }
/** * Determines whether any of the upstream project are either * building or in the queue. * * This means eventually there will be an automatic triggering of * the given project (provided that all builds went smoothly.) * * @param downstreamProject * The AbstractProject we want to build. * @param excludeProject * An AbstractProject to exclude - if we see this in the transitive * dependencies, we're not going to bother checking to see if it's * building. For example, pass the current parent project to be sure * that it will be ignored when looking for building dependencies. * @return * True if any upstream projects are building or in queue, false otherwise. */ private boolean areUpstreamsBuilding(AbstractProject<?,?> downstreamProject, AbstractProject<?,?> excludeProject) { DependencyGraph graph = Hudson.getInstance().getDependencyGraph(); Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject); for (AbstractProject tup : tups) { if(tup!=excludeProject && (tup.isBuilding() || tup.isInQueue())) return true; } return false; }
/** * Determines whether any of the upstream project are either * building or in the queue. * * This means eventually there will be an automatic triggering of * the given project (provided that all builds went smoothly.) * * @param downstreamProject * The AbstractProject we want to build. * @param excludeProject * An AbstractProject to exclude - if we see this in the transitive * dependencies, we're not going to bother checking to see if it's * building. For example, pass the current parent project to be sure * that it will be ignored when looking for building dependencies. * @return * True if any upstream projects are building or in queue, false otherwise. */ private boolean areUpstreamsBuilding(AbstractProject downstreamProject, AbstractProject excludeProject) { DependencyGraph graph = Hudson.getInstance().getDependencyGraph(); Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject); for (AbstractProject tup : tups) { if(tup!=excludeProject && (tup.isBuilding() || tup.isInQueue())) return true; } return false; } }
/** * Determines whether any of the upstream project are either * building or in the queue. * * This means eventually there will be an automatic triggering of * the given project (provided that all builds went smoothly.) * * @param downstreamProject * The AbstractProject we want to build. * @param excludeProject * An AbstractProject to exclude - if we see this in the transitive * dependencies, we're not going to bother checking to see if it's * building. For example, pass the current parent project to be sure * that it will be ignored when looking for building dependencies. * @return * True if any upstream projects are building or in queue, false otherwise. */ private boolean areUpstreamsBuilding(AbstractProject downstreamProject, AbstractProject excludeProject) { DependencyGraph graph = Hudson.getInstance().getDependencyGraph(); Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject); for (AbstractProject tup : tups) { if(tup!=excludeProject && (tup.isBuilding() || tup.isInQueue())) return true; } return false; } }
Set<AbstractProject> tups = graph.getTransitiveUpstream(downstreamProject); for (AbstractProject tup : tups) { if (tup != excludeProject && (tup.isBuilding() || tup.isInQueue())) { AbstractProject<?,?> tupr = tup.getRootProject(); if (tupr instanceof MavenModuleSet && ((MavenModuleSet) tupr).getBlockTriggerWhenBuilding()) {
? Messages.AbstractProject_WorkspaceOffline() : Messages.AbstractProject_NoWorkspace()); if (isInQueue()) { listener.getLogger().println(Messages.AbstractProject_AwaitingBuildForWorkspace()); return NO_CHANGES;
Component component) throws PipelineException { List<Pipeline> result = new ArrayList<>(); if (firstProject.isInQueue()) { String pipeLineTimestamp = TimestampFormat.formatTimestamp(firstProject.getQueueItem().getInQueueSince()); List<Stage> pipelineStages = new ArrayList<>();
@Override public CauseOfBlockage getCauseOfBlockage() { CauseOfBlockage cob = super.getCauseOfBlockage(); if (cob != null) return cob; if (!getParent().isAggregatorStyleBuild()) { DependencyGraph graph = Hudson.getInstance().getDependencyGraph(); for (AbstractProject tup : graph.getTransitiveUpstream(this)) { if(getParent() == tup.getParent() && (tup.isBuilding() || tup.isInQueue())) return new BecauseOfUpstreamModuleBuildInProgress(tup); } } return null; }
public static boolean isQueued(AbstractProject project, AbstractBuild firstBuild) { if (!project.isInQueue()) { return false; } else if (firstBuild == null) { return true; } List<Cause.UpstreamCause> causes = Util.filter(project.getQueueItem().getCauses(), Cause.UpstreamCause.class); @SuppressWarnings("unchecked") List<AbstractProject<?,?>> upstreamProjects = project.getUpstreamProjects(); for (AbstractProject<?, ?> upstreamProject : upstreamProjects) { AbstractBuild upstreamBuild = BuildUtil.match(upstreamProject.getBuilds(), firstBuild); if (upstreamBuild != null) { for (Cause.UpstreamCause upstreamCause : causes) { if (upstreamBuild.getNumber() == upstreamCause.getUpstreamBuild() && upstreamProject.getRelativeNameFrom(JenkinsUtil.getInstance()).equals( upstreamCause.getUpstreamProject())) { return true; } } } } return false; }
@Override protected CharSequence getMessageForJob(AbstractProject<?, ?> project, Sender sender, String[] args) throws CommandException { if ( (project.isInQueue() == false) && (project.isBuilding() == false) ) { throw new CommandException( sender + ": how do you intend to abort a build that isn't building?"); if (project.isInQueue()) { aborted = Hudson.getInstance().getQueue().cancel(project);
@Override public CauseOfBlockage getCauseOfBlockage() { CauseOfBlockage cob = super.getCauseOfBlockage(); if (cob != null) return cob; if (!getParent().isAggregatorStyleBuild()) { DependencyGraph graph = Hudson.getInstance().getDependencyGraph(); for (AbstractProject tup : graph.getTransitiveUpstream(this)) { if(getParent() == tup.getParent() && (tup.isBuilding() || tup.isInQueue())) return new BecauseOfUpstreamModuleBuildInProgress(tup); } } return null; }
@Override public CauseOfBlockage getCauseOfBlockage() { CauseOfBlockage cob = super.getCauseOfBlockage(); if (cob != null) return cob; if (!getParent().isAggregatorStyleBuild()) { DependencyGraph graph = Hudson.getInstance().getDependencyGraph(); for (AbstractProject tup : graph.getTransitiveUpstream(this)) { if(getParent() == tup.getParent() && (tup.isBuilding() || tup.isInQueue())) return new BecauseOfUpstreamModuleBuildInProgress(tup); } } return null; }
@Override protected CharSequence getMessageForJob(AbstractProject<?, ?> project, Sender sender, String[] args) throws CommandException { if ( (project.isInQueue() == false) && (project.isBuilding() == false) ) { throw new CommandException( sender + ": how do you intend to abort a build that isn't building?"); if (project.isInQueue()) { aborted = Hudson.getInstance().getQueue().cancel(project);
target.setConfigurable(source.isConfigurable()); target.setConcurrent(source.isConcurrentBuild()); target.setQueued(source.isInQueue());