Skip to content

Commit

Permalink
#10718: Filter out jobs with a start time lower than the pipeline sta…
Browse files Browse the repository at this point in the history
…rt time because that means that it's a re-run and we need to account for already-passing jobs
  • Loading branch information
tt-rkim committed Aug 28, 2024
1 parent 5b71ae6 commit fca0e85
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion infra/data_collection/github/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ def get_pipeline_row_from_github_info(github_runner_environment, github_pipeline

jobs = github_jobs_json["jobs"]
jobs_start_times = list(map(lambda job_: get_datetime_from_github_datetime(job_["started_at"]), jobs))
sorted_jobs_start_times = sorted(jobs_start_times)
eligible_jobs_start_times = list(
filter(
lambda job_start_time_: job_start_time_ >= get_datetime_from_github_datetime(pipeline_submission_ts),
jobs_start_times,
)
)
sorted_jobs_start_times = sorted(eligible_jobs_start_times)
assert (
sorted_jobs_start_times
), f"It seems that this pipeline does not have any jobs that started on or after the pipeline was submitted, which should be impossible. Please directly inspect the JSON objects"
pipeline_start_ts = get_data_pipeline_datetime_from_datetime(sorted_jobs_start_times[0])

pipeline_end_ts = github_pipeline_json["updated_at"]
Expand Down

0 comments on commit fca0e85

Please sign in to comment.