{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/prometheus/pulls/comments/215783944","pull_request_review_id":153128649,"id":215783944,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTc4Mzk0NA==","diff_hunk":"@@ -0,0 +1,50 @@\n+#!/usr/bin/env bash\n+#\n+# Install all deps in correct version (matched to the vendored version) for ./genproto.sh to work.\n+# This will forcibly checkout binaries in your current $GOPATH to match desired version as they are imported by\n+# ./genproto.sh itself.\n+\n+set -e\n+set -u\n+\n+if ! [[ \"$0\" =~ \"scripts/install_genproto_deps.sh\" ]]; then\n+\techo \"must be run from repository root\"\n+\texit 255\n+fi\n+\n+DEPS=(\n+\"github.com/gogo/protobuf/protoc-gen-gogofast\"\n+\"github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway\"\n+\"github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger\"\n+\"golang.org/x/tools/cmd/goimports\"\n+)\n+\n+for dep in ${DEPS[@]}\n+do\n+    # This regex helps to find \"root\" for Golang package which is always in form <url>/<author/org>/<package>\n+    rootPackageRegex=\"([a-z.-]*/[a-z.-]*/[a-z.-]*)/.*\"\n+    if [[ \"${dep}\" =~ $rootPackageRegex ]]; then\n+        rootPackage=\"${BASH_REMATCH[1]}\"\n+    else\n+        rootPackage=\"${dep}\"\n+    fi\n+\n+    version=$(jq '[.package[] | select(.path|test(\"'\"${rootPackage}\"'.\"))][1].revision' ./vendor/vendor.json | tr -d '\"')","path":"scripts/install_genproto_deps.sh","position":32,"original_position":32,"commit_id":"2861df0e94d292ed13cdbebee86f22c460ae0098","original_commit_id":"2861df0e94d292ed13cdbebee86f22c460ae0098","user":{"login":"brancz","id":4546722,"node_id":"MDQ6VXNlcjQ1NDY3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/4546722?v=4","gravatar_id":"","url":"https://api.github.com/users/brancz","html_url":"https://github.com/brancz","followers_url":"https://api.github.com/users/brancz/followers","following_url":"https://api.github.com/users/brancz/following{/other_user}","gists_url":"https://api.github.com/users/brancz/gists{/gist_id}","starred_url":"https://api.github.com/users/brancz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brancz/subscriptions","organizations_url":"https://api.github.com/users/brancz/orgs","repos_url":"https://api.github.com/users/brancz/repos","events_url":"https://api.github.com/users/brancz/events{/privacy}","received_events_url":"https://api.github.com/users/brancz/received_events","type":"User","site_admin":false},"body":"Do we require `jq` anywhere else in our builds today? If not it's technically a new dependency. I don't care myself, just noting it. If no one cares, I'm happy with merging with it.","created_at":"2018-09-06T21:26:13Z","updated_at":"2018-09-06T21:26:50Z","html_url":"https://github.com/prometheus/prometheus/pull/4579#discussion_r215783944","pull_request_url":"https://api.github.com/repos/prometheus/prometheus/pulls/4579","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/comments/215783944"},"html":{"href":"https://github.com/prometheus/prometheus/pull/4579#discussion_r215783944"},"pull_request":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/4579"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/prometheus/pulls/4579","id":213398141,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMzk4MTQx","html_url":"https://github.com/prometheus/prometheus/pull/4579","diff_url":"https://github.com/prometheus/prometheus/pull/4579.diff","patch_url":"https://github.com/prometheus/prometheus/pull/4579.patch","issue_url":"https://api.github.com/repos/prometheus/prometheus/issues/4579","number":4579,"state":"open","locked":false,"title":"proto: Allow reproducible proto generation.","user":{"login":"Bplotka","id":6950331,"node_id":"MDQ6VXNlcjY5NTAzMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/6950331?v=4","gravatar_id":"","url":"https://api.github.com/users/Bplotka","html_url":"https://github.com/Bplotka","followers_url":"https://api.github.com/users/Bplotka/followers","following_url":"https://api.github.com/users/Bplotka/following{/other_user}","gists_url":"https://api.github.com/users/Bplotka/gists{/gist_id}","starred_url":"https://api.github.com/users/Bplotka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bplotka/subscriptions","organizations_url":"https://api.github.com/users/Bplotka/orgs","repos_url":"https://api.github.com/users/Bplotka/repos","events_url":"https://api.github.com/users/Bplotka/events{/privacy}","received_events_url":"https://api.github.com/users/Bplotka/received_events","type":"User","site_admin":false},"body":"Current way of setting prometheus project to generate code from proto files is tedious.\r\nIf you just go install packages described in README.md, it ends up with this (non buildable code)\r\n```\r\n../../../prompb/remote.pb.go:61:34: undefined: \"github.com/prometheus/prometheus/vendor/github.com/gogo/protobuf/proto\".InternalMessageInfo\r\n../../../prompb/remote.pb.go:109:33: undefined: \"github.com/prometheus/prometheus/vendor/github.com/gogo/protobuf/proto\".InternalMessageInfo\r\n../../../prompb/remote.pb.go:164:34: undefined: \"github.com/prometheus/prometheus/vendor/github.com/gogo/protobuf/proto\".InternalMessageInfo\r\n../../../prompb/remote.pb.go:214:27: undefined: \"github.com/prometheus/prometheus/vendor/github.com/gogo/protobuf/proto\".InternalMessageInfo\r\n../../../prompb/remote.pb.go:284:33: undefined: \"github.com/prometheus/prometheus/vendor/github.com/gogo/protobuf/proto\".InternalMessageInfo\r\n```\r\nThe issue is that the guide presented in proto folder is asking to install some GO packages. It does not mention from what version and there is strong mismatch between those used to generate proto and those that are vendored and used to run the code later...\r\nThe particular outdated packages in vendor are:\r\n`github.com/gogo/protobuf` and `google.golang.org/grpc`.\r\n\r\nJust updating vendor would be not enough, as it would only tmp fix.\r\nI propose adding script that will parse version from vendor.json and install correct version.\r\n\r\nChanges:\r\n- Added script that uses packages in *exactly* the same version the Go code is build against later.\r\n- Regenerated proto with those pinned deps.\r\n- Updated REAMDE.md\r\n- Added `make proto`\r\n\r\nI have mixed feeling about install script.\r\n* It's nice that it requires manual step (we could attach this script to genproto). It checkouts existing packages in GOPATH as well, which could be counted as .. unsafe?\r\n* I am strongly suggesting leaving it somewhere... Otherwise it's just extremely hard to have reproducible proto generation.\r\n\r\nAny thoughts?","created_at":"2018-09-05T19:10:23Z","updated_at":"2018-09-06T21:26:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03f0d823e3cafda04582e73e0231a1cb9793902a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/prometheus/pulls/4579/commits","review_comments_url":"https://api.github.com/repos/prometheus/prometheus/pulls/4579/comments","review_comment_url":"https://api.github.com/repos/prometheus/prometheus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prometheus/prometheus/issues/4579/comments","statuses_url":"https://api.github.com/repos/prometheus/prometheus/statuses/2861df0e94d292ed13cdbebee86f22c460ae0098","head":{"label":"Bplotka:ensure-genproto-works","ref":"ensure-genproto-works","sha":"2861df0e94d292ed13cdbebee86f22c460ae0098","user":{"login":"Bplotka","id":6950331,"node_id":"MDQ6VXNlcjY5NTAzMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/6950331?v=4","gravatar_id":"","url":"https://api.github.com/users/Bplotka","html_url":"https://github.com/Bplotka","followers_url":"https://api.github.com/users/Bplotka/followers","following_url":"https://api.github.com/users/Bplotka/following{/other_user}","gists_url":"https://api.github.com/users/Bplotka/gists{/gist_id}","starred_url":"https://api.github.com/users/Bplotka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bplotka/subscriptions","organizations_url":"https://api.github.com/users/Bplotka/orgs","repos_url":"https://api.github.com/users/Bplotka/repos","events_url":"https://api.github.com/users/Bplotka/events{/privacy}","received_events_url":"https://api.github.com/users/Bplotka/received_events","type":"User","site_admin":false},"repo":{"id":79134698,"node_id":"MDEwOlJlcG9zaXRvcnk3OTEzNDY5OA==","name":"prometheus","full_name":"Bplotka/prometheus","owner":{"login":"Bplotka","id":6950331,"node_id":"MDQ6VXNlcjY5NTAzMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/6950331?v=4","gravatar_id":"","url":"https://api.github.com/users/Bplotka","html_url":"https://github.com/Bplotka","followers_url":"https://api.github.com/users/Bplotka/followers","following_url":"https://api.github.com/users/Bplotka/following{/other_user}","gists_url":"https://api.github.com/users/Bplotka/gists{/gist_id}","starred_url":"https://api.github.com/users/Bplotka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bplotka/subscriptions","organizations_url":"https://api.github.com/users/Bplotka/orgs","repos_url":"https://api.github.com/users/Bplotka/repos","events_url":"https://api.github.com/users/Bplotka/events{/privacy}","received_events_url":"https://api.github.com/users/Bplotka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bplotka/prometheus","description":"The Prometheus monitoring system and time series database.","fork":true,"url":"https://api.github.com/repos/Bplotka/prometheus","forks_url":"https://api.github.com/repos/Bplotka/prometheus/forks","keys_url":"https://api.github.com/repos/Bplotka/prometheus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bplotka/prometheus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bplotka/prometheus/teams","hooks_url":"https://api.github.com/repos/Bplotka/prometheus/hooks","issue_events_url":"https://api.github.com/repos/Bplotka/prometheus/issues/events{/number}","events_url":"https://api.github.com/repos/Bplotka/prometheus/events","assignees_url":"https://api.github.com/repos/Bplotka/prometheus/assignees{/user}","branches_url":"https://api.github.com/repos/Bplotka/prometheus/branches{/branch}","tags_url":"https://api.github.com/repos/Bplotka/prometheus/tags","blobs_url":"https://api.github.com/repos/Bplotka/prometheus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bplotka/prometheus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bplotka/prometheus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bplotka/prometheus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bplotka/prometheus/statuses/{sha}","languages_url":"https://api.github.com/repos/Bplotka/prometheus/languages","stargazers_url":"https://api.github.com/repos/Bplotka/prometheus/stargazers","contributors_url":"https://api.github.com/repos/Bplotka/prometheus/contributors","subscribers_url":"https://api.github.com/repos/Bplotka/prometheus/subscribers","subscription_url":"https://api.github.com/repos/Bplotka/prometheus/subscription","commits_url":"https://api.github.com/repos/Bplotka/prometheus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bplotka/prometheus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bplotka/prometheus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bplotka/prometheus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bplotka/prometheus/contents/{+path}","compare_url":"https://api.github.com/repos/Bplotka/prometheus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bplotka/prometheus/merges","archive_url":"https://api.github.com/repos/Bplotka/prometheus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bplotka/prometheus/downloads","issues_url":"https://api.github.com/repos/Bplotka/prometheus/issues{/number}","pulls_url":"https://api.github.com/repos/Bplotka/prometheus/pulls{/number}","milestones_url":"https://api.github.com/repos/Bplotka/prometheus/milestones{/number}","notifications_url":"https://api.github.com/repos/Bplotka/prometheus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bplotka/prometheus/labels{/name}","releases_url":"https://api.github.com/repos/Bplotka/prometheus/releases{/id}","deployments_url":"https://api.github.com/repos/Bplotka/prometheus/deployments","created_at":"2017-01-16T16:03:35Z","updated_at":"2017-01-16T16:03:39Z","pushed_at":"2018-09-06T12:24:13Z","git_url":"git://github.com/Bplotka/prometheus.git","ssh_url":"git@github.com:Bplotka/prometheus.git","clone_url":"https://github.com/Bplotka/prometheus.git","svn_url":"https://github.com/Bplotka/prometheus","homepage":"https://prometheus.io/","size":39718,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prometheus:master","ref":"master","sha":"3e87c04b836e7a8b6606e498200eea68fc897d4b","user":{"login":"prometheus","id":3380462,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODA0NjI=","avatar_url":"https://avatars3.githubusercontent.com/u/3380462?v=4","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":6838921,"node_id":"MDEwOlJlcG9zaXRvcnk2ODM4OTIx","name":"prometheus","full_name":"prometheus/prometheus","owner":{"login":"prometheus","id":3380462,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODA0NjI=","avatar_url":"https://avatars3.githubusercontent.com/u/3380462?v=4","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/prometheus","description":"The Prometheus monitoring system and time series database.","fork":false,"url":"https://api.github.com/repos/prometheus/prometheus","forks_url":"https://api.github.com/repos/prometheus/prometheus/forks","keys_url":"https://api.github.com/repos/prometheus/prometheus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/prometheus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/prometheus/teams","hooks_url":"https://api.github.com/repos/prometheus/prometheus/hooks","issue_events_url":"https://api.github.com/repos/prometheus/prometheus/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/prometheus/events","assignees_url":"https://api.github.com/repos/prometheus/prometheus/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/prometheus/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/prometheus/tags","blobs_url":"https://api.github.com/repos/prometheus/prometheus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/prometheus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/prometheus/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/prometheus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/prometheus/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/prometheus/languages","stargazers_url":"https://api.github.com/repos/prometheus/prometheus/stargazers","contributors_url":"https://api.github.com/repos/prometheus/prometheus/contributors","subscribers_url":"https://api.github.com/repos/prometheus/prometheus/subscribers","subscription_url":"https://api.github.com/repos/prometheus/prometheus/subscription","commits_url":"https://api.github.com/repos/prometheus/prometheus/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/prometheus/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/prometheus/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/prometheus/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/prometheus/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/prometheus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/prometheus/merges","archive_url":"https://api.github.com/repos/prometheus/prometheus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/prometheus/downloads","issues_url":"https://api.github.com/repos/prometheus/prometheus/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/prometheus/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/prometheus/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/prometheus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/prometheus/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/prometheus/releases{/id}","deployments_url":"https://api.github.com/repos/prometheus/prometheus/deployments","created_at":"2012-11-24T11:14:12Z","updated_at":"2018-09-06T20:13:31Z","pushed_at":"2018-09-06T13:36:17Z","git_url":"git://github.com/prometheus/prometheus.git","ssh_url":"git@github.com:prometheus/prometheus.git","clone_url":"https://github.com/prometheus/prometheus.git","svn_url":"https://github.com/prometheus/prometheus","homepage":"https://prometheus.io/","size":40698,"stargazers_count":18659,"watchers_count":18659,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2490,"mirror_url":null,"archived":false,"open_issues_count":286,"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":2490,"open_issues":286,"watchers":18659,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/4579"},"html":{"href":"https://github.com/prometheus/prometheus/pull/4579"},"issue":{"href":"https://api.github.com/repos/prometheus/prometheus/issues/4579"},"comments":{"href":"https://api.github.com/repos/prometheus/prometheus/issues/4579/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/4579/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/4579/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/prometheus/statuses/2861df0e94d292ed13cdbebee86f22c460ae0098"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"brancz"}}