Skip to content

Commit

Permalink
[JENKINS-38632] Solve doclint errors
Browse files Browse the repository at this point in the history
Some warnings also solved
  • Loading branch information
raul-arabaolaza committed Sep 30, 2016
1 parent 26547af commit d6f043d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
Expand Up @@ -36,7 +36,7 @@ public enum GenericStatus {
NOT_EXECUTED,

/**
* Completed & successful, ex {@link Result#SUCCESS}
* Completed & successful, ex {@link Result#SUCCESS}
*/
SUCCESS,

Expand Down
Expand Up @@ -62,26 +62,26 @@
/**
* Provides common, comprehensive set of APIs for doing status and timing computations on pieces of a pipeline execution.
*
* <p/> <strong>Concepts:</strong> a chunk, which is a set of {@link FlowNode}s in the same {@link FlowExecution} with a first and last node.
* <p/> Chunks exist in a context: the FlowNode before and the FlowNode after. These follow common-sense rules:
* <p> <strong>Concepts:</strong> a chunk, which is a set of {@link FlowNode}s in the same {@link FlowExecution} with a first and last node. </p>
* <p> Chunks exist in a context: the FlowNode before and the FlowNode after. These follow common-sense rules: </p>
* <ol>
* <li>If a chunk has a null before node, then its first node must be the {@link FlowStartNode} for that execution</li>
* <li>If a chunk has a null after node, then its last node must be the {@link FlowEndNode} for that execution</li>
* <li>Both may be true at once (then the chunk contains the entire execution)</li>
* <li>First nodes must always occur before last nodes</li>
* <li>Where a {@link WorkflowRun} is a parameter, it and the FlowNodes must all belong to the same execution</li>
* </ol>
* <p/> <strong>Parallel branch handling:</strong>
* <p> <strong>Parallel branch handling:</strong> </p>
* <ol>
* <ul>Each branch is considered independent</ul>
* <ul>Branches may succeed, fail, or be in-progress/waiting for input.</ul>
* <li>Each branch is considered independent</li>
* <li>Branches may succeed, fail, or be in-progress/waiting for input.</li>
* </ol>
* @author Sam Van Oort
*/
public class StatusAndTiming {

/**
* Check that all the flownodes & run describe the same pipeline run/execution
* Check that all the flownodes &amp; run describe the same pipeline run/execution
* @param run Run that nodes must belong to
* @param nodes Nodes to match to run
* @throws IllegalArgumentException For the first flownode that doesn't belong to the FlowExectuon of run
Expand All @@ -100,7 +100,11 @@ public static void verifySameRun(@Nonnull WorkflowRun run, @CheckForNull FlowNod
}
}

/** Return true if the run is paused on input */
/**
* Return true if the run is paused on input
* @param run
* @return
*/
public static boolean isPendingInput(WorkflowRun run) {
// Logic borrowed from Pipeline Stage View plugin, RuneEx
InputAction inputAction = run.getAction(InputAction.class);
Expand All @@ -113,7 +117,12 @@ public static boolean isPendingInput(WorkflowRun run) {
return false;
}

/** Return status or null if not executed all (null FlowExecution) */
/**
* Return status or null if not executed all (null FlowExecution)
* @param run
* @param chunk
* @return Status or null if not executed all (null FlowExecution)
*/
@CheckForNull
public static GenericStatus computeChunkStatus(@Nonnull WorkflowRun run, @Nonnull MemoryFlowChunk chunk) {
FlowExecution exec = run.getExecution();
Expand All @@ -130,8 +139,8 @@ public static GenericStatus computeChunkStatus(@Nonnull WorkflowRun run, @Nonnul

/**
* Compute the overall status for a chunk comprising firstNode through lastNode, inclusive
* <p/> All nodes must be in the same execution
* <p/> Note: for in-progress builds with parallel branches, if the branch is done, it has its own status.
* <p> All nodes must be in the same execution </p>
* <p> Note: for in-progress builds with parallel branches, if the branch is done, it has its own status. </p>
* @param run Run that nodes belong to
* @param before Node before the first node in this piece
* @param firstNode First node of this piece
Expand Down Expand Up @@ -194,8 +203,8 @@ public static TimingInfo computeChunkTiming(@Nonnull WorkflowRun run, long inter

/**
* Compute timing for a chunk of nodes
* <p/> Note: for in-progress builds with parallel branches, the running branches end at the current time.
* Completed branches use the time at which the {@link BlockEndNode} terminating the branch was created.
* <p> Note: for in-progress builds with parallel branches, the running branches end at the current time.
* Completed branches use the time at which the {@link BlockEndNode} terminating the branch was created. </p>
* @param run WorkflowRun they all belong to
* @param internalPauseDuration Millis paused in the chunk (including the ends)
* @param firstNode First node in the chunk
Expand Down Expand Up @@ -323,8 +332,8 @@ public static Map<String, GenericStatus> computeBranchStatuses(@Nonnull Workflow

/**
* Compute status codes for a set of parallel branches.
* <p/>Note per {@link #computeChunkStatus(WorkflowRun, MemoryFlowChunk)} for in-progress builds with
* parallel branches, if the branch is done, it has its own status.
* <p> Note per {@link #computeChunkStatus(WorkflowRun, MemoryFlowChunk)} for in-progress builds with
* parallel branches, if the branch is done, it has its own status. </p>
* @param run Run containing these nodes
* @param branchStarts The nodes starting off each parallel branch (BlockStartNode)
* @param branchEnds Last node in each parallel branch - might be the end of the branch, or might just be the latest step run
Expand Down Expand Up @@ -360,7 +369,9 @@ public static Map<String, GenericStatus> computeBranchStatuses(@Nonnull Workflow
return statusMappings;
}

/** Combines the status results from a list of parallel branches to report a single overall status
/**
* Combines the status results from a list of parallel branches to report a single overall status
* @param statuses
* @return Status, or null if none can be defined
*/
@CheckForNull
Expand All @@ -372,7 +383,12 @@ public static GenericStatus condenseStatus(@Nonnull Collection<GenericStatus> st
}


/** Helper, prints flow graph in some detail - now a common utility so others don't have to reinvent it */
/**
* Helper, prints flow graph in some detail - now a common utility so others don't have to reinvent it
* @param run
* @param showTiming
* @param showActions
*/
@Restricted(DoNotUse.class)
public static void printNodes(@Nonnull WorkflowRun run, boolean showTiming, boolean showActions) {
long runStartTime = run.getStartTimeInMillis();
Expand Down

0 comments on commit d6f043d

Please sign in to comment.