diff --git a/lib/action.ml b/lib/action.ml index 0abd74ea..ff9c27b9 100644 --- a/lib/action.ml +++ b/lib/action.ml @@ -56,7 +56,7 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct n.commits |> List.filter (fun c -> let skip = Github.is_merge_commit_to_ignore ~cfg ~branch c in - if skip then log#info "main branch merge, ignoring %s: %s" c.id (Util.first_line c.message); + if skip then log#info "main branch merge, ignoring %s: %s" c.id (first_line c.message); not skip) |> List.concat_map (fun commit -> let rules = List.filter (filter_by_branch ~distinct:commit.distinct) rules in @@ -141,16 +141,12 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct in if matched_channel_names = [] then default else matched_channel_names - let buildkite_is_failed_re = Re2.create_exn {|^Build #\d+ failed|} - let partition_status (ctx : Context.t) (n : status_notification) = let repo = n.repository in let cfg = Context.find_repo_config_exn ctx repo.url in let pipeline = n.context in let current_status = n.state in let rules = cfg.status_rules.rules in - let repo_state = State.find_or_add_repo ctx.state n.repository.url in - let action_on_match (branches : branch list) ~notify_channels ~notify_dm = let%lwt direct_message = if notify_dm then begin @@ -176,10 +172,9 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct match cfg.main_branch_name with | None -> Lwt.return default | Some main_branch_name -> + (* non-main branch build notifications go to default channel to reduce spam in topic channels *) match List.exists (fun ({ name } : branch) -> String.equal name main_branch_name) branches with - | false -> - (* non-main branch build notifications go to default channel to reduce spam in topic channels *) - Lwt.return default + | false -> Lwt.return default | true -> let sha = n.commit.sha in (match%lwt Github_api.get_api_commit ~ctx ~repo ~sha with @@ -188,36 +183,29 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct in Lwt.return (direct_message @ chans) in - let%lwt recipients = if Context.is_pipeline_allowed ctx repo.url ~pipeline then begin + let repo_state = State.find_or_add_repo ctx.state repo.url in match Rule.Status.match_rules ~rules n with | Some (Ignore, _, _) | None -> Lwt.return [] | Some (Allow, notify_channels, notify_dm) -> action_on_match n.branches ~notify_channels ~notify_dm | Some (Allow_once, notify_channels, notify_dm) -> - let full_build_failed = - n.state = Failure && Re2.matches buildkite_is_failed_re (Option.default "" n.description) + let branches = + match StringMap.find_opt pipeline repo_state.pipeline_statuses with + | Some branch_statuses -> + let has_same_status_as_prev (branch : branch) = + match StringMap.find_opt branch.name branch_statuses with + | Some { status; _ } when status = current_status -> true + | _ -> false + in + let branches = List.filter (Fun.negate has_same_status_as_prev) n.branches in + branches + | None -> n.branches + in + let notify_dm = + notify_dm && not (State.mem_repo_pipeline_commits ctx.state repo.url ~pipeline ~commit:n.sha) in - (* for failing states, if we only allow one notification, it must be the final one, not an intermediate one *) - (match n.state <> Failure || full_build_failed with - | false -> Lwt.return [] - | true -> - let branches = - match StringMap.find_opt pipeline repo_state.pipeline_statuses with - | Some branch_statuses -> - let has_same_status_as_prev (branch : branch) = - match StringMap.find_opt branch.name branch_statuses with - | Some { status; _ } when status = current_status -> true - | _ -> false - in - let branches = List.filter (Fun.negate has_same_status_as_prev) n.branches in - branches - | None -> n.branches - in - let notify_dm = - notify_dm && not (State.mem_repo_pipeline_commits ctx.state repo.url ~pipeline ~commit:n.sha) - in - action_on_match branches ~notify_channels ~notify_dm) + action_on_match branches ~notify_channels ~notify_dm end else Lwt.return [] in @@ -299,7 +287,7 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct Lwt.return notifs | Status n -> let%lwt channels = partition_status ctx n in - let notifs = List.map (generate_status_notification ctx cfg n) channels in + let notifs = List.map (generate_status_notification cfg n) channels in Lwt.return notifs let send_notifications (ctx : Context.t) notifications = diff --git a/lib/api_remote.ml b/lib/api_remote.ml index e6e8a0e4..5044e597 100644 --- a/lib/api_remote.ml +++ b/lib/api_remote.ml @@ -1,7 +1,6 @@ open Printf open Devkit open Common -open Util module Github : Api.Github = struct let commits_url ~(repo : Github_t.repository) ~sha = diff --git a/lib/common.ml b/lib/common.ml index 0367ad96..d7a916e1 100644 --- a/lib/common.ml +++ b/lib/common.ml @@ -40,3 +40,32 @@ module Re2 = struct let wrap s = create_exn s let unwrap = Re2.to_string end + +open Devkit + +let fmt_error ?exn fmt = + Printf.ksprintf + (fun s -> + match exn with + | Some exn -> Error (s ^ " : exn " ^ Exn.str exn) + | None -> Error s) + fmt + +let first_line s = + match String.split_on_char '\n' s with + | x :: _ -> x + | [] -> s + +let decode_string_pad s = Stre.rstrip ~chars:"= \n\r\t" s |> Base64.decode_exn ~pad:false + +let http_request ?headers ?body meth path = + let setup h = + Curl.set_followlocation h true; + Curl.set_maxredirs h 1 + in + match%lwt Web.http_request_lwt ~setup ~ua:"monorobot" ~verbose:true ?headers ?body meth path with + | `Ok s -> Lwt.return @@ Ok s + | `Error e -> Lwt.return @@ Error e + +let sign_string_sha256 ~key ~basestring = + Cstruct.of_string basestring |> Nocrypto.Hash.SHA256.hmac ~key:(Cstruct.of_string key) |> Hex.of_cstruct |> Hex.show diff --git a/lib/context.ml b/lib/context.ml index 3ccace9c..b242635c 100644 --- a/lib/context.ml +++ b/lib/context.ml @@ -79,11 +79,10 @@ let is_pipeline_allowed ctx repo_url ~pipeline = | None -> true | Some config -> match config.status_rules.allowed_pipelines with - | Some allowed_pipelines when not @@ List.mem pipeline allowed_pipelines -> false + | Some allowed_pipelines when not @@ List.exists (String.equal pipeline) allowed_pipelines -> false | _ -> true let refresh_secrets ctx = - let open Util in let path = ctx.secrets_filepath in match Config_j.secrets_of_string (Std.input_file path) with | exception exn -> fmt_error ~exn "failed to read secrets from file %s" path @@ -105,7 +104,7 @@ let refresh_state ctx = log#info "loading saved state from file %s" path; (* todo: extract state related parts to state.ml *) match State_j.state_of_string (Std.input_file path) with - | exception exn -> Util.fmt_error ~exn "failed to read state from file %s" path + | exception exn -> fmt_error ~exn "failed to read state from file %s" path | state -> Ok { ctx with state = { State.state } } end else Ok ctx diff --git a/lib/github.ml b/lib/github.ml index c40a69ce..fa67e33a 100644 --- a/lib/github.ml +++ b/lib/github.ml @@ -49,7 +49,7 @@ let is_merge_commit_to_ignore ~(cfg : Config_t.config) ~branch commit = Merge remote-tracking branch 'origin/develop' into feature_branch Merge remote-tracking branch 'origin/develop' (the default message pattern generated by GitHub "Update with merge commit" button) *) - let title = Util.first_line commit.message in + let title = Common.first_line commit.message in begin match Re2.find_submatches_exn merge_commit_re title with | [| Some _; Some incoming_branch; receiving_branch |] -> diff --git a/lib/slack.ml b/lib/slack.ml index 01856c6b..6e0d69c1 100644 --- a/lib/slack.ml +++ b/lib/slack.ml @@ -1,6 +1,5 @@ open Printf open Common -open Util open Mrkdwn open Github_j open Slack_j @@ -345,18 +344,15 @@ let generate_push_notification notification channel = let buildkite_description_re = Re2.create_exn {|^Build #(\d+)(.*)|} -let generate_status_notification (ctx : Context.t) (cfg : Config_t.config) (notification : status_notification) channel - = - let { commit; state; description; target_url; context = pipeline; repository; _ } = notification in +let generate_status_notification (cfg : Config_t.config) (notification : status_notification) channel = + let { commit; state; description; target_url; context; repository; _ } = notification in let ({ commit : inner_commit; sha; author; html_url; _ } : status_commit) = commit in let ({ message; _ } : inner_commit) = commit in - let repo_state = State.find_or_add_repo ctx.state repository.url in - let is_buildkite = String.starts_with pipeline ~prefix:"buildkite" in - let color_info = if state = Success then "good" else "danger" in - let new_failed_steps = Build.new_failed_steps notification repo_state pipeline in - let old_failed_steps = - Build.all_failed_steps notification repo_state pipeline - |> List.filter (fun (s, _) -> not @@ List.mem_assoc s new_failed_steps) + let is_buildkite = String.starts_with context ~prefix:"buildkite" in + let color_info = + match state with + | Success -> "good" + | _ -> "danger" in let description_info = match description with @@ -370,25 +366,11 @@ let generate_status_notification (ctx : Context.t) (cfg : Config_t.config) (noti (* Specific to buildkite *) match Re2.find_submatches_exn buildkite_description_re s with | [| Some _; Some build_nr; Some rest |] -> - let fail_info = - match old_failed_steps, new_failed_steps with - | [], _ -> - (* if we don't any have failed steps, or we only have new failed steps - we just print the msg from the status notification. *) - "" - | _ :: _, [] -> - "\n\ - These failing steps are from a previous commmit. Please merge the latest develop or contact the author." - | _ :: _, _ :: _ -> - "\nSome of the steps were broken in previous commit(s), but this commit also broke some step(s)." - in - (* We use a zero-width space \u{200B} to prevent slack from interpreting #XXXXXX as a color *) - sprintf "Build <%s|#\u{200B}%s>%s.%s" target_url build_nr rest fail_info - | _ | (exception _) -> - (* we either match on the first case or get an exception *) - s + (* We use a zero-with space \u{200B} to prevent slack from interpreting #XXXXXX as a color *) + sprintf "Build <%s|#\u{200B}%s>%s" target_url build_nr rest + | _ -> s in - Some (sprintf "*Description*: %s" text) + Some (sprintf "*Description*: %s." text) in let commit_info = [ @@ -413,17 +395,6 @@ let generate_status_notification (ctx : Context.t) (cfg : Config_t.config) (noti in [ sprintf "*%s*: %s" (pluralize ~suf:"es" ~len:(List.length branches) "Branch") (String.concat ", " branches) ] in - let failed_steps_info = - let open Util.Slack in - let to_steps m ss = - match ss with - | [] -> [] - | _ -> [ sprintf "*%s*: %s" m (String.concat ", " (List.map (slack_step_link notification.context) ss)) ] - in - let old_failed_steps' = to_steps "Failing steps" old_failed_steps in - let new_failed_steps' = to_steps "New steps broken" new_failed_steps in - old_failed_steps' @ new_failed_steps' - in let summary = let state_info = match state with @@ -441,7 +412,7 @@ let generate_status_notification (ctx : Context.t) (cfg : Config_t.config) (noti | Some target_url -> let default_summary = sprintf "<%s|[%s]> CI Build Status notification for <%s|%s>: %s" repository.url repository.full_name target_url - pipeline state_info + context state_info in if not is_buildkite then default_summary else ( @@ -454,9 +425,9 @@ let generate_status_notification (ctx : Context.t) (cfg : Config_t.config) (noti in match pipeline_url with | None -> default_summary - | Some pipeline_url -> sprintf "<%s|[%s]>: Build %s for \"%s\"" pipeline_url pipeline state_info commit_message) + | Some pipeline_url -> sprintf "<%s|[%s]>: Build %s for \"%s\"" pipeline_url context state_info commit_message) in - let msg = String.concat "\n" @@ List.concat [ commit_info; branches_info; failed_steps_info ] in + let msg = String.concat "\n" @@ List.concat [ commit_info; branches_info ] in let attachment = { empty_attachments with @@ -501,5 +472,5 @@ let validate_signature ?(version = "v0") ?signing_key ~headers body = | None -> Error "unable to find header X-Slack-Request-Timestamp" | Some timestamp -> let basestring = Printf.sprintf "%s:%s:%s" version timestamp body in - let expected_signature = Printf.sprintf "%s=%s" version (Util.sign_string_sha256 ~key ~basestring) in + let expected_signature = Printf.sprintf "%s=%s" version (Common.sign_string_sha256 ~key ~basestring) in if String.equal expected_signature signature then Ok () else Error "signatures don't match" diff --git a/lib/state.atd b/lib/state.atd index da7ae262..d42e6da8 100644 --- a/lib/state.atd +++ b/lib/state.atd @@ -11,7 +11,6 @@ type ci_commit = { sha: string; author: string; commit_message: string; - url: string; build_link: string option; last_updated: string; } diff --git a/lib/state.ml b/lib/state.ml index f427ae47..af2427f9 100644 --- a/lib/state.ml +++ b/lib/state.ml @@ -34,7 +34,6 @@ let set_repo_pipeline_status { state } repo_url ~pipeline (notification : Github State_t.sha = notification.sha; author = notification.commit.commit.author.email; commit_message = notification.commit.commit.message; - url = notification.commit.html_url; last_updated = notification.updated_at; build_link = notification.target_url; } @@ -144,4 +143,4 @@ let save { state; _ } path = try Files.save_as path (fun oc -> output_string oc data); Ok () - with exn -> Util.fmt_error ~exn "failed to save state to file %s" path + with exn -> fmt_error ~exn "failed to save state to file %s" path diff --git a/lib/util.ml b/lib/util.ml deleted file mode 100644 index 972f3bad..00000000 --- a/lib/util.ml +++ /dev/null @@ -1,83 +0,0 @@ -open Devkit - -module StringMap = Common.StringMap - -let fmt_error ?exn fmt = - Printf.ksprintf - (fun s -> - match exn with - | Some exn -> Error (s ^ " : exn " ^ Exn.str exn) - | None -> Error s) - fmt - -let first_line s = - match String.split_on_char '\n' s with - | x :: _ -> x - | [] -> s - -let decode_string_pad s = Stre.rstrip ~chars:"= \n\r\t" s |> Base64.decode_exn ~pad:false - -let http_request ?headers ?body meth path = - let setup h = - Curl.set_followlocation h true; - Curl.set_maxredirs h 1 - in - match%lwt Web.http_request_lwt ~setup ~ua:"monorobot" ~verbose:true ?headers ?body meth path with - | `Ok s -> Lwt.return @@ Ok s - | `Error e -> Lwt.return @@ Error e - -let sign_string_sha256 ~key ~basestring = - Cstruct.of_string basestring |> Nocrypto.Hash.SHA256.hmac ~key:(Cstruct.of_string key) |> Hex.of_cstruct |> Hex.show - -module Build = struct - let new_failed_steps (n : Github_t.status_notification) (repo_state : State_t.repo_state) pipeline = - let to_failed_steps branch step statuses acc = - (* check if step of an allowed pipeline *) - match step with - | step when step = pipeline -> acc - | step when not @@ Devkit.Stre.starts_with step pipeline -> acc - | _ -> - match StringMap.find_opt branch statuses with - | Some (s : State_t.build_status) when s.status = Failure -> - (match s.current_failed_commit, s.original_failed_commit with - | Some _, _ -> - (* if we have a value for current_failed_commit, this step was already failed and notified *) - acc - | None, Some { build_link = Some build_link; sha; url; _ } when sha = n.commit.sha -> - (* we need to check the value of the commit sha to avoid false positives *) - (step, (build_link, url)) :: acc - | _ -> acc) - | _ -> acc - in - match n.state = Failure, n.branches with - | false, _ -> [] - | true, [ branch ] -> StringMap.fold (to_failed_steps branch.name) repo_state.pipeline_statuses [] - | true, _ -> [] - - let all_failed_steps (n : Github_t.status_notification) (repo_state : State_t.repo_state) pipeline = - try - (* notification.branches should always have _at least_ (and at most) one element, - but we wrap this block in a try/with to make sure we don't raise from List.hd *) - let branch = List.hd n.branches in - StringMap.fold - (fun step statuses acc -> - (* check if step of an allowed pipeline *) - match step with - | step when step = pipeline -> acc - | step when not @@ Devkit.Stre.starts_with step pipeline -> acc - | _ -> - match StringMap.find_opt branch.name statuses with - | Some (s : State_t.build_status) when s.status = Failure -> - (match s.original_failed_commit with - | Some { build_link = Some build_link; url; _ } -> (step, (build_link, url)) :: acc - | _ -> acc) - | _ -> acc) - repo_state.pipeline_statuses [] - with _e -> [] -end - -module Slack = struct - let slack_step_link pipeline (s, (l, url)) = - let step = Devkit.Stre.drop_prefix s (pipeline ^ "/") in - Printf.sprintf "<%s|%s> (<%s|gh>)" l step url -end diff --git a/mock_payloads/status.commit1-01-failing-extra.json b/mock_payloads/status.commit1-01-failing-extra.json deleted file mode 100644 index ea375736..00000000 --- a/mock_payloads/status.commit1-01-failing-extra.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "id": 17813250, - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "name": "ahrefs/monorepo", - "target_url": "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40", - "avatar_url": "https://github.com/avatars/oa/6?", - "context": "buildkite/pipeline2", - "description": "Build #181732 is failing", - "state": "failure", - "commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "node_id": "MDY6Q29tbWl0ODU6N2UwYTkzM2U5YzcxYjRjYTEwNzY4MGNhOTU4Y2ExODg4ZDVlNDc5Yg==", - "commit": { - "author": { - "name": "author", - "email": "author@ahrefs.com", - "date": "2024-05-31T03:54:00Z" - }, - "committer": { - "name": "author", - "email": "author@ahrefs.com", - "date": "2024-05-31T03:54:00Z" - }, - "message": "c1 message", - "tree": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/trees/51d7c2d0fc8f182f8ffad40ef79471789e6f5578" - }, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "comment_count": 0, - "verification": { - "verified": false, - "reason": "unsigned", - "signature": null, - "payload": null - } - }, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "html_url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "comments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b/comments", - "author": { - "login": "author", - "id": 92, - "node_id": "MDQ6VXNlcjky", - "avatar_url": "https://github.com/avatars/u/92?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/author", - "html_url": "https://github.com/author", - "followers_url": "https://github.com/api/v3/users/author/followers", - "following_url": "https://github.com/api/v3/users/author/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/author/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/author/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/author/subscriptions", - "organizations_url": "https://github.com/api/v3/users/author/orgs", - "repos_url": "https://github.com/api/v3/users/author/repos", - "events_url": "https://github.com/api/v3/users/author/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/author/received_events", - "type": "User", - "site_admin": false - }, - "committer": { - "login": "author", - "id": 92, - "node_id": "MDQ6VXNlcjky", - "avatar_url": "https://github.com/avatars/u/92?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/author", - "html_url": "https://github.com/author", - "followers_url": "https://github.com/api/v3/users/author/followers", - "following_url": "https://github.com/api/v3/users/author/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/author/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/author/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/author/subscriptions", - "organizations_url": "https://github.com/api/v3/users/author/orgs", - "repos_url": "https://github.com/api/v3/users/author/repos", - "events_url": "https://github.com/api/v3/users/author/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/author/received_events", - "type": "User", - "site_admin": false - }, - "parents": [ - { - "sha": "b2f115b1be68ab14975f0e581283a954bf67734a", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/b2f115b1be68ab14975f0e581283a954bf67734a", - "html_url": "https://github.com/ahrefs/monorepo/commit/b2f115b1be68ab14975f0e581283a954bf67734a" - }, - { - "sha": "53f8468ca5eafb0e0885b9d62806c52c872ea2af", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/53f8468ca5eafb0e0885b9d62806c52c872ea2af", - "html_url": "https://github.com/ahrefs/monorepo/commit/53f8468ca5eafb0e0885b9d62806c52c872ea2af" - } - ] - }, - "branches": [ - { - "name": "author/patches/js-storage", - "commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b" - }, - "protected": false - } - ], - "created_at": "2024-06-02T04:52:47+00:00", - "updated_at": "2024-06-02T04:52:47+00:00", - "repository": { - "id": 85, - "node_id": "MDEwOlJlcG9zaXRvcnk4NQ==", - "name": "monorepo", - "full_name": "ahrefs/monorepo", - "private": true, - "owner": { - "login": "ahrefs", - "id": 7, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc=", - "avatar_url": "https://github.com/avatars/u/7?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/ahrefs", - "html_url": "https://github.com/ahrefs", - "followers_url": "https://github.com/api/v3/users/ahrefs/followers", - "following_url": "https://github.com/api/v3/users/ahrefs/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/ahrefs/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/ahrefs/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/ahrefs/subscriptions", - "organizations_url": "https://github.com/api/v3/users/ahrefs/orgs", - "repos_url": "https://github.com/api/v3/users/ahrefs/repos", - "events_url": "https://github.com/api/v3/users/ahrefs/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/ahrefs/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/ahrefs/monorepo", - "description": "main repository", - "fork": false, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo", - "forks_url": "https://github.com/api/v3/repos/ahrefs/monorepo/forks", - "keys_url": "https://github.com/api/v3/repos/ahrefs/monorepo/keys{/key_id}", - "collaborators_url": "https://github.com/api/v3/repos/ahrefs/monorepo/collaborators{/collaborator}", - "teams_url": "https://github.com/api/v3/repos/ahrefs/monorepo/teams", - "hooks_url": "https://github.com/api/v3/repos/ahrefs/monorepo/hooks", - "issue_events_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues/events{/number}", - "events_url": "https://github.com/api/v3/repos/ahrefs/monorepo/events", - "assignees_url": "https://github.com/api/v3/repos/ahrefs/monorepo/assignees{/user}", - "branches_url": "https://github.com/api/v3/repos/ahrefs/monorepo/branches{/branch}", - "tags_url": "https://github.com/api/v3/repos/ahrefs/monorepo/tags", - "blobs_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/blobs{/sha}", - "git_tags_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/tags{/sha}", - "git_refs_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/refs{/sha}", - "trees_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/trees{/sha}", - "statuses_url": "https://github.com/api/v3/repos/ahrefs/monorepo/statuses/{sha}", - "languages_url": "https://github.com/api/v3/repos/ahrefs/monorepo/languages", - "stargazers_url": "https://github.com/api/v3/repos/ahrefs/monorepo/stargazers", - "contributors_url": "https://github.com/api/v3/repos/ahrefs/monorepo/contributors", - "subscribers_url": "https://github.com/api/v3/repos/ahrefs/monorepo/subscribers", - "subscription_url": "https://github.com/api/v3/repos/ahrefs/monorepo/subscription", - "commits_url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits{/sha}", - "git_commits_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/commits{/sha}", - "comments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/comments{/number}", - "issue_comment_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues/comments{/number}", - "contents_url": "https://github.com/api/v3/repos/ahrefs/monorepo/contents/{+path}", - "compare_url": "https://github.com/api/v3/repos/ahrefs/monorepo/compare/{base}...{head}", - "merges_url": "https://github.com/api/v3/repos/ahrefs/monorepo/merges", - "archive_url": "https://github.com/api/v3/repos/ahrefs/monorepo/{archive_format}{/ref}", - "downloads_url": "https://github.com/api/v3/repos/ahrefs/monorepo/downloads", - "issues_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues{/number}", - "pulls_url": "https://github.com/api/v3/repos/ahrefs/monorepo/pulls{/number}", - "milestones_url": "https://github.com/api/v3/repos/ahrefs/monorepo/milestones{/number}", - "notifications_url": "https://github.com/api/v3/repos/ahrefs/monorepo/notifications{?since,all,participating}", - "labels_url": "https://github.com/api/v3/repos/ahrefs/monorepo/labels{/name}", - "releases_url": "https://github.com/api/v3/repos/ahrefs/monorepo/releases{/id}", - "deployments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/deployments", - "created_at": "2017-03-06T23:40:04Z", - "updated_at": "2024-05-14T07:59:19Z", - "pushed_at": "2024-06-02T04:49:58Z", - "git_url": "git://github.com/ahrefs/monorepo.git", - "ssh_url": "git@github.com:ahrefs/monorepo.git", - "clone_url": "https://github.com/ahrefs/monorepo.git", - "svn_url": "https://github.com/ahrefs/monorepo", - "homepage": "https://ahrefs.com", - "size": 2927252, - "stargazers_count": 6, - "watchers_count": 6, - "language": "HTML", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "has_discussions": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 422, - "license": null, - "allow_forking": false, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [], - "visibility": "private", - "forks": 0, - "open_issues": 422, - "watchers": 6, - "default_branch": "develop" - }, - "organization": { - "login": "ahrefs", - "id": 7, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc=", - "url": "https://github.com/api/v3/orgs/ahrefs", - "repos_url": "https://github.com/api/v3/orgs/ahrefs/repos", - "events_url": "https://github.com/api/v3/orgs/ahrefs/events", - "hooks_url": "https://github.com/api/v3/orgs/ahrefs/hooks", - "issues_url": "https://github.com/api/v3/orgs/ahrefs/issues", - "members_url": "https://github.com/api/v3/orgs/ahrefs/members{/member}", - "public_members_url": "https://github.com/api/v3/orgs/ahrefs/public_members{/member}", - "avatar_url": "https://github.com/avatars/u/7?", - "description": null - }, - "enterprise": { - "id": 1, - "slug": "ahrefs-pte-ltd", - "name": "Ahrefs Pte Ltd", - "node_id": "MDEwOkVudGVycHJpc2Ux", - "avatar_url": "https://github.com/avatars/b/1?", - "description": null, - "website_url": null, - "html_url": "https://github.com/enterprises/ahrefs-pte-ltd", - "created_at": "2019-01-09T18:50:55Z", - "updated_at": "2024-03-18T14:38:02Z" - }, - "sender": { - "login": "ip", - "id": 3, - "node_id": "MDQ6VXNlcjM=", - "avatar_url": "https://github.com/avatars/u/3?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/ip", - "html_url": "https://github.com/ip", - "followers_url": "https://github.com/api/v3/users/ip/followers", - "following_url": "https://github.com/api/v3/users/ip/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/ip/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/ip/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/ip/subscriptions", - "organizations_url": "https://github.com/api/v3/users/ip/orgs", - "repos_url": "https://github.com/api/v3/users/ip/repos", - "events_url": "https://github.com/api/v3/users/ip/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/ip/received_events", - "type": "User", - "site_admin": true - } -} diff --git a/mock_payloads/status.commit1-01-failing-multiple.json b/mock_payloads/status.commit1-01-failing-multiple.json deleted file mode 100644 index b2e22aff..00000000 --- a/mock_payloads/status.commit1-01-failing-multiple.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "id": 17813250, - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "name": "ahrefs/monorepo", - "target_url": "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4", - "avatar_url": "https://github.com/avatars/oa/6?", - "context": "buildkite/pipeline2", - "description": "Build #181732 is failing", - "state": "failure", - "commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "node_id": "MDY6Q29tbWl0ODU6N2UwYTkzM2U5YzcxYjRjYTEwNzY4MGNhOTU4Y2ExODg4ZDVlNDc5Yg==", - "commit": { - "author": { - "name": "author", - "email": "author@ahrefs.com", - "date": "2024-05-31T03:54:00Z" - }, - "committer": { - "name": "author", - "email": "author@ahrefs.com", - "date": "2024-05-31T03:54:00Z" - }, - "message": "c1 message", - "tree": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/trees/51d7c2d0fc8f182f8ffad40ef79471789e6f5578" - }, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "comment_count": 0, - "verification": { - "verified": false, - "reason": "unsigned", - "signature": null, - "payload": null - } - }, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "html_url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "comments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b/comments", - "author": { - "login": "author", - "id": 92, - "node_id": "MDQ6VXNlcjky", - "avatar_url": "https://github.com/avatars/u/92?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/author", - "html_url": "https://github.com/author", - "followers_url": "https://github.com/api/v3/users/author/followers", - "following_url": "https://github.com/api/v3/users/author/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/author/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/author/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/author/subscriptions", - "organizations_url": "https://github.com/api/v3/users/author/orgs", - "repos_url": "https://github.com/api/v3/users/author/repos", - "events_url": "https://github.com/api/v3/users/author/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/author/received_events", - "type": "User", - "site_admin": false - }, - "committer": { - "login": "author", - "id": 92, - "node_id": "MDQ6VXNlcjky", - "avatar_url": "https://github.com/avatars/u/92?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/author", - "html_url": "https://github.com/author", - "followers_url": "https://github.com/api/v3/users/author/followers", - "following_url": "https://github.com/api/v3/users/author/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/author/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/author/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/author/subscriptions", - "organizations_url": "https://github.com/api/v3/users/author/orgs", - "repos_url": "https://github.com/api/v3/users/author/repos", - "events_url": "https://github.com/api/v3/users/author/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/author/received_events", - "type": "User", - "site_admin": false - }, - "parents": [ - { - "sha": "b2f115b1be68ab14975f0e581283a954bf67734a", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/b2f115b1be68ab14975f0e581283a954bf67734a", - "html_url": "https://github.com/ahrefs/monorepo/commit/b2f115b1be68ab14975f0e581283a954bf67734a" - }, - { - "sha": "53f8468ca5eafb0e0885b9d62806c52c872ea2af", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/53f8468ca5eafb0e0885b9d62806c52c872ea2af", - "html_url": "https://github.com/ahrefs/monorepo/commit/53f8468ca5eafb0e0885b9d62806c52c872ea2af" - } - ] - }, - "branches": [ - { - "name": "author/patches/js-storage", - "commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b" - }, - "protected": false - } - ], - "created_at": "2024-06-02T04:52:47+00:00", - "updated_at": "2024-06-02T04:52:47+00:00", - "repository": { - "id": 85, - "node_id": "MDEwOlJlcG9zaXRvcnk4NQ==", - "name": "monorepo", - "full_name": "ahrefs/monorepo", - "private": true, - "owner": { - "login": "ahrefs", - "id": 7, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc=", - "avatar_url": "https://github.com/avatars/u/7?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/ahrefs", - "html_url": "https://github.com/ahrefs", - "followers_url": "https://github.com/api/v3/users/ahrefs/followers", - "following_url": "https://github.com/api/v3/users/ahrefs/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/ahrefs/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/ahrefs/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/ahrefs/subscriptions", - "organizations_url": "https://github.com/api/v3/users/ahrefs/orgs", - "repos_url": "https://github.com/api/v3/users/ahrefs/repos", - "events_url": "https://github.com/api/v3/users/ahrefs/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/ahrefs/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/ahrefs/monorepo", - "description": "main repository", - "fork": false, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo", - "forks_url": "https://github.com/api/v3/repos/ahrefs/monorepo/forks", - "keys_url": "https://github.com/api/v3/repos/ahrefs/monorepo/keys{/key_id}", - "collaborators_url": "https://github.com/api/v3/repos/ahrefs/monorepo/collaborators{/collaborator}", - "teams_url": "https://github.com/api/v3/repos/ahrefs/monorepo/teams", - "hooks_url": "https://github.com/api/v3/repos/ahrefs/monorepo/hooks", - "issue_events_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues/events{/number}", - "events_url": "https://github.com/api/v3/repos/ahrefs/monorepo/events", - "assignees_url": "https://github.com/api/v3/repos/ahrefs/monorepo/assignees{/user}", - "branches_url": "https://github.com/api/v3/repos/ahrefs/monorepo/branches{/branch}", - "tags_url": "https://github.com/api/v3/repos/ahrefs/monorepo/tags", - "blobs_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/blobs{/sha}", - "git_tags_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/tags{/sha}", - "git_refs_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/refs{/sha}", - "trees_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/trees{/sha}", - "statuses_url": "https://github.com/api/v3/repos/ahrefs/monorepo/statuses/{sha}", - "languages_url": "https://github.com/api/v3/repos/ahrefs/monorepo/languages", - "stargazers_url": "https://github.com/api/v3/repos/ahrefs/monorepo/stargazers", - "contributors_url": "https://github.com/api/v3/repos/ahrefs/monorepo/contributors", - "subscribers_url": "https://github.com/api/v3/repos/ahrefs/monorepo/subscribers", - "subscription_url": "https://github.com/api/v3/repos/ahrefs/monorepo/subscription", - "commits_url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits{/sha}", - "git_commits_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/commits{/sha}", - "comments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/comments{/number}", - "issue_comment_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues/comments{/number}", - "contents_url": "https://github.com/api/v3/repos/ahrefs/monorepo/contents/{+path}", - "compare_url": "https://github.com/api/v3/repos/ahrefs/monorepo/compare/{base}...{head}", - "merges_url": "https://github.com/api/v3/repos/ahrefs/monorepo/merges", - "archive_url": "https://github.com/api/v3/repos/ahrefs/monorepo/{archive_format}{/ref}", - "downloads_url": "https://github.com/api/v3/repos/ahrefs/monorepo/downloads", - "issues_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues{/number}", - "pulls_url": "https://github.com/api/v3/repos/ahrefs/monorepo/pulls{/number}", - "milestones_url": "https://github.com/api/v3/repos/ahrefs/monorepo/milestones{/number}", - "notifications_url": "https://github.com/api/v3/repos/ahrefs/monorepo/notifications{?since,all,participating}", - "labels_url": "https://github.com/api/v3/repos/ahrefs/monorepo/labels{/name}", - "releases_url": "https://github.com/api/v3/repos/ahrefs/monorepo/releases{/id}", - "deployments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/deployments", - "created_at": "2017-03-06T23:40:04Z", - "updated_at": "2024-05-14T07:59:19Z", - "pushed_at": "2024-06-02T04:49:58Z", - "git_url": "git://github.com/ahrefs/monorepo.git", - "ssh_url": "git@github.com:ahrefs/monorepo.git", - "clone_url": "https://github.com/ahrefs/monorepo.git", - "svn_url": "https://github.com/ahrefs/monorepo", - "homepage": "https://ahrefs.com", - "size": 2927252, - "stargazers_count": 6, - "watchers_count": 6, - "language": "HTML", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "has_discussions": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 422, - "license": null, - "allow_forking": false, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [], - "visibility": "private", - "forks": 0, - "open_issues": 422, - "watchers": 6, - "default_branch": "develop" - }, - "organization": { - "login": "ahrefs", - "id": 7, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc=", - "url": "https://github.com/api/v3/orgs/ahrefs", - "repos_url": "https://github.com/api/v3/orgs/ahrefs/repos", - "events_url": "https://github.com/api/v3/orgs/ahrefs/events", - "hooks_url": "https://github.com/api/v3/orgs/ahrefs/hooks", - "issues_url": "https://github.com/api/v3/orgs/ahrefs/issues", - "members_url": "https://github.com/api/v3/orgs/ahrefs/members{/member}", - "public_members_url": "https://github.com/api/v3/orgs/ahrefs/public_members{/member}", - "avatar_url": "https://github.com/avatars/u/7?", - "description": null - }, - "enterprise": { - "id": 1, - "slug": "ahrefs-pte-ltd", - "name": "Ahrefs Pte Ltd", - "node_id": "MDEwOkVudGVycHJpc2Ux", - "avatar_url": "https://github.com/avatars/b/1?", - "description": null, - "website_url": null, - "html_url": "https://github.com/enterprises/ahrefs-pte-ltd", - "created_at": "2019-01-09T18:50:55Z", - "updated_at": "2024-03-18T14:38:02Z" - }, - "sender": { - "login": "ip", - "id": 3, - "node_id": "MDQ6VXNlcjM=", - "avatar_url": "https://github.com/avatars/u/3?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/ip", - "html_url": "https://github.com/ip", - "followers_url": "https://github.com/api/v3/users/ip/followers", - "following_url": "https://github.com/api/v3/users/ip/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/ip/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/ip/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/ip/subscriptions", - "organizations_url": "https://github.com/api/v3/users/ip/orgs", - "repos_url": "https://github.com/api/v3/users/ip/repos", - "events_url": "https://github.com/api/v3/users/ip/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/ip/received_events", - "type": "User", - "site_admin": true - } -} diff --git a/mock_payloads/status.commit1-01-failing.json b/mock_payloads/status.commit1-01-failing.json index b2e22aff..c24bf6fe 100644 --- a/mock_payloads/status.commit1-01-failing.json +++ b/mock_payloads/status.commit1-01-failing.json @@ -2,7 +2,7 @@ "id": 17813250, "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", "name": "ahrefs/monorepo", - "target_url": "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4", + "target_url": "https://buildkite.com/ahrefs/monorepo/builds/181732", "avatar_url": "https://github.com/avatars/oa/6?", "context": "buildkite/pipeline2", "description": "Build #181732 is failing", diff --git a/mock_payloads/status.commit1-02-failed-extra.json b/mock_payloads/status.commit1-02-failed-extra.json deleted file mode 100644 index bb6b8781..00000000 --- a/mock_payloads/status.commit1-02-failed-extra.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "id": 17813296, - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "name": "ahrefs/monorepo", - "target_url": "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40", - "avatar_url": "https://github.com/avatars/oa/6?", - "context": "buildkite/pipeline2", - "description": "Build #181733 failed (4 minutes, 10 seconds)", - "state": "failure", - "commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "node_id": "MDY6Q29tbWl0ODU6N2UwYTkzM2U5YzcxYjRjYTEwNzY4MGNhOTU4Y2ExODg4ZDVlNDc5Yg==", - "commit": { - "author": { - "name": "author", - "email": "author@ahrefs.com", - "date": "2024-05-31T03:54:00Z" - }, - "committer": { - "name": "author", - "email": "author@ahrefs.com", - "date": "2024-05-31T03:54:00Z" - }, - "message": "c1 message", - "tree": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/trees/51d7c2d0fc8f182f8ffad40ef79471789e6f5578" - }, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "comment_count": 0, - "verification": { - "verified": false, - "reason": "unsigned", - "signature": null, - "payload": null - } - }, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "html_url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "comments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b/comments", - "author": { - "login": "author", - "id": 92, - "node_id": "MDQ6VXNlcjky", - "avatar_url": "https://github.com/avatars/u/92?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/author", - "html_url": "https://github.com/author", - "followers_url": "https://github.com/api/v3/users/author/followers", - "following_url": "https://github.com/api/v3/users/author/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/author/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/author/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/author/subscriptions", - "organizations_url": "https://github.com/api/v3/users/author/orgs", - "repos_url": "https://github.com/api/v3/users/author/repos", - "events_url": "https://github.com/api/v3/users/author/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/author/received_events", - "type": "User", - "site_admin": false - }, - "committer": { - "login": "author", - "id": 92, - "node_id": "MDQ6VXNlcjky", - "avatar_url": "https://github.com/avatars/u/92?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/author", - "html_url": "https://github.com/author", - "followers_url": "https://github.com/api/v3/users/author/followers", - "following_url": "https://github.com/api/v3/users/author/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/author/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/author/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/author/subscriptions", - "organizations_url": "https://github.com/api/v3/users/author/orgs", - "repos_url": "https://github.com/api/v3/users/author/repos", - "events_url": "https://github.com/api/v3/users/author/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/author/received_events", - "type": "User", - "site_admin": false - }, - "parents": [ - { - "sha": "b2f115b1be68ab14975f0e581283a954bf67734a", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/b2f115b1be68ab14975f0e581283a954bf67734a", - "html_url": "https://github.com/ahrefs/monorepo/commit/b2f115b1be68ab14975f0e581283a954bf67734a" - }, - { - "sha": "53f8468ca5eafb0e0885b9d62806c52c872ea2af", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/53f8468ca5eafb0e0885b9d62806c52c872ea2af", - "html_url": "https://github.com/ahrefs/monorepo/commit/53f8468ca5eafb0e0885b9d62806c52c872ea2af" - } - ] - }, - "branches": [ - { - "name": "author/patches/js-storage", - "commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b" - }, - "protected": false - } - ], - "created_at": "2024-06-02T04:57:47+00:00", - "updated_at": "2024-06-02T04:57:47+00:00", - "repository": { - "id": 85, - "node_id": "MDEwOlJlcG9zaXRvcnk4NQ==", - "name": "monorepo", - "full_name": "ahrefs/monorepo", - "private": true, - "owner": { - "login": "ahrefs", - "id": 7, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc=", - "avatar_url": "https://github.com/avatars/u/7?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/ahrefs", - "html_url": "https://github.com/ahrefs", - "followers_url": "https://github.com/api/v3/users/ahrefs/followers", - "following_url": "https://github.com/api/v3/users/ahrefs/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/ahrefs/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/ahrefs/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/ahrefs/subscriptions", - "organizations_url": "https://github.com/api/v3/users/ahrefs/orgs", - "repos_url": "https://github.com/api/v3/users/ahrefs/repos", - "events_url": "https://github.com/api/v3/users/ahrefs/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/ahrefs/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/ahrefs/monorepo", - "description": "main repository", - "fork": false, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo", - "forks_url": "https://github.com/api/v3/repos/ahrefs/monorepo/forks", - "keys_url": "https://github.com/api/v3/repos/ahrefs/monorepo/keys{/key_id}", - "collaborators_url": "https://github.com/api/v3/repos/ahrefs/monorepo/collaborators{/collaborator}", - "teams_url": "https://github.com/api/v3/repos/ahrefs/monorepo/teams", - "hooks_url": "https://github.com/api/v3/repos/ahrefs/monorepo/hooks", - "issue_events_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues/events{/number}", - "events_url": "https://github.com/api/v3/repos/ahrefs/monorepo/events", - "assignees_url": "https://github.com/api/v3/repos/ahrefs/monorepo/assignees{/user}", - "branches_url": "https://github.com/api/v3/repos/ahrefs/monorepo/branches{/branch}", - "tags_url": "https://github.com/api/v3/repos/ahrefs/monorepo/tags", - "blobs_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/blobs{/sha}", - "git_tags_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/tags{/sha}", - "git_refs_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/refs{/sha}", - "trees_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/trees{/sha}", - "statuses_url": "https://github.com/api/v3/repos/ahrefs/monorepo/statuses/{sha}", - "languages_url": "https://github.com/api/v3/repos/ahrefs/monorepo/languages", - "stargazers_url": "https://github.com/api/v3/repos/ahrefs/monorepo/stargazers", - "contributors_url": "https://github.com/api/v3/repos/ahrefs/monorepo/contributors", - "subscribers_url": "https://github.com/api/v3/repos/ahrefs/monorepo/subscribers", - "subscription_url": "https://github.com/api/v3/repos/ahrefs/monorepo/subscription", - "commits_url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits{/sha}", - "git_commits_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/commits{/sha}", - "comments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/comments{/number}", - "issue_comment_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues/comments{/number}", - "contents_url": "https://github.com/api/v3/repos/ahrefs/monorepo/contents/{+path}", - "compare_url": "https://github.com/api/v3/repos/ahrefs/monorepo/compare/{base}...{head}", - "merges_url": "https://github.com/api/v3/repos/ahrefs/monorepo/merges", - "archive_url": "https://github.com/api/v3/repos/ahrefs/monorepo/{archive_format}{/ref}", - "downloads_url": "https://github.com/api/v3/repos/ahrefs/monorepo/downloads", - "issues_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues{/number}", - "pulls_url": "https://github.com/api/v3/repos/ahrefs/monorepo/pulls{/number}", - "milestones_url": "https://github.com/api/v3/repos/ahrefs/monorepo/milestones{/number}", - "notifications_url": "https://github.com/api/v3/repos/ahrefs/monorepo/notifications{?since,all,participating}", - "labels_url": "https://github.com/api/v3/repos/ahrefs/monorepo/labels{/name}", - "releases_url": "https://github.com/api/v3/repos/ahrefs/monorepo/releases{/id}", - "deployments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/deployments", - "created_at": "2017-03-06T23:40:04Z", - "updated_at": "2024-05-14T07:59:19Z", - "pushed_at": "2024-06-02T04:49:58Z", - "git_url": "git://github.com/ahrefs/monorepo.git", - "ssh_url": "git@github.com:ahrefs/monorepo.git", - "clone_url": "https://github.com/ahrefs/monorepo.git", - "svn_url": "https://github.com/ahrefs/monorepo", - "homepage": "https://ahrefs.com", - "size": 2927252, - "stargazers_count": 6, - "watchers_count": 6, - "language": "HTML", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "has_discussions": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 422, - "license": null, - "allow_forking": false, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [], - "visibility": "private", - "forks": 0, - "open_issues": 422, - "watchers": 6, - "default_branch": "develop" - }, - "organization": { - "login": "ahrefs", - "id": 7, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc=", - "url": "https://github.com/api/v3/orgs/ahrefs", - "repos_url": "https://github.com/api/v3/orgs/ahrefs/repos", - "events_url": "https://github.com/api/v3/orgs/ahrefs/events", - "hooks_url": "https://github.com/api/v3/orgs/ahrefs/hooks", - "issues_url": "https://github.com/api/v3/orgs/ahrefs/issues", - "members_url": "https://github.com/api/v3/orgs/ahrefs/members{/member}", - "public_members_url": "https://github.com/api/v3/orgs/ahrefs/public_members{/member}", - "avatar_url": "https://github.com/avatars/u/7?", - "description": null - }, - "enterprise": { - "id": 1, - "slug": "ahrefs-pte-ltd", - "name": "Ahrefs Pte Ltd", - "node_id": "MDEwOkVudGVycHJpc2Ux", - "avatar_url": "https://github.com/avatars/b/1?", - "description": null, - "website_url": null, - "html_url": "https://github.com/enterprises/ahrefs-pte-ltd", - "created_at": "2019-01-09T18:50:55Z", - "updated_at": "2024-03-18T14:38:02Z" - }, - "sender": { - "login": "ip", - "id": 3, - "node_id": "MDQ6VXNlcjM=", - "avatar_url": "https://github.com/avatars/u/3?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/ip", - "html_url": "https://github.com/ip", - "followers_url": "https://github.com/api/v3/users/ip/followers", - "following_url": "https://github.com/api/v3/users/ip/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/ip/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/ip/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/ip/subscriptions", - "organizations_url": "https://github.com/api/v3/users/ip/orgs", - "repos_url": "https://github.com/api/v3/users/ip/repos", - "events_url": "https://github.com/api/v3/users/ip/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/ip/received_events", - "type": "User", - "site_admin": true - } -} diff --git a/mock_payloads/status.commit1-02-failed-multiple.json b/mock_payloads/status.commit1-02-failed-multiple.json deleted file mode 100644 index 4fa84129..00000000 --- a/mock_payloads/status.commit1-02-failed-multiple.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "id": 17813296, - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "name": "ahrefs/monorepo", - "target_url": "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4", - "avatar_url": "https://github.com/avatars/oa/6?", - "context": "buildkite/pipeline2", - "description": "Build #181732 failed (7 minutes, 29 seconds)", - "state": "failure", - "commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "node_id": "MDY6Q29tbWl0ODU6N2UwYTkzM2U5YzcxYjRjYTEwNzY4MGNhOTU4Y2ExODg4ZDVlNDc5Yg==", - "commit": { - "author": { - "name": "author", - "email": "author@ahrefs.com", - "date": "2024-05-31T03:54:00Z" - }, - "committer": { - "name": "author", - "email": "author@ahrefs.com", - "date": "2024-05-31T03:54:00Z" - }, - "message": "c1 message", - "tree": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/trees/51d7c2d0fc8f182f8ffad40ef79471789e6f5578" - }, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "comment_count": 0, - "verification": { - "verified": false, - "reason": "unsigned", - "signature": null, - "payload": null - } - }, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "html_url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "comments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b/comments", - "author": { - "login": "author", - "id": 92, - "node_id": "MDQ6VXNlcjky", - "avatar_url": "https://github.com/avatars/u/92?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/author", - "html_url": "https://github.com/author", - "followers_url": "https://github.com/api/v3/users/author/followers", - "following_url": "https://github.com/api/v3/users/author/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/author/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/author/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/author/subscriptions", - "organizations_url": "https://github.com/api/v3/users/author/orgs", - "repos_url": "https://github.com/api/v3/users/author/repos", - "events_url": "https://github.com/api/v3/users/author/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/author/received_events", - "type": "User", - "site_admin": false - }, - "committer": { - "login": "author", - "id": 92, - "node_id": "MDQ6VXNlcjky", - "avatar_url": "https://github.com/avatars/u/92?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/author", - "html_url": "https://github.com/author", - "followers_url": "https://github.com/api/v3/users/author/followers", - "following_url": "https://github.com/api/v3/users/author/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/author/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/author/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/author/subscriptions", - "organizations_url": "https://github.com/api/v3/users/author/orgs", - "repos_url": "https://github.com/api/v3/users/author/repos", - "events_url": "https://github.com/api/v3/users/author/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/author/received_events", - "type": "User", - "site_admin": false - }, - "parents": [ - { - "sha": "b2f115b1be68ab14975f0e581283a954bf67734a", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/b2f115b1be68ab14975f0e581283a954bf67734a", - "html_url": "https://github.com/ahrefs/monorepo/commit/b2f115b1be68ab14975f0e581283a954bf67734a" - }, - { - "sha": "53f8468ca5eafb0e0885b9d62806c52c872ea2af", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/53f8468ca5eafb0e0885b9d62806c52c872ea2af", - "html_url": "https://github.com/ahrefs/monorepo/commit/53f8468ca5eafb0e0885b9d62806c52c872ea2af" - } - ] - }, - "branches": [ - { - "name": "author/patches/js-storage", - "commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits/7e0a933e9c71b4ca107680ca958ca1888d5e479b" - }, - "protected": false - } - ], - "created_at": "2024-06-02T04:57:47+00:00", - "updated_at": "2024-06-02T04:57:47+00:00", - "repository": { - "id": 85, - "node_id": "MDEwOlJlcG9zaXRvcnk4NQ==", - "name": "monorepo", - "full_name": "ahrefs/monorepo", - "private": true, - "owner": { - "login": "ahrefs", - "id": 7, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc=", - "avatar_url": "https://github.com/avatars/u/7?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/ahrefs", - "html_url": "https://github.com/ahrefs", - "followers_url": "https://github.com/api/v3/users/ahrefs/followers", - "following_url": "https://github.com/api/v3/users/ahrefs/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/ahrefs/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/ahrefs/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/ahrefs/subscriptions", - "organizations_url": "https://github.com/api/v3/users/ahrefs/orgs", - "repos_url": "https://github.com/api/v3/users/ahrefs/repos", - "events_url": "https://github.com/api/v3/users/ahrefs/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/ahrefs/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/ahrefs/monorepo", - "description": "main repository", - "fork": false, - "url": "https://github.com/api/v3/repos/ahrefs/monorepo", - "forks_url": "https://github.com/api/v3/repos/ahrefs/monorepo/forks", - "keys_url": "https://github.com/api/v3/repos/ahrefs/monorepo/keys{/key_id}", - "collaborators_url": "https://github.com/api/v3/repos/ahrefs/monorepo/collaborators{/collaborator}", - "teams_url": "https://github.com/api/v3/repos/ahrefs/monorepo/teams", - "hooks_url": "https://github.com/api/v3/repos/ahrefs/monorepo/hooks", - "issue_events_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues/events{/number}", - "events_url": "https://github.com/api/v3/repos/ahrefs/monorepo/events", - "assignees_url": "https://github.com/api/v3/repos/ahrefs/monorepo/assignees{/user}", - "branches_url": "https://github.com/api/v3/repos/ahrefs/monorepo/branches{/branch}", - "tags_url": "https://github.com/api/v3/repos/ahrefs/monorepo/tags", - "blobs_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/blobs{/sha}", - "git_tags_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/tags{/sha}", - "git_refs_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/refs{/sha}", - "trees_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/trees{/sha}", - "statuses_url": "https://github.com/api/v3/repos/ahrefs/monorepo/statuses/{sha}", - "languages_url": "https://github.com/api/v3/repos/ahrefs/monorepo/languages", - "stargazers_url": "https://github.com/api/v3/repos/ahrefs/monorepo/stargazers", - "contributors_url": "https://github.com/api/v3/repos/ahrefs/monorepo/contributors", - "subscribers_url": "https://github.com/api/v3/repos/ahrefs/monorepo/subscribers", - "subscription_url": "https://github.com/api/v3/repos/ahrefs/monorepo/subscription", - "commits_url": "https://github.com/api/v3/repos/ahrefs/monorepo/commits{/sha}", - "git_commits_url": "https://github.com/api/v3/repos/ahrefs/monorepo/git/commits{/sha}", - "comments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/comments{/number}", - "issue_comment_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues/comments{/number}", - "contents_url": "https://github.com/api/v3/repos/ahrefs/monorepo/contents/{+path}", - "compare_url": "https://github.com/api/v3/repos/ahrefs/monorepo/compare/{base}...{head}", - "merges_url": "https://github.com/api/v3/repos/ahrefs/monorepo/merges", - "archive_url": "https://github.com/api/v3/repos/ahrefs/monorepo/{archive_format}{/ref}", - "downloads_url": "https://github.com/api/v3/repos/ahrefs/monorepo/downloads", - "issues_url": "https://github.com/api/v3/repos/ahrefs/monorepo/issues{/number}", - "pulls_url": "https://github.com/api/v3/repos/ahrefs/monorepo/pulls{/number}", - "milestones_url": "https://github.com/api/v3/repos/ahrefs/monorepo/milestones{/number}", - "notifications_url": "https://github.com/api/v3/repos/ahrefs/monorepo/notifications{?since,all,participating}", - "labels_url": "https://github.com/api/v3/repos/ahrefs/monorepo/labels{/name}", - "releases_url": "https://github.com/api/v3/repos/ahrefs/monorepo/releases{/id}", - "deployments_url": "https://github.com/api/v3/repos/ahrefs/monorepo/deployments", - "created_at": "2017-03-06T23:40:04Z", - "updated_at": "2024-05-14T07:59:19Z", - "pushed_at": "2024-06-02T04:49:58Z", - "git_url": "git://github.com/ahrefs/monorepo.git", - "ssh_url": "git@github.com:ahrefs/monorepo.git", - "clone_url": "https://github.com/ahrefs/monorepo.git", - "svn_url": "https://github.com/ahrefs/monorepo", - "homepage": "https://ahrefs.com", - "size": 2927252, - "stargazers_count": 6, - "watchers_count": 6, - "language": "HTML", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "has_discussions": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 422, - "license": null, - "allow_forking": false, - "is_template": false, - "web_commit_signoff_required": false, - "topics": [], - "visibility": "private", - "forks": 0, - "open_issues": 422, - "watchers": 6, - "default_branch": "develop" - }, - "organization": { - "login": "ahrefs", - "id": 7, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc=", - "url": "https://github.com/api/v3/orgs/ahrefs", - "repos_url": "https://github.com/api/v3/orgs/ahrefs/repos", - "events_url": "https://github.com/api/v3/orgs/ahrefs/events", - "hooks_url": "https://github.com/api/v3/orgs/ahrefs/hooks", - "issues_url": "https://github.com/api/v3/orgs/ahrefs/issues", - "members_url": "https://github.com/api/v3/orgs/ahrefs/members{/member}", - "public_members_url": "https://github.com/api/v3/orgs/ahrefs/public_members{/member}", - "avatar_url": "https://github.com/avatars/u/7?", - "description": null - }, - "enterprise": { - "id": 1, - "slug": "ahrefs-pte-ltd", - "name": "Ahrefs Pte Ltd", - "node_id": "MDEwOkVudGVycHJpc2Ux", - "avatar_url": "https://github.com/avatars/b/1?", - "description": null, - "website_url": null, - "html_url": "https://github.com/enterprises/ahrefs-pte-ltd", - "created_at": "2019-01-09T18:50:55Z", - "updated_at": "2024-03-18T14:38:02Z" - }, - "sender": { - "login": "ip", - "id": 3, - "node_id": "MDQ6VXNlcjM=", - "avatar_url": "https://github.com/avatars/u/3?", - "gravatar_id": "", - "url": "https://github.com/api/v3/users/ip", - "html_url": "https://github.com/ip", - "followers_url": "https://github.com/api/v3/users/ip/followers", - "following_url": "https://github.com/api/v3/users/ip/following{/other_user}", - "gists_url": "https://github.com/api/v3/users/ip/gists{/gist_id}", - "starred_url": "https://github.com/api/v3/users/ip/starred{/owner}{/repo}", - "subscriptions_url": "https://github.com/api/v3/users/ip/subscriptions", - "organizations_url": "https://github.com/api/v3/users/ip/orgs", - "repos_url": "https://github.com/api/v3/users/ip/repos", - "events_url": "https://github.com/api/v3/users/ip/events{/privacy}", - "received_events_url": "https://github.com/api/v3/users/ip/received_events", - "type": "User", - "site_admin": true - } -} diff --git a/mock_payloads/status.commit1-02-failed.json b/mock_payloads/status.commit1-02-failed.json index 4fa84129..13440b16 100644 --- a/mock_payloads/status.commit1-02-failed.json +++ b/mock_payloads/status.commit1-02-failed.json @@ -2,7 +2,7 @@ "id": 17813296, "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", "name": "ahrefs/monorepo", - "target_url": "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4", + "target_url": "https://buildkite.com/ahrefs/monorepo/builds/181732", "avatar_url": "https://github.com/avatars/oa/6?", "context": "buildkite/pipeline2", "description": "Build #181732 failed (7 minutes, 29 seconds)", diff --git a/mock_payloads/status.failure_test.json b/mock_payloads/status.failure_test.json index 7958d7f5..d76e806e 100644 --- a/mock_payloads/status.failure_test.json +++ b/mock_payloads/status.failure_test.json @@ -2,7 +2,7 @@ "id": 0, "sha": "0d95302addd66c1816bce1b1d495ed1c93ccd478", "name": "ahrefs/monorepo", - "target_url": "https://buildkite.com/org/pipeline2/builds/2#0192341c-4f46-4bfc-82ab-48415b146f40", + "target_url": "https://buildkite.com/org/pipeline2/builds/2", "avatar_url": "https://github.com/avatars/oa/0", "context": "buildkite/pipeline2", "description": "Build #2 failed (20 seconds)", diff --git a/mock_states/status.commit1-01-failing-extra.json b/mock_states/status.commit1-01-failing-extra.json deleted file mode 100644 index a3842192..00000000 --- a/mock_states/status.commit1-01-failing-extra.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "pipeline_statuses": { - "buildkite/pipeline2": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - }, - "current_failed_commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/another-failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - }, - "current_failed_commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/with-extra-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - } - }, - "pipeline_commits": { - "buildkite/pipeline2": { - "s1": ["7e0a933e9c71b4ca107680ca958ca1888d5e479b"], - "s2": [] - } - } -} diff --git a/mock_states/status.commit1-01-failing-multiple.json b/mock_states/status.commit1-01-failing-multiple.json deleted file mode 100644 index 8da0aafd..00000000 --- a/mock_states/status.commit1-01-failing-multiple.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "pipeline_statuses": { - "buildkite/pipeline2": { - "author/patches/js-storage": { - "status": "success" - } - }, - "buildkite/pipeline2/failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/another-failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - } - }, - "pipeline_commits": { - "buildkite/pipeline2": { - "s1": ["7e0a933e9c71b4ca107680ca958ca1888d5e479b"], - "s2": [] - } - } -} diff --git a/mock_states/status.commit1-01-failing.json b/mock_states/status.commit1-01-failing.json deleted file mode 100644 index b230d818..00000000 --- a/mock_states/status.commit1-01-failing.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "pipeline_statuses": { - "buildkite/pipeline2": { - "author/patches/js-storage": { - "status": "success" - } - }, - "buildkite/pipeline2/failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - } - }, - "pipeline_commits": { - "buildkite/pipeline2": { - "s1": ["7e0a933e9c71b4ca107680ca958ca1888d5e479b"], - "s2": [] - } - } -} diff --git a/mock_states/status.commit1-02-failed-extra.json b/mock_states/status.commit1-02-failed-extra.json deleted file mode 100644 index 81907e5f..00000000 --- a/mock_states/status.commit1-02-failed-extra.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "pipeline_statuses": { - "buildkite/pipeline2": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - }, - "current_failed_commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - }, - "current_failed_commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/another-failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - }, - "current_failed_commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/with-extra-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/51d7c2d0fc8f182f8ffad40ef79471789e6f5578", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181733#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - } - }, - "pipeline_commits": { - "buildkite/pipeline2": { - "s1": ["7e0a933e9c71b4ca107680ca958ca1888d5e479b"], - "s2": [] - } - } -} diff --git a/mock_states/status.commit1-02-failed-multiple.json b/mock_states/status.commit1-02-failed-multiple.json deleted file mode 100644 index 02522fb0..00000000 --- a/mock_states/status.commit1-02-failed-multiple.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "pipeline_statuses": { - "buildkite/pipeline2": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/another-failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - } - }, - "pipeline_commits": { - "buildkite/pipeline2": { - "s1": ["7e0a933e9c71b4ca107680ca958ca1888d5e479b"], - "s2": [] - } - } -} diff --git a/mock_states/status.commit1-02-failed.json b/mock_states/status.commit1-02-failed.json index fac6283a..48e41154 100644 --- a/mock_states/status.commit1-02-failed.json +++ b/mock_states/status.commit1-02-failed.json @@ -1,32 +1,15 @@ { "pipeline_statuses": { "buildkite/pipeline2": { - "author/patches/js-storage": { + "master": { "status": "failure", "original_failed_commit": { "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", "commit_message": "c1 message", "build_link": [ "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/failed-step": { - "author/patches/js-storage": { - "status": "failure", - "original_failed_commit": { - "sha": "7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "author": "author@ahrefs.com", - "url": "https://github.com/ahrefs/monorepo/commit/7e0a933e9c71b4ca107680ca958ca1888d5e479b", - "commit_message": "c1 message", - "build_link": [ - "Some", - "https://buildkite.com/ahrefs/monorepo/builds/181732#0192347d-e4ee-4072-9da4-f441eeb65ed4" + "https://buildkite.com/ahrefs/monorepo/builds/181732" ], "last_updated": "2024-06-02T04:57:47+00:00" } diff --git a/mock_states/status.failure_test.json b/mock_states/status.failure_test.json deleted file mode 100644 index 78ffc344..00000000 --- a/mock_states/status.failure_test.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "pipeline_statuses": { - "buildkite/pipeline2": { - "master": { - "status": "failure", - "original_failed_commit": { - "sha": "0d95302addd66c1816bce1b1d495ed1c93ccd478", - "author": "mail@example.org", - "url": "https://github.com/ahrefs/monorepo/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478", - "commit_message": "Update README.md", - "build_link": [ - "Some", - "https://buildkite.com/org/pipeline2/builds/2#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - }, - "buildkite/pipeline2/failed-step": { - "master": { - "status": "failure", - "original_failed_commit": { - "sha": "0d95302addd66c1816bce1b1d495ed1c93ccd478", - "author": "mail@example.org", - "url": "https://github.com/ahrefs/monorepo/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478", - "commit_message": "Update README.md", - "build_link": [ - "Some", - "https://buildkite.com/org/pipeline2/builds/2#0192341c-4f46-4bfc-82ab-48415b146f40" - ], - "last_updated": "2024-06-02T04:57:47+00:00" - } - } - } - }, - "pipeline_commits": { - "buildkite/pipeline2": { - "s1": ["0d95302addd66c1816bce1b1d495ed1c93ccd478"], - "s2": [] - } - } -} diff --git a/mock_states/status.state_hide_success_test.json b/mock_states/status.state_hide_success_test.json index 4481c33b..f53e0857 100644 --- a/mock_states/status.state_hide_success_test.json +++ b/mock_states/status.state_hide_success_test.json @@ -6,7 +6,6 @@ "original_failed_commit": { "sha": "0d95302addd66c1816bce1b1d495ed1c93ccd478", "author": "mail@example.org", - "url": "https://github.com/ahrefs/monorepo/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478", "commit_message": "Update README.md", "build_link": [ "Some", diff --git a/mock_states/status.state_hide_success_test_disallowed_pipeline.json b/mock_states/status.state_hide_success_test_disallowed_pipeline.json index b8e2d4b0..3438bf7e 100644 --- a/mock_states/status.state_hide_success_test_disallowed_pipeline.json +++ b/mock_states/status.state_hide_success_test_disallowed_pipeline.json @@ -6,7 +6,6 @@ "original_failed_commit": { "sha": "0d95302addd66c1816bce1b1d495ed1c93ccd478", "author": "mail@example.org", - "url": "https://github.com/ahrefs/monorepo/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478", "commit_message": "Update README.md", "build_link": [ "Some", diff --git a/test/monorobot.json b/test/monorobot.json index d7394e4c..84d24106 100644 --- a/test/monorobot.json +++ b/test/monorobot.json @@ -1,79 +1,112 @@ { - "main_branch_name": "develop", - "status_rules": { - "allowed_pipelines": ["default", "buildkite/pipeline2"], - "rules": [ - { - "on": ["failure"], - "when": { - "match": { - "field": "description", - "re": "^(Build #[0-9]+ canceled by .+|Failed \\(exit status 255\\))$" - } - }, - "policy": "ignore" - }, - { - "on": ["failure", "error"], - "policy": "allow", - "notify_dm": true - } - ] - }, - "ignored_users": ["ignored_user"], - "prefix_rules": { - "default_channel": "default", - "filter_main_branch": true, - "rules": [ - { - "match": ["backend/a1"], - "channel": "a1" - }, - { - "match": ["backend/a1/longest"], - "channel": "longest-a1" - }, - { - "match": ["backend/a5", "backend/a4"], - "channel": "backend" - }, - { - "match": ["backend/branch-filter1"], - "channel": "backend1", - "branch_filters": "any" - }, - { - "match": ["backend/branch-filter2"], - "channel": "backend2", - "branch_filters": ["master"] - }, - { - "channel": "all-push-events" - } - ] - }, - "label_rules": { - "default_channel": "default", - "rules": [ - { - "match": ["backend"], - "channel": "backend" - }, - { - "match": ["a1"], - "channel": "a1-bot" - }, - { - "match": ["a3"], - "channel": "a3" - }, - { - "ignore": ["backend", "a1", "a3"], - "channel": "frontend-bot" - } - ] - }, - "user_mappings": { - "mail@example.org": "slack_mail@example.com" - } + "main_branch_name": "develop", + "status_rules": { + "allowed_pipelines": [ + "default", + "buildkite/pipeline2" + ], + "rules": [ + { + "on": [ + "failure" + ], + "when": { + "match": { + "field": "description", + "re": "^(Build #[0-9]+ canceled by .+|Failed \\(exit status 255\\))$" + } + }, + "policy": "ignore" + }, + { + "on": [ + "failure", + "error" + ], + "policy": "allow_once", + "notify_dm": true + } + ] + }, + "ignored_users": [ + "ignored_user" + ], + "prefix_rules": { + "default_channel": "default", + "filter_main_branch": true, + "rules": [ + { + "match": [ + "backend/a1" + ], + "channel": "a1" + }, + { + "match": [ + "backend/a1/longest" + ], + "channel": "longest-a1" + }, + { + "match": [ + "backend/a5", + "backend/a4" + ], + "channel": "backend" + }, + { + "match": [ + "backend/branch-filter1" + ], + "channel": "backend1", + "branch_filters": "any" + }, + { + "match": [ + "backend/branch-filter2" + ], + "channel": "backend2", + "branch_filters": [ + "master" + ] + }, + { + "channel": "all-push-events" + } + ] + }, + "label_rules": { + "default_channel": "default", + "rules": [ + { + "match": [ + "backend" + ], + "channel": "backend" + }, + { + "match": [ + "a1" + ], + "channel": "a1-bot" + }, + { + "match": [ + "a3" + ], + "channel": "a3" + }, + { + "ignore": [ + "backend", + "a1", + "a3" + ], + "channel": "frontend-bot" + } + ] + }, + "user_mappings": { + "mail@example.org": "slack_mail@example.com" + } } diff --git a/test/slack_payloads.expected b/test/slack_payloads.expected index 6a645677..ec1c7cbe 100644 --- a/test/slack_payloads.expected +++ b/test/slack_payloads.expected @@ -475,84 +475,6 @@ will notify #longest-a1 "unfurl_links": false } ===== file ../mock_payloads/status.cancelled_test.json ===== -===== file ../mock_payloads/status.commit1-01-failing-extra.json ===== -will notify #id[author@ahrefs.com] -{ - "channel": "id[author@ahrefs.com]", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build is failing.\nSome of the steps were broken in previous commit(s), but this commit also broke some step(s).", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*Failing steps*: (), ()\n*New steps broken*: ()" - } - ] - } - ], - "unfurl_links": false -} -will notify #default -{ - "channel": "default", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build is failing.\nSome of the steps were broken in previous commit(s), but this commit also broke some step(s).", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*Failing steps*: (), ()\n*New steps broken*: ()" - } - ] - } - ], - "unfurl_links": false -} -===== file ../mock_payloads/status.commit1-01-failing-multiple.json ===== -will notify #id[author@ahrefs.com] -{ - "channel": "id[author@ahrefs.com]", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build is failing.", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*New steps broken*: (), ()" - } - ] - } - ], - "unfurl_links": false -} -will notify #default -{ - "channel": "default", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build is failing.", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*New steps broken*: (), ()" - } - ] - } - ], - "unfurl_links": false -} ===== file ../mock_payloads/status.commit1-01-failing.json ===== will notify #id[author@ahrefs.com] { @@ -563,10 +485,10 @@ will notify #id[author@ahrefs.com] "fallback": null, "mrkdwn_in": [ "fields", "text" ], "color": "danger", - "text": "*Description*: Build is failing.", + "text": "*Description*: Build is failing.", "fields": [ { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*New steps broken*: ()" + "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage" } ] } @@ -582,88 +504,10 @@ will notify #default "fallback": null, "mrkdwn_in": [ "fields", "text" ], "color": "danger", - "text": "*Description*: Build is failing.", + "text": "*Description*: Build is failing.", "fields": [ { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*New steps broken*: ()" - } - ] - } - ], - "unfurl_links": false -} -===== file ../mock_payloads/status.commit1-02-failed-extra.json ===== -will notify #id[author@ahrefs.com] -{ - "channel": "id[author@ahrefs.com]", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build failed (4 minutes, 10 seconds).\nSome of the steps were broken in previous commit(s), but this commit also broke some step(s).", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*Failing steps*: (), ()\n*New steps broken*: ()" - } - ] - } - ], - "unfurl_links": false -} -will notify #default -{ - "channel": "default", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build failed (4 minutes, 10 seconds).\nSome of the steps were broken in previous commit(s), but this commit also broke some step(s).", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*Failing steps*: (), ()\n*New steps broken*: ()" - } - ] - } - ], - "unfurl_links": false -} -===== file ../mock_payloads/status.commit1-02-failed-multiple.json ===== -will notify #id[author@ahrefs.com] -{ - "channel": "id[author@ahrefs.com]", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build failed (7 minutes, 29 seconds).", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*New steps broken*: (), ()" - } - ] - } - ], - "unfurl_links": false -} -will notify #default -{ - "channel": "default", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build failed (7 minutes, 29 seconds).", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*New steps broken*: (), ()" + "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage" } ] } @@ -671,25 +515,6 @@ will notify #default "unfurl_links": false } ===== file ../mock_payloads/status.commit1-02-failed.json ===== -will notify #id[author@ahrefs.com] -{ - "channel": "id[author@ahrefs.com]", - "text": ": Build failed for \"c1 message\"", - "attachments": [ - { - "fallback": null, - "mrkdwn_in": [ "fields", "text" ], - "color": "danger", - "text": "*Description*: Build failed (7 minutes, 29 seconds).", - "fields": [ - { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*New steps broken*: ()" - } - ] - } - ], - "unfurl_links": false -} will notify #default { "channel": "default", @@ -699,10 +524,10 @@ will notify #default "fallback": null, "mrkdwn_in": [ "fields", "text" ], "color": "danger", - "text": "*Description*: Build failed (7 minutes, 29 seconds).", + "text": "*Description*: Build failed (7 minutes, 29 seconds).", "fields": [ { - "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage\n*New steps broken*: ()" + "value": "*Commit*: `` c1 message - author\n*Branch*: author/patches/js-storage" } ] } @@ -719,10 +544,10 @@ will notify #id[slack_mail@example.com] "fallback": null, "mrkdwn_in": [ "fields", "text" ], "color": "danger", - "text": "*Description*: Build failed (20 seconds).", + "text": "*Description*: Build failed (20 seconds).", "fields": [ { - "value": "*Commit*: `` Update README.md - Khady\n*Branch*: master\n*New steps broken*: ()" + "value": "*Commit*: `` Update README.md - Khady\n*Branch*: master" } ] } @@ -738,10 +563,10 @@ will notify #default "fallback": null, "mrkdwn_in": [ "fields", "text" ], "color": "danger", - "text": "*Description*: Build failed (20 seconds).", + "text": "*Description*: Build failed (20 seconds).", "fields": [ { - "value": "*Commit*: `` Update README.md - Khady\n*Branch*: master\n*New steps broken*: ()" + "value": "*Commit*: `` Update README.md - Khady\n*Branch*: master" } ] }