From 7a7d99bfdac001db62dfdc1df9997812067ea3fb Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 5 Mar 2018 07:38:52 -0500 Subject: [PATCH] Add some little support for other repos for testing --- config.public.json | 4 +++- ofborg/src/acl.rs | 8 +++++--- ofborg/src/bin/github-comment-filter.rs | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config.public.json b/config.public.json index 33509c7..eaba7e0 100644 --- a/config.public.json +++ b/config.public.json @@ -7,7 +7,9 @@ }, "runner": { "repos": [ - "nixos/nixpkgs" + "nixos/nixpkgs", + "nixos/ofborg", + "grahamc/nixpkgs" ], "trusted_users": [ "7c6f434c", diff --git a/ofborg/src/acl.rs b/ofborg/src/acl.rs index 90de362..7bcb1f0 100644 --- a/ofborg/src/acl.rs +++ b/ofborg/src/acl.rs @@ -44,10 +44,12 @@ impl ACL { } pub fn can_build_unrestricted(&self, user: &str, repo: &str) -> bool { - if repo.to_lowercase() != "nixos/nixpkgs" { + if repo.to_lowercase() == "nixos/nixpkgs" { + return self.trusted_users.contains(&user.to_lowercase()); + } else if user == "grahamc" { + return true; + } else { return false; } - - return self.trusted_users.contains(&user.to_lowercase()); } } diff --git a/ofborg/src/bin/github-comment-filter.rs b/ofborg/src/bin/github-comment-filter.rs index 69ace11..e8920e7 100644 --- a/ofborg/src/bin/github-comment-filter.rs +++ b/ofborg/src/bin/github-comment-filter.rs @@ -71,7 +71,7 @@ fn main() { .bind_queue(easyamqp::BindQueueConfig { queue: "build-inputs".to_owned(), exchange: "github-events".to_owned(), - routing_key: Some("issue_comment.nixos/nixpkgs".to_owned()), + routing_key: Some("issue_comment.*".to_owned()), no_wait: false, arguments: None, })