@Override public void run() { Queue.Item item = Queue.getInstance().getItem(task); if (item != null) { PrintStream logger; try { logger = listener.getLogger(); } catch (Exception x) { // IOException, InterruptedException LOGGER.log(WARNING, null, x); return; } logger.println("Still waiting to schedule task"); String why = item.getWhy(); if (why != null) { logger.println(why); } } } }, 15, TimeUnit.SECONDS);
@Override public void run() { Queue.Item item = Queue.getInstance().getItem(task); if (item != null) { PrintStream logger; try { logger = listener.getLogger(); } catch (Exception x) { // IOException, InterruptedException LOGGER.log(WARNING, null, x); return; } logger.println("Still waiting to schedule task"); String why = item.getWhy(); if (why != null) { logger.println(why); } } } }, 15, TimeUnit.SECONDS);
@Override public BuildCause.CommitInfo getCommit() { final String[] buildParams = StringUtils.split(this.item.getParams(), "\n"); String branch = ""; for (final String buildParam : buildParams) { if (buildParam.startsWith("BRANCH=")) { branch = StringUtils.split(buildParam, "=")[1]; } } return new BuildCause.CommitInfo("Queued: " + this.item.getWhy(), this.item.getInQueueForString(), branch); }
String why = qi.getWhy(); if (!why.equals(whyInQueue) && System.currentTimeMillis() - startTime > 5000) { listener.getLogger().println(c.getDisplayName() + " is still in the queue: " + why);
String why = qi.getWhy(); if (!why.equals(whyInQueue) && System.currentTimeMillis() - startTime > 5000) { listener.getLogger().println(c.getDisplayName() + " is still in the queue: " + why);
String why = qi.getWhy(); if(why != null && !why.equals(whyInQueue) && System.currentTimeMillis()-startTime>5000) {
String why = qi.getWhy(); if (!why.equals(whyInQueue) && System.currentTimeMillis() - startTime > 5000) { listener.getLogger().println(c.getDisplayName() + " is still in the queue: " + why);
@Override public String getStatus() { for (Queue.Item i : Queue.getInstance().getItems()) { for (BuildTriggerAction.Trigger trigger : BuildTriggerAction.triggersFor(i)) { if (trigger.context.equals(getContext())) { return "waiting to schedule " + i.task.getFullDisplayName() + "; blocked: " + i.getWhy(); } } } for (Computer c : Jenkins.getActiveInstance().getComputers()) { for (Executor e : c.getExecutors()) { String r = running(e); if (r != null) { return r; } } for (Executor e : c.getOneOffExecutors()) { String r = running(e); if (r != null) { return r; } } } // TODO QueueTaskFuture does not allow us to record the queue item ID return "unsure what happened to downstream build"; } private @CheckForNull String running(@Nonnull Executor e) {
public void executeCommand(Bot bot, IMChat chat, IMMessage message, Sender sender, String[] args) throws IMException { Queue queue = Hudson.getInstance().getQueue(); Item[] items = queue.getItems(); String reply; if (items.length > 0) { StringBuffer msg = new StringBuffer(); msg.append("Build queue:"); for (Item item : queue.getItems()) { msg.append("\n- ") .append(item.task.getFullDisplayName()) .append(": ").append(item.getWhy()); } reply = msg.toString(); } else { reply = "build queue is empty"; } chat.sendMessage(reply); }
@Override public String getStatus() { // Yet another copy of the same logic; perhaps this should be factored into some method returning a union of Queue.Item and PlaceholderExecutable? for (Queue.Item item : Queue.getInstance().getItems()) { if (item.task instanceof PlaceholderTask && ((PlaceholderTask) item.task).context.equals(getContext())) { return "waiting for " + item.task.getFullDisplayName() + " to be scheduled; blocked: " + item.getWhy(); } } Jenkins j = Jenkins.getInstance(); if (j != null) { COMPUTERS: for (Computer c : j.getComputers()) { for (Executor e : c.getExecutors()) { Queue.Executable exec = e.getCurrentExecutable(); if (exec instanceof PlaceholderTask.PlaceholderExecutable && ((PlaceholderTask.PlaceholderExecutable) exec).getParent().context.equals(getContext())) { return "running on " + c.getName(); } } } } return "node block appears to be neither running nor scheduled"; }
/** * Gets a tooltip from the item. * @return Tooltip or null if it cannot be retrieved. */ public @CheckForNull String getTooltip() { MatrixRun r = getRun(); if (r!=null) { return r.getIconColor().getDescription(); } final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { return null; } Queue.Item item = jenkins.getQueue().getItem(getParent().getItem(combination)); if(item!=null) return item.getWhy(); return null; // fall back } }
@Override public String getStatus() { // Yet another copy of the same logic; perhaps this should be factored into some method returning a union of Queue.Item and PlaceholderExecutable? for (Queue.Item item : Queue.getInstance().getItems()) { if (item.task instanceof PlaceholderTask && ((PlaceholderTask) item.task).context.equals(getContext())) { return "waiting for " + item.task.getFullDisplayName() + " to be scheduled; blocked: " + item.getWhy(); } } Jenkins j = Jenkins.getInstance(); if (j != null) { COMPUTERS: for (Computer c : j.getComputers()) { for (Executor e : c.getExecutors()) { Queue.Executable exec = e.getCurrentExecutable(); if (exec instanceof PlaceholderTask.PlaceholderExecutable && ((PlaceholderTask.PlaceholderExecutable) exec).getParent().context.equals(getContext())) { return "running on " + c.getName(); } } } } return "node block appears to be neither running nor scheduled"; }
public void executeCommand(Bot bot, IMChat chat, IMMessage message, Sender sender, String[] args) throws IMException { Queue queue = Hudson.getInstance().getQueue(); Item[] items = queue.getItems(); String reply; if (items.length > 0) { StringBuffer msg = new StringBuffer(); msg.append("Build queue:"); for (Item item : queue.getItems()) { msg.append("\n- ") .append(item.task.getFullDisplayName()) .append(": ").append(item.getWhy()); } reply = msg.toString(); } else { reply = "build queue is empty"; } chat.sendMessage(reply); }
@Override public String getStatus() { // Yet another copy of the same logic; perhaps this should be factored into some method returning a union of Queue.Item and PlaceholderExecutable? for (Queue.Item item : Queue.getInstance().getItems()) { if (item.task instanceof PlaceholderTask && ((PlaceholderTask) item.task).context.equals(getContext())) { return "waiting for " + item.task.getFullDisplayName() + " to be scheduled; blocked: " + item.getWhy(); } } Jenkins j = Jenkins.getInstance(); if (j != null) { COMPUTERS: for (Computer c : j.getComputers()) { for (Executor e : c.getExecutors()) { Queue.Executable exec = e.getCurrentExecutable(); if (exec instanceof PlaceholderTask.PlaceholderExecutable && ((PlaceholderTask.PlaceholderExecutable) exec).getParent().context.equals(getContext())) { return "running on " + c.getName(); } } } } return "node block appears to be neither running nor scheduled"; }
@Override public void run() { Queue.Item item = Queue.getInstance().getItem(task); if (item != null) { PrintStream logger; try { logger = getContext().get(TaskListener.class).getLogger(); } catch (Exception x) { // IOException, InterruptedException LOGGER.log(WARNING, null, x); return; } logger.println("Still waiting to schedule task"); String why = item.getWhy(); if (why != null) { logger.println(why); } } } }, 15, TimeUnit.SECONDS);
public String getTooltip() { MatrixRun r = getRun(); if (r != null) { return r.getIconColor().getDescription(); } Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination)); if (item != null) { return item.getWhy(); } return null; // fall back }
public String getTooltip() { MatrixRun r = getRun(); if (r != null) { return r.getIconColor().getDescription(); } Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination)); if (item != null) { return item.getWhy(); } return null; // fall back }
public String getTooltip() { MatrixRun r = getRun(); if (r != null) { return r.getIconColor().getDescription(); } Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination)); if (item != null) { return item.getWhy(); } return null; // fall back }
public String getTooltip() { MatrixRun r = getRun(); if (r != null) { return r.getIconColor().getDescription(); } Queue.Item item = Hudson.getInstance().getQueue().getItem(getParent().getItem(combination)); if (item != null) { return item.getWhy(); } return null; // fall back }
public String getTooltip() { final Build r = getRun(); if (r != null) { return r.getIconColor().getDescription(); } final Queue.Item item = Jenkins.getInstance().getQueue().getItem(this.dynamicBuild.getParent().getItem(this.combination)); if (item != null) { return item.getWhy(); } return null; // fall back } }