diff --git a/README.md b/README.md index aeb2ce5..78206c4 100644 --- a/README.md +++ b/README.md @@ -214,13 +214,9 @@ function rabbitmq_conn($timeout = 3) { return $connection; } -function gh_client() { - $client = new \Github\Client(); - $client->authenticate('githubusername', - 'githubpassword', - Github\Client::AUTH_HTTP_PASSWORD); - - return $client; +function gh_secret() { + return "github webhook secret"; } + ``` diff --git a/config.public.json b/config.public.json index d44b9a1..3aaeea9 100644 --- a/config.public.json +++ b/config.public.json @@ -6,6 +6,9 @@ "path": "/var/lib/nginx/ofborg/logs/" }, "runner": { + "repos": [ + "nixos/nixpkgs" + ], "trusted_users": [ "7c6f434c", "adisbladis", diff --git a/nix/nixpkgs.json b/nix/nixpkgs.json index d953cc8..18ce7f6 100644 --- a/nix/nixpkgs.json +++ b/nix/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/nixos/nixpkgs-channels.git", - "rev": "e860b651d6e297658e960c165fd231dbc0de1f9b", - "date": "2018-02-08T13:54:43+08:00", - "sha256": "0bsnarxm8g1r9qhk388as78cajidd5sqmmyvhmpsqqlzb3bn7ryv", + "rev": "c2fbd472a4ebaae739257a3df93aef25f19dd04f", + "date": "2018-02-23T08:08:30+00:00", + "sha256": "07mir6nqb98mbykabppgj4dli66h18qsyi4zqp640x22k6bkp2vp", "fetchSubmodules": true } diff --git a/ofborg/src/acl.rs b/ofborg/src/acl.rs index 805d304..90de362 100644 --- a/ofborg/src/acl.rs +++ b/ofborg/src/acl.rs @@ -2,16 +2,22 @@ pub struct ACL { trusted_users: Vec, known_users: Vec, + repos: Vec, } impl ACL { - pub fn new(trusted_users: Vec, known_users: Vec) -> ACL { + pub fn new(repos: Vec, trusted_users: Vec, known_users: Vec) -> ACL { return ACL { trusted_users: trusted_users, known_users: known_users, + repos: repos, }; } + pub fn is_repo_eligible(&self, name: &str) -> bool { + self.repos.contains(&name.to_lowercase()) + } + pub fn build_job_destinations_for_user_repo( &self, user: &str, diff --git a/ofborg/src/bin/evaluation-filter.rs b/ofborg/src/bin/evaluation-filter.rs new file mode 100644 index 0000000..525fe55 --- /dev/null +++ b/ofborg/src/bin/evaluation-filter.rs @@ -0,0 +1,93 @@ +extern crate ofborg; +extern crate amqp; +extern crate env_logger; + +extern crate hyper; +extern crate hubcaps; +extern crate hyper_native_tls; + + +use std::env; + +use amqp::Basic; + +use ofborg::config; +use ofborg::worker; +use ofborg::tasks; +use ofborg::easyamqp; +use ofborg::easyamqp::TypedWrappers; + + +fn main() { + let cfg = config::load(env::args().nth(1).unwrap().as_ref()); + ofborg::setup_log(); + + println!("Hello, world!"); + + + let mut session = easyamqp::session_from_config(&cfg.rabbitmq).unwrap(); + println!("Connected to rabbitmq"); + + let mut channel = session.open_channel(1).unwrap(); + + channel + .declare_queue(easyamqp::QueueConfig { + queue: "mass-rebuild-check-jobs".to_owned(), + passive: false, + durable: true, + exclusive: false, + auto_delete: false, + no_wait: false, + arguments: None, + }) + .unwrap(); + + channel + .declare_queue(easyamqp::QueueConfig { + queue: "mass-rebuild-check-inputs".to_owned(), + passive: false, + durable: true, + exclusive: false, + auto_delete: false, + no_wait: false, + arguments: None, + }) + .unwrap(); + + channel + .bind_queue(easyamqp::BindQueueConfig { + queue: "mass-rebuild-check-inputs".to_owned(), + exchange: "github-events".to_owned(), + routing_key: Some("pull_request.nixos/nixpkgs".to_owned()), + no_wait: false, + arguments: None, + }) + .unwrap(); + + channel.basic_prefetch(1).unwrap(); + channel + .consume( + worker::new(tasks::evaluationfilter::EvaluationFilterWorker::new( + cfg.acl(), + )), + easyamqp::ConsumeConfig { + queue: "mass-rebuild-check-inputs".to_owned(), + consumer_tag: format!("{}-evaluation-filter", cfg.whoami()), + no_local: false, + no_ack: false, + no_wait: false, + exclusive: false, + arguments: None, + }, + ) + .unwrap(); + + channel.start_consuming(); + + println!("Finished consuming?"); + + channel.close(200, "Bye").unwrap(); + println!("Closed the channel"); + session.close(200, "Good Bye"); + println!("Closed the session... EOF"); +} diff --git a/ofborg/src/bin/stats.rs b/ofborg/src/bin/stats.rs index 9d7ce78..ad3ada0 100644 --- a/ofborg/src/bin/stats.rs +++ b/ofborg/src/bin/stats.rs @@ -10,7 +10,6 @@ use ofborg::easyamqp::TypedWrappers; use hyper::server::{Request, Response, Server}; use std::thread; -use std::time::Duration; fn main() { let cfg = config::load(env::args().nth(1).unwrap().as_ref()); diff --git a/ofborg/src/config.rs b/ofborg/src/config.rs index 0928f7e..ff886a4 100644 --- a/ofborg/src/config.rs +++ b/ofborg/src/config.rs @@ -58,6 +58,7 @@ pub struct LogStorage { #[derive(Serialize, Deserialize, Debug)] pub struct RunnerConfig { pub identity: String, + pub repos: Option>, pub trusted_users: Option>, pub known_users: Option>, } @@ -74,6 +75,9 @@ impl Config { pub fn acl(&self) -> acl::ACL { return acl::ACL::new( + self.runner.repos.clone().expect( + "fetching config's runner.repos", + ), self.runner.trusted_users.clone().expect( "fetching config's runner.trusted_users", ), diff --git a/ofborg/src/ghevent/common.rs b/ofborg/src/ghevent/common.rs index a1d6c98..4f22abc 100644 --- a/ofborg/src/ghevent/common.rs +++ b/ofborg/src/ghevent/common.rs @@ -20,8 +20,4 @@ pub struct Repository { #[derive(Serialize, Deserialize, Debug)] pub struct Issue { pub number: u64, - pub pull_request: Option, } - -#[derive(Serialize, Deserialize, Debug)] -pub struct PullRequest {} diff --git a/ofborg/src/ghevent/mod.rs b/ofborg/src/ghevent/mod.rs index 41f184a..d50c400 100644 --- a/ofborg/src/ghevent/mod.rs +++ b/ofborg/src/ghevent/mod.rs @@ -1,5 +1,7 @@ mod common; mod issuecomment; +mod pullrequestevent; pub use self::issuecomment::IssueComment; -pub use self::common::{Issue, Repository, User, Comment, PullRequest}; +pub use self::pullrequestevent::{PullRequest, PullRequestEvent, PullRequestAction, PullRequestState}; +pub use self::common::{Issue, Repository, User, Comment}; diff --git a/ofborg/src/ghevent/pullrequestevent.rs b/ofborg/src/ghevent/pullrequestevent.rs new file mode 100644 index 0000000..11f685c --- /dev/null +++ b/ofborg/src/ghevent/pullrequestevent.rs @@ -0,0 +1,80 @@ +use ofborg::ghevent::{Repository}; + +#[derive(Serialize, Deserialize)] +pub struct PullRequestEvent { + pub action: PullRequestAction, + pub number: u64, + pub repository: Repository, + pub pull_request: PullRequest, + pub changes: Option, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct PullRequestChanges { + pub base: Option, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct BaseChange { + #[serde(rename="ref")] + pub git_ref: ChangeWas, + pub sha: ChangeWas, +} + +#[derive(Serialize, Deserialize, Debug, PartialEq)] +pub struct ChangeWas { + pub from: String, +} + +#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[serde(rename_all="snake_case")] +pub enum PullRequestState { + Open, + Closed, +} + +#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[serde(rename_all="snake_case")] +pub enum PullRequestAction { + Assigned, + Unassigned, + ReviewRequested, + ReviewRequestRemoved, + Labeled, + Unlabeled, + Opened, + Edited, + Closed, + Reopened, + Synchronize, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct PullRequestRef { + #[serde(rename="ref")] + pub git_ref: String, + pub sha: String, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct PullRequest { + pub state: PullRequestState, + pub base: PullRequestRef, + pub head: PullRequestRef, +} + + +#[cfg(test)] +mod tests { + use super::*; + use serde_json; + + #[test] + fn test_parse_pr_event() { + let data = include_str!("../../test-srcs/events/pr-changed-base.json"); + + let _p: PullRequestEvent = + serde_json::from_str(&data.to_string()) + .expect("Should properly deserialize"); + } +} diff --git a/ofborg/src/lib.rs b/ofborg/src/lib.rs index 509efa1..f7c6fee 100644 --- a/ofborg/src/lib.rs +++ b/ofborg/src/lib.rs @@ -1,6 +1,12 @@ + +#![recursion_limit="512"] + #[macro_use] extern crate serde_derive; extern crate serde; + + +#[cfg_attr(test, macro_use)] extern crate serde_json; #[macro_use] diff --git a/ofborg/src/tasks/evaluationfilter.rs b/ofborg/src/tasks/evaluationfilter.rs new file mode 100644 index 0000000..95f8fab --- /dev/null +++ b/ofborg/src/tasks/evaluationfilter.rs @@ -0,0 +1,156 @@ +extern crate amqp; +extern crate env_logger; + +use ofborg::ghevent; +use ofborg::acl; +use serde_json; + +use ofborg::message::{Repo, Pr, massrebuildjob}; +use ofborg::worker; +use amqp::protocol::basic::{Deliver, BasicProperties}; + + +pub struct EvaluationFilterWorker { + acl: acl::ACL, +} + + impl EvaluationFilterWorker { + pub fn new(acl: acl::ACL) -> EvaluationFilterWorker { + return EvaluationFilterWorker { + acl: acl, + }; + } +} + +impl worker::SimpleWorker for EvaluationFilterWorker { + type J = ghevent::PullRequestEvent; + + fn msg_to_job( + &mut self, + _: &Deliver, + _: &BasicProperties, + body: &Vec, + ) -> Result { + return match serde_json::from_slice(body) { + Ok(e) => Ok(e), + Err(e) => { + Err(format!( + "Failed to deserialize job {:?}: {:?}", + e, + String::from_utf8(body.clone()) + )) + } + }; + } + + fn consumer(&mut self, job: &ghevent::PullRequestEvent) -> worker::Actions { + if !self.acl.is_repo_eligible(&job.repository.full_name) { + info!("Repo not authorized ({})", job.repository.full_name); + return vec![worker::Action::Ack]; + } + + if job.pull_request.state != ghevent::PullRequestState::Open { + info!("PR is not open ({}#{})", job.repository.full_name, job.number); + return vec![worker::Action::Ack]; + } + + let interesting: bool = match job.action { + ghevent::PullRequestAction::Opened => true, + ghevent::PullRequestAction::Synchronize => true, + ghevent::PullRequestAction::Reopened => true, + ghevent::PullRequestAction::Edited => { + if let Some(ref changes) = job.changes { + changes.base.is_some() + } else { + false + } + }, + _ => false, + }; + + if !interesting { + info!("Not interesting: {}#{} because of {:?}", + job.repository.full_name, job.number, job.action + ); + + return vec![ + worker::Action::Ack + ]; + } + + info!("Found {}#{} to be interesting because of {:?}", + job.repository.full_name, job.number, job.action + ); + let repo_msg = Repo { + clone_url: job.repository.clone_url.clone(), + full_name: job.repository.full_name.clone(), + owner: job.repository.owner.login.clone(), + name: job.repository.name.clone(), + }; + + let pr_msg = Pr { + number: job.number.clone(), + head_sha: job.pull_request.head.sha.clone(), + target_branch: Some(job.pull_request.base.git_ref.clone()), + }; + + let msg = massrebuildjob::MassRebuildJob { + repo: repo_msg.clone(), + pr: pr_msg.clone(), + }; + + return vec![ + worker::publish_serde_action( + None, + Some("mass-rebuild-check-jobs".to_owned()), + &msg + ), + worker::Action::Ack + ]; + } +} + +#[cfg(test)] +mod tests { + use worker::SimpleWorker; + use super::*; + + #[test] + fn changed_base() { + let data = include_str!("../../test-srcs/events/pr-changed-base.json"); + + let job: ghevent::PullRequestEvent = + serde_json::from_str(&data.to_string()) + .expect("Should properly deserialize"); + + let mut worker = EvaluationFilterWorker::new(acl::ACL::new( + vec!["nixos/nixpkgs".to_owned()], + vec![], + vec![], + )); + + assert_eq!( + worker.consumer(&job), + vec![ + worker::publish_serde_action( + None, + Some("mass-rebuild-check-jobs".to_owned()), + &massrebuildjob::MassRebuildJob { + repo: Repo { + clone_url: String::from("https://github.com/NixOS/nixpkgs.git"), + full_name: String::from("NixOS/nixpkgs"), + owner: String::from("NixOS"), + name: String::from("nixpkgs"), + }, + pr: Pr { + number: 33299, + head_sha: String::from("887e8b460a7d45ddb3bbdebe01447b251b3229e8"), + target_branch: Some(String::from("staging")), + }, + } + ), + worker::Action::Ack, + ] + ); + } +} diff --git a/ofborg/src/tasks/mod.rs b/ofborg/src/tasks/mod.rs index 663bab6..531e981 100644 --- a/ofborg/src/tasks/mod.rs +++ b/ofborg/src/tasks/mod.rs @@ -5,3 +5,4 @@ pub mod githubcommentfilter; pub mod githubcommentposter; pub mod statscollector; pub mod log_message_collector; +pub mod evaluationfilter; diff --git a/ofborg/test-srcs/events/pr-changed-base.json b/ofborg/test-srcs/events/pr-changed-base.json new file mode 100644 index 0000000..6846bf8 --- /dev/null +++ b/ofborg/test-srcs/events/pr-changed-base.json @@ -0,0 +1,484 @@ +{ + "action": "edited", + "number": 33299, + "pull_request": { + "url": "https://api.github.com/repos/NixOS/nixpkgs/pulls/33299", + "id": 160662893, + "html_url": "https://github.com/NixOS/nixpkgs/pull/33299", + "diff_url": "https://github.com/NixOS/nixpkgs/pull/33299.diff", + "patch_url": "https://github.com/NixOS/nixpkgs/pull/33299.patch", + "issue_url": "https://api.github.com/repos/NixOS/nixpkgs/issues/33299", + "number": 33299, + "state": "open", + "locked": false, + "title": "NixOS Tests: record an flv of the test", + "user": { + "login": "grahamc", + "id": 76716, + "avatar_url": "https://avatars3.githubusercontent.com/u/76716?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/grahamc", + "html_url": "https://github.com/grahamc", + "followers_url": "https://api.github.com/users/grahamc/followers", + "following_url": "https://api.github.com/users/grahamc/following{/other_user}", + "gists_url": "https://api.github.com/users/grahamc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/grahamc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/grahamc/subscriptions", + "organizations_url": "https://api.github.com/users/grahamc/orgs", + "repos_url": "https://api.github.com/users/grahamc/repos", + "events_url": "https://api.github.com/users/grahamc/events{/privacy}", + "received_events_url": "https://api.github.com/users/grahamc/received_events", + "type": "User", + "site_admin": false + }, + "body": "###### Motivation for this change\r\n\r\nSometimes tests can be hard to debug. Maybe recording an FLV from the VNC could help with that? To start, enable the recording on the flaky keymap test.\r\n\r\n###### Things done\r\n\r\n\r\n\r\n- [ ] Tested using sandboxing ([nix.useSandbox](http://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS, or option `build-use-sandbox` in [`nix.conf`](http://nixos.org/nix/manual/#sec-conf-file) on non-NixOS)\r\n- Built on platform(s)\r\n - [ ] NixOS\r\n - [ ] macOS\r\n - [ ] other Linux distributions\r\n- [ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside [nixos/tests](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests))\r\n- [ ] Tested compilation of all pkgs that depend on this change using `nix-shell -p nox --run \"nox-review wip\"`\r\n- [ ] Tested execution of all binary files (usually in `./result/bin/`)\r\n- [ ] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md).\r\n\r\n---\r\n\r\n", + "created_at": "2018-01-01T22:39:24Z", + "updated_at": "2018-02-23T21:48:19Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "e145dffca8579ca8fac15497af5f166d1e1197a4", + "assignee": null, + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [ + { + "id": 737642262, + "url": "https://api.github.com/repos/NixOS/nixpkgs/labels/10.rebuild-darwin:%200", + "name": "10.rebuild-darwin: 0", + "color": "eeffee", + "default": false + }, + { + "id": 737642408, + "url": "https://api.github.com/repos/NixOS/nixpkgs/labels/10.rebuild-linux:%200", + "name": "10.rebuild-linux: 0", + "color": "eeffee", + "default": false + } + ], + "milestone": null, + "commits_url": "https://api.github.com/repos/NixOS/nixpkgs/pulls/33299/commits", + "review_comments_url": "https://api.github.com/repos/NixOS/nixpkgs/pulls/33299/comments", + "review_comment_url": "https://api.github.com/repos/NixOS/nixpkgs/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/NixOS/nixpkgs/issues/33299/comments", + "statuses_url": "https://api.github.com/repos/NixOS/nixpkgs/statuses/887e8b460a7d45ddb3bbdebe01447b251b3229e8", + "head": { + "label": "grahamc:flv-nixos-tests", + "ref": "flv-nixos-tests", + "sha": "887e8b460a7d45ddb3bbdebe01447b251b3229e8", + "user": { + "login": "grahamc", + "id": 76716, + "avatar_url": "https://avatars3.githubusercontent.com/u/76716?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/grahamc", + "html_url": "https://github.com/grahamc", + "followers_url": "https://api.github.com/users/grahamc/followers", + "following_url": "https://api.github.com/users/grahamc/following{/other_user}", + "gists_url": "https://api.github.com/users/grahamc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/grahamc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/grahamc/subscriptions", + "organizations_url": "https://api.github.com/users/grahamc/orgs", + "repos_url": "https://api.github.com/users/grahamc/repos", + "events_url": "https://api.github.com/users/grahamc/events{/privacy}", + "received_events_url": "https://api.github.com/users/grahamc/received_events", + "type": "User", + "site_admin": false + }, + "repo": { + "id": 52226505, + "name": "nixpkgs", + "full_name": "grahamc/nixpkgs", + "owner": { + "login": "grahamc", + "id": 76716, + "avatar_url": "https://avatars3.githubusercontent.com/u/76716?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/grahamc", + "html_url": "https://github.com/grahamc", + "followers_url": "https://api.github.com/users/grahamc/followers", + "following_url": "https://api.github.com/users/grahamc/following{/other_user}", + "gists_url": "https://api.github.com/users/grahamc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/grahamc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/grahamc/subscriptions", + "organizations_url": "https://api.github.com/users/grahamc/orgs", + "repos_url": "https://api.github.com/users/grahamc/repos", + "events_url": "https://api.github.com/users/grahamc/events{/privacy}", + "received_events_url": "https://api.github.com/users/grahamc/received_events", + "type": "User", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/grahamc/nixpkgs", + "description": "Nix Packages collection", + "fork": true, + "url": "https://api.github.com/repos/grahamc/nixpkgs", + "forks_url": "https://api.github.com/repos/grahamc/nixpkgs/forks", + "keys_url": "https://api.github.com/repos/grahamc/nixpkgs/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/grahamc/nixpkgs/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/grahamc/nixpkgs/teams", + "hooks_url": "https://api.github.com/repos/grahamc/nixpkgs/hooks", + "issue_events_url": "https://api.github.com/repos/grahamc/nixpkgs/issues/events{/number}", + "events_url": "https://api.github.com/repos/grahamc/nixpkgs/events", + "assignees_url": "https://api.github.com/repos/grahamc/nixpkgs/assignees{/user}", + "branches_url": "https://api.github.com/repos/grahamc/nixpkgs/branches{/branch}", + "tags_url": "https://api.github.com/repos/grahamc/nixpkgs/tags", + "blobs_url": "https://api.github.com/repos/grahamc/nixpkgs/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/grahamc/nixpkgs/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/grahamc/nixpkgs/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/grahamc/nixpkgs/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/grahamc/nixpkgs/statuses/{sha}", + "languages_url": "https://api.github.com/repos/grahamc/nixpkgs/languages", + "stargazers_url": "https://api.github.com/repos/grahamc/nixpkgs/stargazers", + "contributors_url": "https://api.github.com/repos/grahamc/nixpkgs/contributors", + "subscribers_url": "https://api.github.com/repos/grahamc/nixpkgs/subscribers", + "subscription_url": "https://api.github.com/repos/grahamc/nixpkgs/subscription", + "commits_url": "https://api.github.com/repos/grahamc/nixpkgs/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/grahamc/nixpkgs/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/grahamc/nixpkgs/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/grahamc/nixpkgs/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/grahamc/nixpkgs/contents/{+path}", + "compare_url": "https://api.github.com/repos/grahamc/nixpkgs/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/grahamc/nixpkgs/merges", + "archive_url": "https://api.github.com/repos/grahamc/nixpkgs/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/grahamc/nixpkgs/downloads", + "issues_url": "https://api.github.com/repos/grahamc/nixpkgs/issues{/number}", + "pulls_url": "https://api.github.com/repos/grahamc/nixpkgs/pulls{/number}", + "milestones_url": "https://api.github.com/repos/grahamc/nixpkgs/milestones{/number}", + "notifications_url": "https://api.github.com/repos/grahamc/nixpkgs/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/grahamc/nixpkgs/labels{/name}", + "releases_url": "https://api.github.com/repos/grahamc/nixpkgs/releases{/id}", + "deployments_url": "https://api.github.com/repos/grahamc/nixpkgs/deployments", + "created_at": "2016-02-21T20:31:54Z", + "updated_at": "2017-05-07T04:44:29Z", + "pushed_at": "2018-01-01T22:35:52Z", + "git_url": "git://github.com/grahamc/nixpkgs.git", + "ssh_url": "git@github.com:grahamc/nixpkgs.git", + "clone_url": "https://github.com/grahamc/nixpkgs.git", + "svn_url": "https://github.com/grahamc/nixpkgs", + "homepage": null, + "size": 627435, + "stargazers_count": 1, + "watchers_count": 1, + "language": "Nix", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "open_issues_count": 1, + "license": { + "key": "other", + "name": "Other", + "spdx_id": null, + "url": null + }, + "forks": 0, + "open_issues": 1, + "watchers": 1, + "default_branch": "master" + } + }, + "base": { + "label": "NixOS:staging", + "ref": "staging", + "sha": "19784ca4c9ac378539bdc535b02ae673ba6ba0b0", + "user": { + "login": "NixOS", + "id": 487568, + "avatar_url": "https://avatars3.githubusercontent.com/u/487568?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/NixOS", + "html_url": "https://github.com/NixOS", + "followers_url": "https://api.github.com/users/NixOS/followers", + "following_url": "https://api.github.com/users/NixOS/following{/other_user}", + "gists_url": "https://api.github.com/users/NixOS/gists{/gist_id}", + "starred_url": "https://api.github.com/users/NixOS/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/NixOS/subscriptions", + "organizations_url": "https://api.github.com/users/NixOS/orgs", + "repos_url": "https://api.github.com/users/NixOS/repos", + "events_url": "https://api.github.com/users/NixOS/events{/privacy}", + "received_events_url": "https://api.github.com/users/NixOS/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 4542716, + "name": "nixpkgs", + "full_name": "NixOS/nixpkgs", + "owner": { + "login": "NixOS", + "id": 487568, + "avatar_url": "https://avatars3.githubusercontent.com/u/487568?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/NixOS", + "html_url": "https://github.com/NixOS", + "followers_url": "https://api.github.com/users/NixOS/followers", + "following_url": "https://api.github.com/users/NixOS/following{/other_user}", + "gists_url": "https://api.github.com/users/NixOS/gists{/gist_id}", + "starred_url": "https://api.github.com/users/NixOS/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/NixOS/subscriptions", + "organizations_url": "https://api.github.com/users/NixOS/orgs", + "repos_url": "https://api.github.com/users/NixOS/repos", + "events_url": "https://api.github.com/users/NixOS/events{/privacy}", + "received_events_url": "https://api.github.com/users/NixOS/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/NixOS/nixpkgs", + "description": "Nix Packages collection", + "fork": false, + "url": "https://api.github.com/repos/NixOS/nixpkgs", + "forks_url": "https://api.github.com/repos/NixOS/nixpkgs/forks", + "keys_url": "https://api.github.com/repos/NixOS/nixpkgs/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/NixOS/nixpkgs/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/NixOS/nixpkgs/teams", + "hooks_url": "https://api.github.com/repos/NixOS/nixpkgs/hooks", + "issue_events_url": "https://api.github.com/repos/NixOS/nixpkgs/issues/events{/number}", + "events_url": "https://api.github.com/repos/NixOS/nixpkgs/events", + "assignees_url": "https://api.github.com/repos/NixOS/nixpkgs/assignees{/user}", + "branches_url": "https://api.github.com/repos/NixOS/nixpkgs/branches{/branch}", + "tags_url": "https://api.github.com/repos/NixOS/nixpkgs/tags", + "blobs_url": "https://api.github.com/repos/NixOS/nixpkgs/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/NixOS/nixpkgs/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/NixOS/nixpkgs/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/NixOS/nixpkgs/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/NixOS/nixpkgs/statuses/{sha}", + "languages_url": "https://api.github.com/repos/NixOS/nixpkgs/languages", + "stargazers_url": "https://api.github.com/repos/NixOS/nixpkgs/stargazers", + "contributors_url": "https://api.github.com/repos/NixOS/nixpkgs/contributors", + "subscribers_url": "https://api.github.com/repos/NixOS/nixpkgs/subscribers", + "subscription_url": "https://api.github.com/repos/NixOS/nixpkgs/subscription", + "commits_url": "https://api.github.com/repos/NixOS/nixpkgs/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/NixOS/nixpkgs/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/NixOS/nixpkgs/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/NixOS/nixpkgs/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/NixOS/nixpkgs/contents/{+path}", + "compare_url": "https://api.github.com/repos/NixOS/nixpkgs/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/NixOS/nixpkgs/merges", + "archive_url": "https://api.github.com/repos/NixOS/nixpkgs/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/NixOS/nixpkgs/downloads", + "issues_url": "https://api.github.com/repos/NixOS/nixpkgs/issues{/number}", + "pulls_url": "https://api.github.com/repos/NixOS/nixpkgs/pulls{/number}", + "milestones_url": "https://api.github.com/repos/NixOS/nixpkgs/milestones{/number}", + "notifications_url": "https://api.github.com/repos/NixOS/nixpkgs/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/NixOS/nixpkgs/labels{/name}", + "releases_url": "https://api.github.com/repos/NixOS/nixpkgs/releases{/id}", + "deployments_url": "https://api.github.com/repos/NixOS/nixpkgs/deployments", + "created_at": "2012-06-04T02:49:46Z", + "updated_at": "2018-02-23T20:56:05Z", + "pushed_at": "2018-02-23T21:40:58Z", + "git_url": "git://github.com/NixOS/nixpkgs.git", + "ssh_url": "git@github.com:NixOS/nixpkgs.git", + "clone_url": "https://github.com/NixOS/nixpkgs.git", + "svn_url": "https://github.com/NixOS/nixpkgs", + "homepage": null, + "size": 724069, + "stargazers_count": 2239, + "watchers_count": 2239, + "language": "Nix", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2580, + "mirror_url": null, + "archived": false, + "open_issues_count": 2860, + "license": { + "key": "other", + "name": "Other", + "spdx_id": null, + "url": null + }, + "forks": 2580, + "open_issues": 2860, + "watchers": 2239, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/NixOS/nixpkgs/pulls/33299" + }, + "html": { + "href": "https://github.com/NixOS/nixpkgs/pull/33299" + }, + "issue": { + "href": "https://api.github.com/repos/NixOS/nixpkgs/issues/33299" + }, + "comments": { + "href": "https://api.github.com/repos/NixOS/nixpkgs/issues/33299/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/NixOS/nixpkgs/pulls/33299/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/NixOS/nixpkgs/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/NixOS/nixpkgs/pulls/33299/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/NixOS/nixpkgs/statuses/887e8b460a7d45ddb3bbdebe01447b251b3229e8" + } + }, + "author_association": "MEMBER", + "merged": false, + "mergeable": null, + "rebaseable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 5, + "review_comments": 0, + "maintainer_can_modify": true, + "commits": 1, + "additions": 41, + "deletions": 4, + "changed_files": 4 + }, + "changes": { + "base": { + "ref": { + "from": "master" + }, + "sha": { + "from": "a6664d8192038c4dc2ad44169dbb76556fe71ac1" + } + } + }, + "repository": { + "id": 4542716, + "name": "nixpkgs", + "full_name": "NixOS/nixpkgs", + "owner": { + "login": "NixOS", + "id": 487568, + "avatar_url": "https://avatars3.githubusercontent.com/u/487568?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/NixOS", + "html_url": "https://github.com/NixOS", + "followers_url": "https://api.github.com/users/NixOS/followers", + "following_url": "https://api.github.com/users/NixOS/following{/other_user}", + "gists_url": "https://api.github.com/users/NixOS/gists{/gist_id}", + "starred_url": "https://api.github.com/users/NixOS/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/NixOS/subscriptions", + "organizations_url": "https://api.github.com/users/NixOS/orgs", + "repos_url": "https://api.github.com/users/NixOS/repos", + "events_url": "https://api.github.com/users/NixOS/events{/privacy}", + "received_events_url": "https://api.github.com/users/NixOS/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/NixOS/nixpkgs", + "description": "Nix Packages collection", + "fork": false, + "url": "https://api.github.com/repos/NixOS/nixpkgs", + "forks_url": "https://api.github.com/repos/NixOS/nixpkgs/forks", + "keys_url": "https://api.github.com/repos/NixOS/nixpkgs/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/NixOS/nixpkgs/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/NixOS/nixpkgs/teams", + "hooks_url": "https://api.github.com/repos/NixOS/nixpkgs/hooks", + "issue_events_url": "https://api.github.com/repos/NixOS/nixpkgs/issues/events{/number}", + "events_url": "https://api.github.com/repos/NixOS/nixpkgs/events", + "assignees_url": "https://api.github.com/repos/NixOS/nixpkgs/assignees{/user}", + "branches_url": "https://api.github.com/repos/NixOS/nixpkgs/branches{/branch}", + "tags_url": "https://api.github.com/repos/NixOS/nixpkgs/tags", + "blobs_url": "https://api.github.com/repos/NixOS/nixpkgs/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/NixOS/nixpkgs/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/NixOS/nixpkgs/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/NixOS/nixpkgs/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/NixOS/nixpkgs/statuses/{sha}", + "languages_url": "https://api.github.com/repos/NixOS/nixpkgs/languages", + "stargazers_url": "https://api.github.com/repos/NixOS/nixpkgs/stargazers", + "contributors_url": "https://api.github.com/repos/NixOS/nixpkgs/contributors", + "subscribers_url": "https://api.github.com/repos/NixOS/nixpkgs/subscribers", + "subscription_url": "https://api.github.com/repos/NixOS/nixpkgs/subscription", + "commits_url": "https://api.github.com/repos/NixOS/nixpkgs/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/NixOS/nixpkgs/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/NixOS/nixpkgs/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/NixOS/nixpkgs/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/NixOS/nixpkgs/contents/{+path}", + "compare_url": "https://api.github.com/repos/NixOS/nixpkgs/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/NixOS/nixpkgs/merges", + "archive_url": "https://api.github.com/repos/NixOS/nixpkgs/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/NixOS/nixpkgs/downloads", + "issues_url": "https://api.github.com/repos/NixOS/nixpkgs/issues{/number}", + "pulls_url": "https://api.github.com/repos/NixOS/nixpkgs/pulls{/number}", + "milestones_url": "https://api.github.com/repos/NixOS/nixpkgs/milestones{/number}", + "notifications_url": "https://api.github.com/repos/NixOS/nixpkgs/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/NixOS/nixpkgs/labels{/name}", + "releases_url": "https://api.github.com/repos/NixOS/nixpkgs/releases{/id}", + "deployments_url": "https://api.github.com/repos/NixOS/nixpkgs/deployments", + "created_at": "2012-06-04T02:49:46Z", + "updated_at": "2018-02-23T20:56:05Z", + "pushed_at": "2018-02-23T21:40:58Z", + "git_url": "git://github.com/NixOS/nixpkgs.git", + "ssh_url": "git@github.com:NixOS/nixpkgs.git", + "clone_url": "https://github.com/NixOS/nixpkgs.git", + "svn_url": "https://github.com/NixOS/nixpkgs", + "homepage": null, + "size": 724069, + "stargazers_count": 2239, + "watchers_count": 2239, + "language": "Nix", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2580, + "mirror_url": null, + "archived": false, + "open_issues_count": 2860, + "license": { + "key": "other", + "name": "Other", + "spdx_id": null, + "url": null + }, + "forks": 2580, + "open_issues": 2860, + "watchers": 2239, + "default_branch": "master" + }, + "organization": { + "login": "NixOS", + "id": 487568, + "url": "https://api.github.com/orgs/NixOS", + "repos_url": "https://api.github.com/orgs/NixOS/repos", + "events_url": "https://api.github.com/orgs/NixOS/events", + "hooks_url": "https://api.github.com/orgs/NixOS/hooks", + "issues_url": "https://api.github.com/orgs/NixOS/issues", + "members_url": "https://api.github.com/orgs/NixOS/members{/member}", + "public_members_url": "https://api.github.com/orgs/NixOS/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/487568?v=4", + "description": "" + }, + "sender": { + "login": "grahamc", + "id": 76716, + "avatar_url": "https://avatars3.githubusercontent.com/u/76716?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/grahamc", + "html_url": "https://github.com/grahamc", + "followers_url": "https://api.github.com/users/grahamc/followers", + "following_url": "https://api.github.com/users/grahamc/following{/other_user}", + "gists_url": "https://api.github.com/users/grahamc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/grahamc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/grahamc/subscriptions", + "organizations_url": "https://api.github.com/users/grahamc/orgs", + "repos_url": "https://api.github.com/users/grahamc/repos", + "events_url": "https://api.github.com/users/grahamc/events{/privacy}", + "received_events_url": "https://api.github.com/users/grahamc/received_events", + "type": "User", + "site_admin": false + } + } diff --git a/php/composer.json b/php/composer.json index df67e8b..3928836 100644 --- a/php/composer.json +++ b/php/composer.json @@ -1,11 +1,5 @@ { "require": { - "php-amqplib/php-amqplib": ">=2.6.1", - "knplabs/github-api": "^2.6@dev", - "php-http/guzzle6-adapter": "^1.2@dev" - }, - "minimum-stability": "dev", - "autoload": { - "psr-4": {"GHE\\": "src/"} + "php-amqplib/php-amqplib": ">=2.6.1" } } diff --git a/php/composer.lock b/php/composer.lock index a453b7f..351ea07 100644 --- a/php/composer.lock +++ b/php/composer.lock @@ -4,321 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "0ee26122485b777e3ea752a8d5da0c61", + "content-hash": "f0b42ac9169509834501cb7aa271b580", "packages": [ - { - "name": "clue/stream-filter", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/clue/php-stream-filter.git", - "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", - "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Clue\\StreamFilter\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@lueck.tv" - } - ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", - "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" - ], - "time": "2017-08-18T09:54:01+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2017-06-22T18:50:49+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "2e48ae638dc0bf0849772f5590835fcd700a2e1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/2e48ae638dc0bf0849772f5590835fcd700a2e1d", - "reference": "2e48ae638dc0bf0849772f5590835fcd700a2e1d", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2017-12-07T21:04:15+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "d2537c86fa8b004c29e9b9f5e10028f0a29df101" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/d2537c86fa8b004c29e9b9f5e10028f0a29df101", - "reference": "d2537c86fa8b004c29e9b9f5e10028f0a29df101", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-10-07T03:19:56+00:00" - }, - { - "name": "knplabs/github-api", - "version": "2.7.0", - "source": { - "type": "git", - "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "d445f1eec4788763315c3c96a214db4e149f9deb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/d445f1eec4788763315c3c96a214db4e149f9deb", - "reference": "d445f1eec4788763315c3c96a214db4e149f9deb", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0", - "php-http/cache-plugin": "^1.4", - "php-http/client-common": "^1.3", - "php-http/client-implementation": "^1.0", - "php-http/discovery": "^1.0", - "php-http/httplug": "^1.1", - "psr/cache": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "cache/array-adapter": "^0.4", - "guzzlehttp/psr7": "^1.2", - "php-http/guzzle6-adapter": "^1.0", - "php-http/mock-client": "^1.0", - "phpunit/phpunit": "^5.5 || ^6.0", - "sllh/php-cs-fixer-styleci-bridge": "^1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "Github\\": "lib/Github/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Thibault Duplessis", - "email": "thibault.duplessis@gmail.com", - "homepage": "http://ornicar.github.com" - }, - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" - } - ], - "description": "GitHub API v3 client", - "homepage": "https://github.com/KnpLabs/php-github-api", - "keywords": [ - "api", - "gh", - "gist", - "github" - ], - "time": "2017-12-12T20:14:04+00:00" - }, { "name": "php-amqplib/php-amqplib", - "version": "dev-master", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/php-amqplib/php-amqplib.git", - "reference": "0f90b3d8bc50403458f0eefbcba7d1e2329dd0f6" + "reference": "dfd3694a86f1a7394d3693485259d4074a6ec79b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/0f90b3d8bc50403458f0eefbcba7d1e2329dd0f6", - "reference": "0f90b3d8bc50403458f0eefbcba7d1e2329dd0f6", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/dfd3694a86f1a7394d3693485259d4074a6ec79b", + "reference": "dfd3694a86f1a7394d3693485259d4074a6ec79b", "shasum": "" }, "require": { @@ -330,6 +29,7 @@ "videlalvaro/php-amqplib": "self.version" }, "require-dev": { + "phpdocumentor/phpdocumentor": "^2.9", "phpunit/phpunit": "^4.8", "scrutinizer/ocular": "^1.1", "squizlabs/php_codesniffer": "^2.5" @@ -350,7 +50,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.1" + "LGPL-2.1-or-later" ], "authors": [ { @@ -375,633 +75,13 @@ "queue", "rabbitmq" ], - "time": "2017-09-26T05:30:15+00:00" - }, - { - "name": "php-http/cache-plugin", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-http/cache-plugin.git", - "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/c573ac6ea9b4e33fad567f875b844229d18000b9", - "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9", - "shasum": "" - }, - "require": { - "php": "^5.4 || ^7.0", - "php-http/client-common": "^1.1", - "php-http/message-factory": "^1.0", - "psr/cache": "^1.0", - "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" - }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\Plugin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "PSR-6 Cache plugin for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "cache", - "http", - "httplug", - "plugin" - ], - "time": "2017-11-29T20:45:41+00:00" - }, - { - "name": "php-http/client-common", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/9accb4a082eb06403747c0ffd444112eda41a0fd", - "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd", - "shasum": "" - }, - "require": { - "php": "^5.4 || ^7.0", - "php-http/httplug": "^1.1", - "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", - "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" - }, - "require-dev": { - "guzzlehttp/psr7": "^1.4", - "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" - }, - "suggest": { - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "common", - "http", - "httplug" - ], - "time": "2017-11-30T11:06:59+00:00" - }, - { - "name": "php-http/discovery", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-http/discovery.git", - "reference": "0ecc08360e6011a4454dc60077db6e9f412be94c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/0ecc08360e6011a4454dc60077db6e9f412be94c", - "reference": "0ecc08360e6011a4454dc60077db6e9f412be94c", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0" - }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^2.0.2", - "php-http/httplug": "^1.0", - "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^2.4", - "puli/composer-plugin": "1.0.0-beta10" - }, - "suggest": { - "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", - "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Discovery\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Finds installed HTTPlug implementations and PSR-7 message factories", - "homepage": "http://php-http.org", - "keywords": [ - "adapter", - "client", - "discovery", - "factory", - "http", - "message", - "psr7" - ], - "time": "2017-11-22T21:17:04+00:00" - }, - { - "name": "php-http/guzzle6-adapter", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-http/guzzle6-adapter.git", - "reference": "54181ff8455a4c2e1706a53e0d98060b93030321" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/54181ff8455a4c2e1706a53e0d98060b93030321", - "reference": "54181ff8455a4c2e1706a53e0d98060b93030321", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.0", - "php": "^5.5 || ^7.0", - "php-http/httplug": "^1.0" - }, - "provide": { - "php-http/async-client-implementation": "1.0", - "php-http/client-implementation": "1.0" - }, - "require-dev": { - "ext-curl": "*", - "php-http/client-integration-tests": "^0.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Adapter\\Guzzle6\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, - { - "name": "David de Boer", - "email": "david@ddeboer.nl" - } - ], - "description": "Guzzle 6 HTTP Adapter", - "homepage": "http://httplug.io", - "keywords": [ - "Guzzle", - "http" - ], - "time": "2017-05-29T15:06:15+00:00" - }, - { - "name": "php-http/httplug", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "afa7b216322f8157e21025f04f72eda0ee12f89d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/afa7b216322f8157e21025f04f72eda0ee12f89d", - "reference": "afa7b216322f8157e21025f04f72eda0ee12f89d", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "php-http/promise": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "time": "2017-12-18T08:01:36+00:00" - }, - { - "name": "php-http/message", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "977edb516e3c0419d3477610b4b718c8a9da1575" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/977edb516e3c0419d3477610b4b718c8a9da1575", - "reference": "977edb516e3c0419d3477610b4b718c8a9da1575", - "shasum": "" - }, - "require": { - "clue/stream-filter": "^1.4", - "php": ">=5.4", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "akeneo/phpspec-skip-example-extension": "^1.0", - "coduo/phpspec-data-provider-extension": "^1.0", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4", - "slim/slim": "^3.0", - "zendframework/zend-diactoros": "^1.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation", - "zendframework/zend-diactoros": "Used with Diactoros Factories" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - }, - "files": [ - "src/filters.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", - "keywords": [ - "http", - "message", - "psr-7" - ], - "time": "2017-11-25T06:38:46+00:00" - }, - { - "name": "php-http/message-factory", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "a2809d4fe294ebe8879aec8d4d5bf21faa029344" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a2809d4fe294ebe8879aec8d4d5bf21faa029344", - "reference": "a2809d4fe294ebe8879aec8d4d5bf21faa029344", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "time": "2016-02-03T08:16:31+00:00" - }, - { - "name": "php-http/promise", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "1cc44dc01402d407fc6da922591deebe4659826f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/1cc44dc01402d407fc6da922591deebe4659826f", - "reference": "1cc44dc01402d407fc6da922591deebe4659826f", - "shasum": "" - }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - } - ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], - "time": "2017-11-22T21:24:54+00:00" - }, - { - "name": "psr/cache", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "78c5a01ddbf11cf731f1338a4f5aba23b14d5b47" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/78c5a01ddbf11cf731f1338a4f5aba23b14d5b47", - "reference": "78c5a01ddbf11cf731f1338a4f5aba23b14d5b47", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "time": "2016-10-13T14:48:10+00:00" - }, - { - "name": "psr/http-message", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "95a16ad04c0ca3404c9286eca3b4a0c36cc46f7d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/95a16ad04c0ca3404c9286eca3b4a0c36cc46f7d", - "reference": "95a16ad04c0ca3404c9286eca3b4a0c36cc46f7d", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony OptionsResolver Component", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "time": "2017-12-14T19:50:39+00:00" + "time": "2018-02-11T19:28:00+00:00" } ], "packages-dev": [], "aliases": [], - "minimum-stability": "dev", - "stability-flags": { - "knplabs/github-api": 20, - "php-http/guzzle6-adapter": 20 - }, + "minimum-stability": "stable", + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/php/mass-rebuild-filter.php b/php/mass-rebuild-filter.php deleted file mode 100644 index a73ba29..0000000 --- a/php/mass-rebuild-filter.php +++ /dev/null @@ -1,113 +0,0 @@ -channel(); -$channel->basic_qos(null, 1, true); - - -$channel->queue_declare('mass-rebuild-check-jobs', - false, true, false, false); -list($queueName, , ) = $channel->queue_declare('mass-rebuild-check-inputs', - false, true, false, false); -$channel->queue_bind($queueName, 'github-events', 'pull_request.nixos/nixpkgs'); - -echo "hi\n"; - -function outrunner($msg) { - try { - runner($msg); - } catch (\PhpAmqpLib\Exception\AMQPProtocolChannelException $e) { - echo "Channel exception:\n"; - var_dump($e); - } -} - -function runner($msg) { - echo "Msg Sha: " . md5($msg->body) . "\n"; - $in = json_decode($msg->body); - - if (!\GHE\ACL::isRepoEligible($in->repository->full_name)) { - echo "Repo not authorized (" . $in->repository->full_name . ")\n"; - $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); - return true; - } - - if ($in->pull_request->state != "open") { - echo "PR isn't open in the event\n"; - $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); - return true; - } - - $client = gh_client(); - $status = $client->api('pull_request')->show( - $in->repository->owner->login, - $in->repository->name, - $in->number); - if ($status['mergeable'] === false) { - echo "github says the PR isn't able to be merged\n"; - $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); - return true; - } - if ($status['state'] !== 'open') { - echo "github says the PR isn't open\n"; - $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); - return true; - } - - - $ok_events = [ - 'opened', - 'created', - 'synchronize', - 'reopened', - ]; - - if (!in_array($in->action, $ok_events)) { - echo "Uninteresting event " . $in->action . "\n"; - $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); - return true; - } else { - echo "so-called interesting event on #" . $in->number . ": " . $in->action . "\n"; - } - - $forward = [ - 'original_payload' => $in, - 'repo' => [ - 'owner' => $in->repository->owner->login, - 'name' => $in->repository->name, - 'full_name' => $in->repository->full_name, - 'clone_url' => $in->repository->clone_url, - ], - 'pr' => [ - 'number' => $in->number, - 'target_branch' => $in->pull_request->base->ref, - 'patch_url' => $in->pull_request->patch_url, - 'head_sha' => $in->pull_request->head->sha, - ], - ]; - - - echo "forwarding to mass-rebuild-check-jobs :)\n"; - - $message = new AMQPMessage(json_encode($forward), - array( - 'content_type' => 'application/json', - 'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT, - )); - $msg->delivery_info['channel']->basic_publish($message, '', 'mass-rebuild-check-jobs'); - $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); - return true; -} - -$consumerTag = 'massrebuildcheckfilter' . getmypid(); -$channel->basic_consume($queueName, $consumerTag, false, false, false, false, 'outrunner'); -while(count($channel->callbacks)) { - $channel->wait(); -} - -echo "Bye\n"; \ No newline at end of file diff --git a/php/src/ACL.php b/php/src/ACL.php deleted file mode 100644 index e9e14be..0000000 --- a/php/src/ACL.php +++ /dev/null @@ -1,16 +0,0 @@ -