{"action":"created","comment":{"url":"https://api.github.com/repos/pantsbuild/pants/pulls/comments/244247562","pull_request_review_id":188201793,"id":244247562,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDI0NzU2Mg==","diff_hunk":"@@ -14,6 +18,34 @@ fn main() {\n     thirdpartyprotobuf.to_str().unwrap()\n   );\n \n+  let amended_proto_root = tempfile::TempDir::new().unwrap();\n+  for f in &[\"bazelbuild_remote-apis\", \"googleapis\"] {\n+    let src_root = thirdpartyprotobuf.join(f);\n+    for entry in walkdir::WalkDir::new(&src_root)\n+      .into_iter()\n+      .filter_map(|entry| entry.ok())\n+    {\n+      if entry.file_type().is_file() && entry.file_name().to_string_lossy().ends_with(\".proto\") {\n+        let dst = amended_proto_root\n+          .path()\n+          .join(entry.path().strip_prefix(&src_root).unwrap());\n+        std::fs::create_dir_all(dst.parent().unwrap())\n+          .expect(\"Error making dir in temp proto root\");\n+        let original = std::fs::read_to_string(entry.path())\n+          .expect(&format!(\"Error reading {}\", entry.path().display()));\n+        let mut copy = String::with_capacity(original.len() + EXTRA_HEADER.len());\n+        for line in original.lines() {\n+          copy += line;\n+          copy += \"\\n\";\n+          if line.starts_with(\"package \") {\n+            copy += EXTRA_HEADER\n+          }\n+        }\n+        std::fs::write(&dst, copy.as_bytes()).expect(&format!(\"Error writing {}\", dst.display()));\n+      }\n+    }\n+  }\n+","path":"src/rust/engine/process_execution/bazel_protos/build.rs","position":42,"original_position":42,"commit_id":"a3024b2e9774b104ebe224e3d17763643c8dfcf2","original_commit_id":"a3024b2e9774b104ebe224e3d17763643c8dfcf2","user":{"login":"cosmicexplorer","id":1305167,"node_id":"MDQ6VXNlcjEzMDUxNjc=","avatar_url":"https://avatars1.githubusercontent.com/u/1305167?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmicexplorer","html_url":"https://github.com/cosmicexplorer","followers_url":"https://api.github.com/users/cosmicexplorer/followers","following_url":"https://api.github.com/users/cosmicexplorer/following{/other_user}","gists_url":"https://api.github.com/users/cosmicexplorer/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmicexplorer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmicexplorer/subscriptions","organizations_url":"https://api.github.com/users/cosmicexplorer/orgs","repos_url":"https://api.github.com/users/cosmicexplorer/repos","events_url":"https://api.github.com/users/cosmicexplorer/events{/privacy}","received_events_url":"https://api.github.com/users/cosmicexplorer/received_events","type":"User","site_admin":false},"body":"Also, this is why I use perl :)","created_at":"2018-12-28T01:11:44Z","updated_at":"2018-12-28T01:11:45Z","html_url":"https://github.com/pantsbuild/pants/pull/7000#discussion_r244247562","pull_request_url":"https://api.github.com/repos/pantsbuild/pants/pulls/7000","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/comments/244247562"},"html":{"href":"https://github.com/pantsbuild/pants/pull/7000#discussion_r244247562"},"pull_request":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/7000"}},"in_reply_to_id":244243950},"pull_request":{"url":"https://api.github.com/repos/pantsbuild/pants/pulls/7000","id":241199213,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMTk5MjEz","html_url":"https://github.com/pantsbuild/pants/pull/7000","diff_url":"https://github.com/pantsbuild/pants/pull/7000.diff","patch_url":"https://github.com/pantsbuild/pants/pull/7000.patch","issue_url":"https://api.github.com/repos/pantsbuild/pants/issues/7000","number":7000,"state":"open","locked":false,"title":"Programatically add rust config to vendored protos","user":{"login":"illicitonion","id":1131704,"node_id":"MDQ6VXNlcjExMzE3MDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1131704?v=4","gravatar_id":"","url":"https://api.github.com/users/illicitonion","html_url":"https://github.com/illicitonion","followers_url":"https://api.github.com/users/illicitonion/followers","following_url":"https://api.github.com/users/illicitonion/following{/other_user}","gists_url":"https://api.github.com/users/illicitonion/gists{/gist_id}","starred_url":"https://api.github.com/users/illicitonion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illicitonion/subscriptions","organizations_url":"https://api.github.com/users/illicitonion/orgs","repos_url":"https://api.github.com/users/illicitonion/repos","events_url":"https://api.github.com/users/illicitonion/events{/privacy}","received_events_url":"https://api.github.com/users/illicitonion/received_events","type":"User","site_admin":false},"body":"I'm about to add a second build script which will use prost for its\r\ncodegen, and which needs the pristine protos, so instead of checking\r\nthem in altered, alter them on the fly specifically for protoc_grpcio.\r\n\r\nThis also makes it easier to pull in updates.","created_at":"2018-12-27T18:02:40Z","updated_at":"2018-12-28T01:11:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a65c0b666c78b71a537942e2b015e4de49e33e73","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jsirois","id":157586,"node_id":"MDQ6VXNlcjE1NzU4Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/157586?v=4","gravatar_id":"","url":"https://api.github.com/users/jsirois","html_url":"https://github.com/jsirois","followers_url":"https://api.github.com/users/jsirois/followers","following_url":"https://api.github.com/users/jsirois/following{/other_user}","gists_url":"https://api.github.com/users/jsirois/gists{/gist_id}","starred_url":"https://api.github.com/users/jsirois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsirois/subscriptions","organizations_url":"https://api.github.com/users/jsirois/orgs","repos_url":"https://api.github.com/users/jsirois/repos","events_url":"https://api.github.com/users/jsirois/events{/privacy}","received_events_url":"https://api.github.com/users/jsirois/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pantsbuild/pants/pulls/7000/commits","review_comments_url":"https://api.github.com/repos/pantsbuild/pants/pulls/7000/comments","review_comment_url":"https://api.github.com/repos/pantsbuild/pants/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pantsbuild/pants/issues/7000/comments","statuses_url":"https://api.github.com/repos/pantsbuild/pants/statuses/a3024b2e9774b104ebe224e3d17763643c8dfcf2","head":{"label":"twitter:dwagnerhall/prost/unmodify","ref":"dwagnerhall/prost/unmodify","sha":"a3024b2e9774b104ebe224e3d17763643c8dfcf2","user":{"login":"twitter","id":50278,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMjc4","avatar_url":"https://avatars1.githubusercontent.com/u/50278?v=4","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"repo":{"id":29317658,"node_id":"MDEwOlJlcG9zaXRvcnkyOTMxNzY1OA==","name":"pants","full_name":"twitter/pants","private":false,"owner":{"login":"twitter","id":50278,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMjc4","avatar_url":"https://avatars1.githubusercontent.com/u/50278?v=4","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/twitter/pants","description":"Pants Build System","fork":true,"url":"https://api.github.com/repos/twitter/pants","forks_url":"https://api.github.com/repos/twitter/pants/forks","keys_url":"https://api.github.com/repos/twitter/pants/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/pants/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/pants/teams","hooks_url":"https://api.github.com/repos/twitter/pants/hooks","issue_events_url":"https://api.github.com/repos/twitter/pants/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/pants/events","assignees_url":"https://api.github.com/repos/twitter/pants/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/pants/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/pants/tags","blobs_url":"https://api.github.com/repos/twitter/pants/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/pants/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/pants/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/pants/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/pants/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/pants/languages","stargazers_url":"https://api.github.com/repos/twitter/pants/stargazers","contributors_url":"https://api.github.com/repos/twitter/pants/contributors","subscribers_url":"https://api.github.com/repos/twitter/pants/subscribers","subscription_url":"https://api.github.com/repos/twitter/pants/subscription","commits_url":"https://api.github.com/repos/twitter/pants/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/pants/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/pants/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/pants/issues/comments{/number}","contents_url":"https://api.github.com/repos/twitter/pants/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/pants/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/pants/merges","archive_url":"https://api.github.com/repos/twitter/pants/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/pants/downloads","issues_url":"https://api.github.com/repos/twitter/pants/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/pants/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/pants/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/pants/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/pants/labels{/name}","releases_url":"https://api.github.com/repos/twitter/pants/releases{/id}","deployments_url":"https://api.github.com/repos/twitter/pants/deployments","created_at":"2015-01-15T20:51:58Z","updated_at":"2018-12-01T15:11:37Z","pushed_at":"2018-12-27T18:39:44Z","git_url":"git://github.com/twitter/pants.git","ssh_url":"git@github.com:twitter/pants.git","clone_url":"https://github.com/twitter/pants.git","svn_url":"https://github.com/twitter/pants","homepage":"http://pantsbuild.github.io/","size":123036,"stargazers_count":66,"watchers_count":66,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":20,"open_issues":0,"watchers":66,"default_branch":"master"}},"base":{"label":"pantsbuild:master","ref":"master","sha":"cd8addbf8cd13daee80e3a7521c00fa62a375c48","user":{"login":"pantsbuild","id":3065172,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwNjUxNzI=","avatar_url":"https://avatars0.githubusercontent.com/u/3065172?v=4","gravatar_id":"","url":"https://api.github.com/users/pantsbuild","html_url":"https://github.com/pantsbuild","followers_url":"https://api.github.com/users/pantsbuild/followers","following_url":"https://api.github.com/users/pantsbuild/following{/other_user}","gists_url":"https://api.github.com/users/pantsbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/pantsbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pantsbuild/subscriptions","organizations_url":"https://api.github.com/users/pantsbuild/orgs","repos_url":"https://api.github.com/users/pantsbuild/repos","events_url":"https://api.github.com/users/pantsbuild/events{/privacy}","received_events_url":"https://api.github.com/users/pantsbuild/received_events","type":"Organization","site_admin":false},"repo":{"id":7209075,"node_id":"MDEwOlJlcG9zaXRvcnk3MjA5MDc1","name":"pants","full_name":"pantsbuild/pants","private":false,"owner":{"login":"pantsbuild","id":3065172,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwNjUxNzI=","avatar_url":"https://avatars0.githubusercontent.com/u/3065172?v=4","gravatar_id":"","url":"https://api.github.com/users/pantsbuild","html_url":"https://github.com/pantsbuild","followers_url":"https://api.github.com/users/pantsbuild/followers","following_url":"https://api.github.com/users/pantsbuild/following{/other_user}","gists_url":"https://api.github.com/users/pantsbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/pantsbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pantsbuild/subscriptions","organizations_url":"https://api.github.com/users/pantsbuild/orgs","repos_url":"https://api.github.com/users/pantsbuild/repos","events_url":"https://api.github.com/users/pantsbuild/events{/privacy}","received_events_url":"https://api.github.com/users/pantsbuild/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pantsbuild/pants","description":"The Pants Build System","fork":false,"url":"https://api.github.com/repos/pantsbuild/pants","forks_url":"https://api.github.com/repos/pantsbuild/pants/forks","keys_url":"https://api.github.com/repos/pantsbuild/pants/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pantsbuild/pants/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pantsbuild/pants/teams","hooks_url":"https://api.github.com/repos/pantsbuild/pants/hooks","issue_events_url":"https://api.github.com/repos/pantsbuild/pants/issues/events{/number}","events_url":"https://api.github.com/repos/pantsbuild/pants/events","assignees_url":"https://api.github.com/repos/pantsbuild/pants/assignees{/user}","branches_url":"https://api.github.com/repos/pantsbuild/pants/branches{/branch}","tags_url":"https://api.github.com/repos/pantsbuild/pants/tags","blobs_url":"https://api.github.com/repos/pantsbuild/pants/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pantsbuild/pants/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pantsbuild/pants/git/refs{/sha}","trees_url":"https://api.github.com/repos/pantsbuild/pants/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pantsbuild/pants/statuses/{sha}","languages_url":"https://api.github.com/repos/pantsbuild/pants/languages","stargazers_url":"https://api.github.com/repos/pantsbuild/pants/stargazers","contributors_url":"https://api.github.com/repos/pantsbuild/pants/contributors","subscribers_url":"https://api.github.com/repos/pantsbuild/pants/subscribers","subscription_url":"https://api.github.com/repos/pantsbuild/pants/subscription","commits_url":"https://api.github.com/repos/pantsbuild/pants/commits{/sha}","git_commits_url":"https://api.github.com/repos/pantsbuild/pants/git/commits{/sha}","comments_url":"https://api.github.com/repos/pantsbuild/pants/comments{/number}","issue_comment_url":"https://api.github.com/repos/pantsbuild/pants/issues/comments{/number}","contents_url":"https://api.github.com/repos/pantsbuild/pants/contents/{+path}","compare_url":"https://api.github.com/repos/pantsbuild/pants/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pantsbuild/pants/merges","archive_url":"https://api.github.com/repos/pantsbuild/pants/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pantsbuild/pants/downloads","issues_url":"https://api.github.com/repos/pantsbuild/pants/issues{/number}","pulls_url":"https://api.github.com/repos/pantsbuild/pants/pulls{/number}","milestones_url":"https://api.github.com/repos/pantsbuild/pants/milestones{/number}","notifications_url":"https://api.github.com/repos/pantsbuild/pants/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pantsbuild/pants/labels{/name}","releases_url":"https://api.github.com/repos/pantsbuild/pants/releases{/id}","deployments_url":"https://api.github.com/repos/pantsbuild/pants/deployments","created_at":"2012-12-17T17:39:04Z","updated_at":"2018-12-28T00:05:56Z","pushed_at":"2018-12-27T21:39:43Z","git_url":"git://github.com/pantsbuild/pants.git","ssh_url":"git@github.com:pantsbuild/pants.git","clone_url":"https://github.com/pantsbuild/pants.git","svn_url":"https://github.com/pantsbuild/pants","homepage":"http://pantsbuild.org/","size":89663,"stargazers_count":1065,"watchers_count":1065,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":311,"mirror_url":null,"archived":false,"open_issues_count":801,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":311,"open_issues":801,"watchers":1065,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/7000"},"html":{"href":"https://github.com/pantsbuild/pants/pull/7000"},"issue":{"href":"https://api.github.com/repos/pantsbuild/pants/issues/7000"},"comments":{"href":"https://api.github.com/repos/pantsbuild/pants/issues/7000/comments"},"review_comments":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/7000/comments"},"review_comment":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/7000/commits"},"statuses":{"href":"https://api.github.com/repos/pantsbuild/pants/statuses/a3024b2e9774b104ebe224e3d17763643c8dfcf2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cosmicexplorer"}}