From ccf59f844b775fd2cf04ca8c242122463a5c70e0 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 9 Aug 2018 16:44:38 -0400 Subject: [PATCH] Prefix comments with the request ID --- ofborg/src/tasks/githubcommentposter.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ofborg/src/tasks/githubcommentposter.rs b/ofborg/src/tasks/githubcommentposter.rs index fd0edcb..a65b54e 100644 --- a/ofborg/src/tasks/githubcommentposter.rs +++ b/ofborg/src/tasks/githubcommentposter.rs @@ -99,7 +99,8 @@ fn result_to_comment(result: &BuildResult) -> String { }; reply.push(format!( - "{} on {}{}", + "{} on {}{}", + result.request_id, (match *status { BuildStatus::Skipped => "No attempt".into(), BuildStatus::Success => "Success".into(), @@ -205,7 +206,7 @@ mod tests { assert_eq!( &result_to_comment(&result), - "Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) + "Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) Attempted: foo @@ -268,7 +269,7 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29 assert_eq!( &result_to_comment(&result), - "Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) + "Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) Attempted: foo @@ -328,7 +329,7 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29 assert_eq!( &result_to_comment(&result), - "Timed out, unknown build status on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) + "Timed out, unknown build status on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) Attempted: foo @@ -388,7 +389,7 @@ error: build of '/nix/store/l1limh50lx2cx45yb2gqpv7k8xl1mik2-gdb-8.1.drv' failed assert_eq!( &result_to_comment(&result), - "Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) + "Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
Partial log (click to expand)

@@ -447,7 +448,7 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29 assert_eq!( &result_to_comment(&result), - "Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) + "Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)

Partial log (click to expand)

@@ -495,7 +496,7 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29 assert_eq!( &result_to_comment(&result), - "No attempt on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=foo) + "No attempt on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=foo) The following builds were skipped because they don't evaluate on x86_64-linux: not-attempted @@ -536,7 +537,7 @@ foo assert_eq!( &result_to_comment(&result), - "No attempt on x86_64-linux + "No attempt on x86_64-linux The following builds were skipped because they don't evaluate on x86_64-linux: not-attempted @@ -582,7 +583,7 @@ No partial log is available. assert_eq!( &result_to_comment(&result), - "Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) + "Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid) Attempted: foo