Skip to content

Commit

Permalink
update state handling of failing build
Browse files Browse the repository at this point in the history
  • Loading branch information
thatportugueseguy committed Dec 30, 2024
1 parent c7eea9e commit 8eb67f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/state.ml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,19 @@ let set_repo_pipeline_status { state } (n : Github_t.status_notification) =
{ current_build_status with status = n.state; is_finished; finished_at; failed_steps }
| None -> init_build_state
in
let update_failing_build_status builds_map build_number =
match IntMap.find_opt build_number builds_map with
| Some (current_build_status : State_t.build_status) -> { current_build_status with status = Failure }
| None -> init_build_state
in
let update_pipeline_status =
update_builds_in_branches ~branches:n.branches
~default_builds_map:(IntMap.singleton build_number init_build_state) ~f:(fun builds_map ->
let updated_status = update_build_status builds_map build_number in
let updated_status =
match Util.Build.is_failing_build n with
| true -> update_failing_build_status builds_map build_number
| _ -> update_build_status builds_map build_number
in
IntMap.add build_number updated_status builds_map)
in
let rm_successful_build =
Expand Down

0 comments on commit 8eb67f5

Please sign in to comment.