Skip to content

Commit c3d17d9

Browse files
committedAug 31, 2018
Fixup comment formatting
1 parent ccf59f8 commit c3d17d9

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed
 

‎ofborg/src/tasks/githubcommentposter.rs

+18-11
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ fn result_to_comment(result: &BuildResult) -> String {
9898
Some(ref s) => s,
9999
};
100100

101-
reply.push(format!(
102-
"<!--REQUEST_ID={}-->{} on {}{}",
103-
result.request_id,
101+
reply.push(format!("<!--REQUEST_ID={}-->", result.request_id));
102+
reply.push(format!("{} on {}{}",
104103
(match *status {
105104
BuildStatus::Skipped => "No attempt".into(),
106105
BuildStatus::Success => "Success".into(),
@@ -206,7 +205,8 @@ mod tests {
206205

207206
assert_eq!(
208207
&result_to_comment(&result),
209-
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
208+
"<!--REQUEST_ID=bogus-request-id-->
209+
Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
210210
211211
Attempted: foo
212212
@@ -269,7 +269,8 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
269269

270270
assert_eq!(
271271
&result_to_comment(&result),
272-
"<!--REQUEST_ID=bogus-request-id-->Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
272+
"<!--REQUEST_ID=bogus-request-id-->
273+
Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
273274
274275
Attempted: foo
275276
@@ -329,7 +330,8 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
329330

330331
assert_eq!(
331332
&result_to_comment(&result),
332-
"<!--REQUEST_ID=bogus-request-id-->Timed out, unknown build status on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
333+
"<!--REQUEST_ID=bogus-request-id-->
334+
Timed out, unknown build status on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
333335
334336
Attempted: foo
335337
@@ -389,7 +391,8 @@ error: build of '/nix/store/l1limh50lx2cx45yb2gqpv7k8xl1mik2-gdb-8.1.drv' failed
389391

390392
assert_eq!(
391393
&result_to_comment(&result),
392-
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
394+
"<!--REQUEST_ID=bogus-request-id-->
395+
Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
393396
394397
<details><summary>Partial log (click to expand)</summary><p>
395398
@@ -448,7 +451,8 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
448451

449452
assert_eq!(
450453
&result_to_comment(&result),
451-
"<!--REQUEST_ID=bogus-request-id-->Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
454+
"<!--REQUEST_ID=bogus-request-id-->
455+
Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
452456
453457
<details><summary>Partial log (click to expand)</summary><p>
454458
@@ -496,7 +500,8 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
496500

497501
assert_eq!(
498502
&result_to_comment(&result),
499-
"<!--REQUEST_ID=bogus-request-id-->No attempt on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=foo)
503+
"<!--REQUEST_ID=bogus-request-id-->
504+
No attempt on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=foo)
500505
501506
The following builds were skipped because they don't evaluate on x86_64-linux: not-attempted
502507
@@ -537,7 +542,8 @@ foo
537542

538543
assert_eq!(
539544
&result_to_comment(&result),
540-
"<!--REQUEST_ID=bogus-request-id-->No attempt on x86_64-linux
545+
"<!--REQUEST_ID=bogus-request-id-->
546+
No attempt on x86_64-linux
541547
542548
The following builds were skipped because they don't evaluate on x86_64-linux: not-attempted
543549
@@ -583,7 +589,8 @@ No partial log is available.
583589

584590
assert_eq!(
585591
&result_to_comment(&result),
586-
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
592+
"<!--REQUEST_ID=bogus-request-id-->
593+
Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
587594
588595
Attempted: foo
589596

0 commit comments

Comments
 (0)