arjun4084346 commented on code in PR #3825:
URL: https://github.com/apache/gobblin/pull/3825#discussion_r1431941582


##########
gobblin-runtime/src/main/java/org/apache/gobblin/service/monitoring/JobStatusRetriever.java:
##########
@@ -108,6 +108,26 @@ public Iterator<JobStatus> 
getLatestJobStatusByFlowNameAndGroup(String flowName,
    * @return deserialize {@link State} into a {@link JobStatus}.
    */
   protected JobStatus getJobStatus(State jobState) {
+    JobStatus.JobStatusBuilder jobStatusBuilder = 
createJobStatusBuilderFromState(jobState);
+
+    String contextId = 
TroubleshooterUtils.getContextIdForJob(jobState.getProperties());
+
+    Supplier<List<Issue>> jobIssues = Suppliers.memoize(() -> {
+      List<Issue> issues;
+      try {
+        issues = issueRepository.getAll(contextId);
+      } catch (TroubleshooterException e) {
+        log.warn("Cannot retrieve job issues", e);
+        issues = Collections.emptyList();
+      }
+      return issues;
+    });
+
+    jobStatusBuilder.issues(jobIssues);
+    return jobStatusBuilder.build();
+  }
+
+  public static JobStatus.JobStatusBuilder 
createJobStatusBuilderFromState(State jobState) {

Review Comment:
   yes, from JobStatusEvent



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to