Skip to content

Commit

Permalink
small cleaning of typos
Browse files Browse the repository at this point in the history
  • Loading branch information
thatportugueseguy committed Dec 16, 2024
1 parent 9cc9923 commit 90f21e6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/action.ml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
| false ->
let _, previous_build = StringMap.max_binding previous_builds in
previous_build.status = n.state)
| _ ->
| None ->
(* if we don't have any builds for this branch yet, it's the first notification for this pipeline *)
false
in
Expand Down
8 changes: 5 additions & 3 deletions lib/state.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ let set_repo_state { state } repo_url repo_state = Stringtbl.replace state.repos
let find_or_add_repo { state } repo_url = find_or_add_repo' state repo_url

(** Updates the builds map in the branches statuses.
[default_builds_map] is the builds map to use if we don't have the current branch in the branches statuses.
[f] is the function to use to update the builds map. Takes the [State_t.build_status] Map for the current branch as argument.
[branches_statuses] is the branches statuses Map to update. Returns the updated branches statuses Map. *)
[default_builds_map] (optional, defaults to an empty map) is the builds map to use if we don't have the current
branch in the branches statuses.
[f] is the function to use to update the builds map. Takes the [State_t.build_status] Map for the current branch
as argument.
[branches_statuses] is the branches statuses Map to update. Returns the updated branches statuses Map. *)
let update_builds_in_branches ~branches ?(default_builds_map = StringMap.empty) ~f branches_statuses =
let current_statuses = Option.default StringMap.empty branches_statuses in
let updated_statuses =
Expand Down
2 changes: 1 addition & 1 deletion lib/util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module Build = struct
Error
(Printf.sprintf "failed to get pipeline name from notification. Context: %s, Build URL: %s" context build_url)
in
(* if we have a buildkit pipeline, we need to strip the `buildkite/` prefix to get the real name *)
(* if we have a buildkite pipeline, we need to strip the `buildkite/` prefix to get the real name *)
let context' = Stre.drop_prefix context "buildkite/" in
let pipeline_name = get_name context' build_url in
Result.map (fun pipeline_name -> { is_pipeline_step = pipeline_name <> context'; pipeline_name }) pipeline_name
Expand Down
4 changes: 2 additions & 2 deletions mock_states/status.commit1-02-failed_diff_pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"qa": {
"author/patches/js-storage": {
"181732": {
"status": "pending",
"status": "failure",
"build_number": "181732",
"build_url": "https://buildkite.com/ahrefs/qa/builds/181732",
"commit": {
"sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b",
"author": "[email protected]",
"commit_message": "c1 message"
},
"is_finished": false,
"is_finished": true,
"failed_steps": [
{
"name": "qa/failed-step",
Expand Down

0 comments on commit 90f21e6

Please sign in to comment.