Skip to content

Commit

Permalink
[ui] Filter out runs
Browse files Browse the repository at this point in the history
(cherry picked from commit 4003526)
  • Loading branch information
hellendag authored and jmsanders committed Aug 1, 2024
1 parent 8572ea9 commit 5beafe5
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@ export const useRunsForTimeline = ({
if (run.startTime === null) {
return;
}

// If the run has ended prior to the start of the range, discard it. This can occur
// because we are using "updated" time for filtering our runs, which is a value
// independent of start/end timestamps.
if (run.endTime && run.endTime * 1000 < start) {
return;
}
if (!run.repositoryOrigin) {
return;
}
Expand Down Expand Up @@ -368,7 +375,7 @@ export const useRunsForTimeline = ({
const current = {jobInfo, runsByJobKey: map};
previousRunsByJobKey.current = current;
return current;
}, [loading, ongoingRunsData, completedRuns]);
}, [loading, ongoingRunsData, completedRuns, start]);

const jobsWithCompletedRunsAndOngoingRuns = useMemo(() => {
const jobs: Record<string, TimelineJob> = {};
Expand Down

0 comments on commit 5beafe5

Please sign in to comment.