Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/ofborg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 30de4a792755^
Choose a base ref
...
head repository: NixOS/ofborg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ccf59f844b77
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Aug 9, 2018

  1. Copy the full SHA
    30de4a7 View commit details
  2. Copy the full SHA
    74e2641 View commit details
  3. Copy the full SHA
    ccf59f8 View commit details
Showing with 23 additions and 22 deletions.
  1. +1 −1 ofborg/src/message/buildresult.rs
  2. +3 −3 ofborg/src/tasks/build.rs
  3. +18 −17 ofborg/src/tasks/githubcommentposter.rs
  4. +1 −1 ofborg/src/tasks/log_message_collector.rs
2 changes: 1 addition & 1 deletion ofborg/src/message/buildresult.rs
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ pub struct BuildResult {
pub system: String,
pub output: Vec<String>,
pub attempt_id: String,
pub request_id: Option<String>,
pub request_id: String,
pub success: Option<bool>, // replaced by status
pub status: Option<BuildStatus>,
pub skipped_attrs: Option<Vec<String>>,
6 changes: 3 additions & 3 deletions ofborg/src/tasks/build.rs
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ impl<'a, 'b> JobActions<'a, 'b> {
system: self.system.clone(),
output: vec![String::from("Merge failed")],
attempt_id: self.attempt_id.clone(),
request_id: Some(self.job.request_id.clone()),
request_id: self.job.request_id.clone(),
attempted_attrs: None,
skipped_attrs: None,
status: Some(BuildStatus::Failure),
@@ -202,7 +202,7 @@ impl<'a, 'b> JobActions<'a, 'b> {
system: self.system.clone(),
output: self.log_snippet(),
attempt_id: self.attempt_id.clone(),
request_id: Some(self.job.request_id.clone()),
request_id: self.job.request_id.clone(),
skipped_attrs: Some(not_attempted_attrs),
attempted_attrs: None,
status: None,
@@ -243,7 +243,7 @@ impl<'a, 'b> JobActions<'a, 'b> {
system: self.system.clone(),
output: self.log_snippet(),
attempt_id: self.attempt_id.clone(),
request_id: Some(self.job.request_id.clone()),
request_id: self.job.request_id.clone(),
status: Some(status),
success: Some(success),
attempted_attrs: Some(attempted_attrs),
35 changes: 18 additions & 17 deletions ofborg/src/tasks/githubcommentposter.rs
Original file line number Diff line number Diff line change
@@ -99,7 +99,8 @@ fn result_to_comment(result: &BuildResult) -> String {
};

reply.push(format!(
"{} on {}{}",
"<!--REQUEST_ID={}-->{} on {}{}",
result.request_id,
(match *status {
BuildStatus::Skipped => "No attempt".into(),
BuildStatus::Success => "Success".into(),
@@ -195,7 +196,7 @@ mod tests {
"/nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29-gdb-8.1".to_owned(),
],
attempt_id: "neatattemptid".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
system: "x86_64-linux".to_owned(),
attempted_attrs: Some(vec!["foo".to_owned()]),
skipped_attrs: Some(vec!["bar".to_owned()]),
@@ -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)
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
Attempted: foo
@@ -258,7 +259,7 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
"/nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29-gdb-8.1".to_owned(),
],
attempt_id: "neatattemptid".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
system: "x86_64-linux".to_owned(),
attempted_attrs: Some(vec!["foo".to_owned()]),
skipped_attrs: None,
@@ -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)
"<!--REQUEST_ID=bogus-request-id-->Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
Attempted: foo
@@ -318,7 +319,7 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
"error: build of '/nix/store/l1limh50lx2cx45yb2gqpv7k8xl1mik2-gdb-8.1.drv' failed".to_owned(),
],
attempt_id: "neatattemptid".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
system: "x86_64-linux".to_owned(),
attempted_attrs: Some(vec!["foo".to_owned()]),
skipped_attrs: None,
@@ -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)
"<!--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)
Attempted: foo
@@ -378,7 +379,7 @@ error: build of '/nix/store/l1limh50lx2cx45yb2gqpv7k8xl1mik2-gdb-8.1.drv' failed
"/nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29-gdb-8.1".to_owned(),
],
attempt_id: "neatattemptid".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
system: "x86_64-linux".to_owned(),
attempted_attrs: None,
skipped_attrs: None,
@@ -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)
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
<details><summary>Partial log (click to expand)</summary><p>
@@ -437,7 +438,7 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
"/nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29-gdb-8.1".to_owned(),
],
attempt_id: "neatattemptid".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
system: "x86_64-linux".to_owned(),
attempted_attrs: None,
skipped_attrs: None,
@@ -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)
"<!--REQUEST_ID=bogus-request-id-->Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
<details><summary>Partial log (click to expand)</summary><p>
@@ -485,7 +486,7 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
},
output: vec!["foo".to_owned()],
attempt_id: "foo".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
system: "x86_64-linux".to_owned(),
attempted_attrs: None,
skipped_attrs: Some(vec!["not-attempted".to_owned()]),
@@ -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)
"<!--REQUEST_ID=bogus-request-id-->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
@@ -526,7 +527,7 @@ foo
},
output: vec![],
attempt_id: "foo".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
system: "x86_64-linux".to_owned(),
attempted_attrs: None,
skipped_attrs: Some(vec!["not-attempted".to_owned()]),
@@ -536,7 +537,7 @@ foo

assert_eq!(
&result_to_comment(&result),
"No attempt on x86_64-linux
"<!--REQUEST_ID=bogus-request-id-->No attempt on x86_64-linux
The following builds were skipped because they don't evaluate on x86_64-linux: not-attempted
@@ -572,7 +573,7 @@ No partial log is available.
"/nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29-gdb-8.1".to_owned(),
],
attempt_id: "neatattemptid".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
system: "x86_64-linux".to_owned(),
attempted_attrs: Some(vec!["foo".to_owned()]),
skipped_attrs: Some(vec!["bar".to_owned()]),
@@ -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)
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
Attempted: foo
2 changes: 1 addition & 1 deletion ofborg/src/tasks/log_message_collector.rs
Original file line number Diff line number Diff line change
@@ -445,7 +445,7 @@ mod tests {
system: "x86_64-linux".to_owned(),
output: vec![],
attempt_id: "attempt-id-foo".to_owned(),
request_id: Some("bogus-request-id".to_owned()),
request_id: "bogus-request-id".to_owned(),
status: Some(BuildStatus::Success),
success: Some(true),
attempted_attrs: Some(vec!["foo".to_owned()]),