Class AutoBuildsListener
- All Implemented Interfaces:
SinglePipelineListener
Challenges to keep in mind:
- order of the events: we shouldn't send IN_PROGRESS event if the final result has already been sent
- uncertainty about issue keys: they appear at some point during the execution of the pipeline and might not be in place at the moment we need them.
-
Constructor Summary
ConstructorDescriptionAutoBuildsListener
(org.jenkinsci.plugins.workflow.job.WorkflowRun run, PipelineLogger logger, String autoBuildsRegex, IssueKeyExtractor issueKeyExtractor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
onNewHead
(org.jenkinsci.plugins.workflow.graph.FlowNode flowNode) There are 2 cases: with regex and without.
-
Constructor Details
-
AutoBuildsListener
public AutoBuildsListener(org.jenkinsci.plugins.workflow.job.WorkflowRun run, PipelineLogger logger, String autoBuildsRegex, IssueKeyExtractor issueKeyExtractor)
-
-
Method Details
-
getBuildUrl
- Specified by:
getBuildUrl
in interfaceSinglePipelineListener
-
onCompleted
public void onCompleted()- Specified by:
onCompleted
in interfaceSinglePipelineListener
-
onNewHead
public void onNewHead(org.jenkinsci.plugins.workflow.graph.FlowNode flowNode) There are 2 cases: with regex and without.Without regex: we are waiting for the first event with issue keys determined to send IN_PROGRESS update to Jira, then we sent the final update with WorkflowRun::result in onComplete().
With regex: we are waiting for a StartNode with a display name that matches regex to determine the moment since which we can send "IN_PROGRESS" update to Jira, then we are waiting when the closing EndNode comes, then we wait when it's BallIcon status stops flickering and then we send the update.
- Specified by:
onNewHead
in interfaceSinglePipelineListener
-