{"action":"created","comment":{"url":"https://api.github.com/repos/TuneLab/go-truss/pulls/comments/83247493","pull_request_review_id":4103196,"id":83247493,"diff_hunk":"@@ -0,0 +1,347 @@\n+package svcdef\n+\n+// consider renaming to census, pbregistry, or just to \"essence\"","path":"svcdef/svcdef.go","position":3,"original_position":3,"commit_id":"79ecc77422d283388a43b193eb6a5be15b19ef5f","original_commit_id":"79ecc77422d283388a43b193eb6a5be15b19ef5f","user":{"login":"hasLeland","id":19537833,"avatar_url":"https://avatars.githubusercontent.com/u/19537833?v=3","gravatar_id":"","url":"https://api.github.com/users/hasLeland","html_url":"https://github.com/hasLeland","followers_url":"https://api.github.com/users/hasLeland/followers","following_url":"https://api.github.com/users/hasLeland/following{/other_user}","gists_url":"https://api.github.com/users/hasLeland/gists{/gist_id}","starred_url":"https://api.github.com/users/hasLeland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasLeland/subscriptions","organizations_url":"https://api.github.com/users/hasLeland/orgs","repos_url":"https://api.github.com/users/hasLeland/repos","events_url":"https://api.github.com/users/hasLeland/events{/privacy}","received_events_url":"https://api.github.com/users/hasLeland/received_events","type":"User","site_admin":false},"body":"This comment was intended as a note for myself on potential names for this package, and needs to be removed.","created_at":"2016-10-13T15:44:30Z","updated_at":"2016-10-13T15:44:30Z","html_url":"https://github.com/TuneLab/go-truss/pull/71#discussion_r83247493","pull_request_url":"https://api.github.com/repos/TuneLab/go-truss/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/comments/83247493"},"html":{"href":"https://github.com/TuneLab/go-truss/pull/71#discussion_r83247493"},"pull_request":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/TuneLab/go-truss/pulls/71","id":89103934,"html_url":"https://github.com/TuneLab/go-truss/pull/71","diff_url":"https://github.com/TuneLab/go-truss/pull/71.diff","patch_url":"https://github.com/TuneLab/go-truss/pull/71.patch","issue_url":"https://api.github.com/repos/TuneLab/go-truss/issues/71","number":71,"state":"open","locked":false,"title":"New service definition implementation -- 1/5 the size of Deftree!","user":{"login":"hasLeland","id":19537833,"avatar_url":"https://avatars.githubusercontent.com/u/19537833?v=3","gravatar_id":"","url":"https://api.github.com/users/hasLeland","html_url":"https://github.com/hasLeland","followers_url":"https://api.github.com/users/hasLeland/followers","following_url":"https://api.github.com/users/hasLeland/following{/other_user}","gists_url":"https://api.github.com/users/hasLeland/gists{/gist_id}","starred_url":"https://api.github.com/users/hasLeland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasLeland/subscriptions","organizations_url":"https://api.github.com/users/hasLeland/orgs","repos_url":"https://api.github.com/users/hasLeland/repos","events_url":"https://api.github.com/users/hasLeland/events{/privacy}","received_events_url":"https://api.github.com/users/hasLeland/received_events","type":"User","site_admin":false},"body":"Before we get to the \"what\" of all this, here's some quick notes:\r\n\r\n1. I'm pretty sure this needs more documentation. Please do clone this down and look at it using the godoc web interface or CLI and let me know if there're things which aren't clear from the existing docs.\r\n2. What do you think about naming it `svcdef`? Should that be changed? What do you think would be the best name?\r\n\r\n---------\r\n\r\n# What?\r\n\r\nIn short, `deftree` is a big mess that's not good at what we use it for, so we're gonna replace it with this new thing called `svcdef`.\r\n\r\n# Why?\r\n\r\n`deftree` is intended to hold all the info we may need to generate a service. However, `deftree` exclusively derives it's information from the parsing of the input proto files. This sounds fine in priciple, but when generating code, we have to generate code which co-operates with the go code generated by `protoc-gen-go`. Now, you may notice a problem here: how can we generate code to interoperate with the code from `protoc-gen-go` if we haven't directly inspected the output code from `protoc-gen-go`?\r\n\r\nThe answer till now has been: by making some (not always sound) assumptions. Since the code generated by `protoc-gen-go` is also based on the same protobuf definition files we are provided, it is possible *in theory* to infer the state of the code generated by `protoc-gen-go` and generate our own code which interoperates with our correctly-infered code. But our inferences aren't always correct, and even if they are they frequently don't handle edge cases in the code we must interoperate with.\r\n\r\nIf this sounds overly complicated and error prone, that's because it has been.\r\n\r\nIn short, **`deftree` only indirectly gives us the information we need to generate working and reliable code, which is why `svcdef` has been written.**\r\n\r\n# How?\r\n\r\nHow does `svcdef` suceed where `deftree` failed? By getting it's information from the go files we need to interoperate with. Instead of deriving it's information from protobuf files, `svcdef` derives its info from the go files created by `protoc-gen-go` (and by reading the protobuf files for their http annotations). By sourcing it's information directly from the go files, `svcdef` provides much more accurate information that doesn't have to be massaged to generate correct code in the way the output of `deftree` does. Additionally, because the golang `go/ast` package for parsing go files is :+1::100:amazing, we can extract this more accurate and useful information with **80% less code** than `deftree`!\r\n\r\n# Does this break anything?\r\n\r\nAs of right now, no! But that's because this is only the implementation of `svcdef`, this PR does not include the changes to the rest of `truss` to use `svcdef` instead of `deftree`. That change is going to come later. The first goal is to get eyes on this code before we spend more time migrating things over.","created_at":"2016-10-12T22:14:06Z","updated_at":"2016-10-13T15:44:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fc10a6fe30094ad58d9ffab21cb6bf6eda410c3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TuneLab/go-truss/pulls/71/commits","review_comments_url":"https://api.github.com/repos/TuneLab/go-truss/pulls/71/comments","review_comment_url":"https://api.github.com/repos/TuneLab/go-truss/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TuneLab/go-truss/issues/71/comments","statuses_url":"https://api.github.com/repos/TuneLab/go-truss/statuses/79ecc77422d283388a43b193eb6a5be15b19ef5f","head":{"label":"hasLeland:plumbing-rewrite","ref":"plumbing-rewrite","sha":"79ecc77422d283388a43b193eb6a5be15b19ef5f","user":{"login":"hasLeland","id":19537833,"avatar_url":"https://avatars.githubusercontent.com/u/19537833?v=3","gravatar_id":"","url":"https://api.github.com/users/hasLeland","html_url":"https://github.com/hasLeland","followers_url":"https://api.github.com/users/hasLeland/followers","following_url":"https://api.github.com/users/hasLeland/following{/other_user}","gists_url":"https://api.github.com/users/hasLeland/gists{/gist_id}","starred_url":"https://api.github.com/users/hasLeland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasLeland/subscriptions","organizations_url":"https://api.github.com/users/hasLeland/orgs","repos_url":"https://api.github.com/users/hasLeland/repos","events_url":"https://api.github.com/users/hasLeland/events{/privacy}","received_events_url":"https://api.github.com/users/hasLeland/received_events","type":"User","site_admin":false},"repo":{"id":66118769,"name":"go-truss","full_name":"hasLeland/go-truss","owner":{"login":"hasLeland","id":19537833,"avatar_url":"https://avatars.githubusercontent.com/u/19537833?v=3","gravatar_id":"","url":"https://api.github.com/users/hasLeland","html_url":"https://github.com/hasLeland","followers_url":"https://api.github.com/users/hasLeland/followers","following_url":"https://api.github.com/users/hasLeland/following{/other_user}","gists_url":"https://api.github.com/users/hasLeland/gists{/gist_id}","starred_url":"https://api.github.com/users/hasLeland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasLeland/subscriptions","organizations_url":"https://api.github.com/users/hasLeland/orgs","repos_url":"https://api.github.com/users/hasLeland/repos","events_url":"https://api.github.com/users/hasLeland/events{/privacy}","received_events_url":"https://api.github.com/users/hasLeland/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hasLeland/go-truss","description":null,"fork":true,"url":"https://api.github.com/repos/hasLeland/go-truss","forks_url":"https://api.github.com/repos/hasLeland/go-truss/forks","keys_url":"https://api.github.com/repos/hasLeland/go-truss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hasLeland/go-truss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hasLeland/go-truss/teams","hooks_url":"https://api.github.com/repos/hasLeland/go-truss/hooks","issue_events_url":"https://api.github.com/repos/hasLeland/go-truss/issues/events{/number}","events_url":"https://api.github.com/repos/hasLeland/go-truss/events","assignees_url":"https://api.github.com/repos/hasLeland/go-truss/assignees{/user}","branches_url":"https://api.github.com/repos/hasLeland/go-truss/branches{/branch}","tags_url":"https://api.github.com/repos/hasLeland/go-truss/tags","blobs_url":"https://api.github.com/repos/hasLeland/go-truss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hasLeland/go-truss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hasLeland/go-truss/git/refs{/sha}","trees_url":"https://api.github.com/repos/hasLeland/go-truss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hasLeland/go-truss/statuses/{sha}","languages_url":"https://api.github.com/repos/hasLeland/go-truss/languages","stargazers_url":"https://api.github.com/repos/hasLeland/go-truss/stargazers","contributors_url":"https://api.github.com/repos/hasLeland/go-truss/contributors","subscribers_url":"https://api.github.com/repos/hasLeland/go-truss/subscribers","subscription_url":"https://api.github.com/repos/hasLeland/go-truss/subscription","commits_url":"https://api.github.com/repos/hasLeland/go-truss/commits{/sha}","git_commits_url":"https://api.github.com/repos/hasLeland/go-truss/git/commits{/sha}","comments_url":"https://api.github.com/repos/hasLeland/go-truss/comments{/number}","issue_comment_url":"https://api.github.com/repos/hasLeland/go-truss/issues/comments{/number}","contents_url":"https://api.github.com/repos/hasLeland/go-truss/contents/{+path}","compare_url":"https://api.github.com/repos/hasLeland/go-truss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hasLeland/go-truss/merges","archive_url":"https://api.github.com/repos/hasLeland/go-truss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hasLeland/go-truss/downloads","issues_url":"https://api.github.com/repos/hasLeland/go-truss/issues{/number}","pulls_url":"https://api.github.com/repos/hasLeland/go-truss/pulls{/number}","milestones_url":"https://api.github.com/repos/hasLeland/go-truss/milestones{/number}","notifications_url":"https://api.github.com/repos/hasLeland/go-truss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hasLeland/go-truss/labels{/name}","releases_url":"https://api.github.com/repos/hasLeland/go-truss/releases{/id}","deployments_url":"https://api.github.com/repos/hasLeland/go-truss/deployments","created_at":"2016-08-19T23:45:49Z","updated_at":"2016-08-19T23:45:51Z","pushed_at":"2016-10-12T21:16:52Z","git_url":"git://github.com/hasLeland/go-truss.git","ssh_url":"git@github.com:hasLeland/go-truss.git","clone_url":"https://github.com/hasLeland/go-truss.git","svn_url":"https://github.com/hasLeland/go-truss","homepage":null,"size":9954,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TuneLab:master","ref":"master","sha":"a2bd9bc5482e50ee2a70d19494bf4fcfc9ea880e","user":{"login":"TuneLab","id":12895637,"avatar_url":"https://avatars.githubusercontent.com/u/12895637?v=3","gravatar_id":"","url":"https://api.github.com/users/TuneLab","html_url":"https://github.com/TuneLab","followers_url":"https://api.github.com/users/TuneLab/followers","following_url":"https://api.github.com/users/TuneLab/following{/other_user}","gists_url":"https://api.github.com/users/TuneLab/gists{/gist_id}","starred_url":"https://api.github.com/users/TuneLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TuneLab/subscriptions","organizations_url":"https://api.github.com/users/TuneLab/orgs","repos_url":"https://api.github.com/users/TuneLab/repos","events_url":"https://api.github.com/users/TuneLab/events{/privacy}","received_events_url":"https://api.github.com/users/TuneLab/received_events","type":"Organization","site_admin":false},"repo":{"id":61059364,"name":"go-truss","full_name":"TuneLab/go-truss","owner":{"login":"TuneLab","id":12895637,"avatar_url":"https://avatars.githubusercontent.com/u/12895637?v=3","gravatar_id":"","url":"https://api.github.com/users/TuneLab","html_url":"https://github.com/TuneLab","followers_url":"https://api.github.com/users/TuneLab/followers","following_url":"https://api.github.com/users/TuneLab/following{/other_user}","gists_url":"https://api.github.com/users/TuneLab/gists{/gist_id}","starred_url":"https://api.github.com/users/TuneLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TuneLab/subscriptions","organizations_url":"https://api.github.com/users/TuneLab/orgs","repos_url":"https://api.github.com/users/TuneLab/repos","events_url":"https://api.github.com/users/TuneLab/events{/privacy}","received_events_url":"https://api.github.com/users/TuneLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TuneLab/go-truss","description":"Truss helps you build go-kit microservices without having to worry about writing or maintaining boilerplate code.","fork":false,"url":"https://api.github.com/repos/TuneLab/go-truss","forks_url":"https://api.github.com/repos/TuneLab/go-truss/forks","keys_url":"https://api.github.com/repos/TuneLab/go-truss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TuneLab/go-truss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TuneLab/go-truss/teams","hooks_url":"https://api.github.com/repos/TuneLab/go-truss/hooks","issue_events_url":"https://api.github.com/repos/TuneLab/go-truss/issues/events{/number}","events_url":"https://api.github.com/repos/TuneLab/go-truss/events","assignees_url":"https://api.github.com/repos/TuneLab/go-truss/assignees{/user}","branches_url":"https://api.github.com/repos/TuneLab/go-truss/branches{/branch}","tags_url":"https://api.github.com/repos/TuneLab/go-truss/tags","blobs_url":"https://api.github.com/repos/TuneLab/go-truss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TuneLab/go-truss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TuneLab/go-truss/git/refs{/sha}","trees_url":"https://api.github.com/repos/TuneLab/go-truss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TuneLab/go-truss/statuses/{sha}","languages_url":"https://api.github.com/repos/TuneLab/go-truss/languages","stargazers_url":"https://api.github.com/repos/TuneLab/go-truss/stargazers","contributors_url":"https://api.github.com/repos/TuneLab/go-truss/contributors","subscribers_url":"https://api.github.com/repos/TuneLab/go-truss/subscribers","subscription_url":"https://api.github.com/repos/TuneLab/go-truss/subscription","commits_url":"https://api.github.com/repos/TuneLab/go-truss/commits{/sha}","git_commits_url":"https://api.github.com/repos/TuneLab/go-truss/git/commits{/sha}","comments_url":"https://api.github.com/repos/TuneLab/go-truss/comments{/number}","issue_comment_url":"https://api.github.com/repos/TuneLab/go-truss/issues/comments{/number}","contents_url":"https://api.github.com/repos/TuneLab/go-truss/contents/{+path}","compare_url":"https://api.github.com/repos/TuneLab/go-truss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TuneLab/go-truss/merges","archive_url":"https://api.github.com/repos/TuneLab/go-truss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TuneLab/go-truss/downloads","issues_url":"https://api.github.com/repos/TuneLab/go-truss/issues{/number}","pulls_url":"https://api.github.com/repos/TuneLab/go-truss/pulls{/number}","milestones_url":"https://api.github.com/repos/TuneLab/go-truss/milestones{/number}","notifications_url":"https://api.github.com/repos/TuneLab/go-truss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TuneLab/go-truss/labels{/name}","releases_url":"https://api.github.com/repos/TuneLab/go-truss/releases{/id}","deployments_url":"https://api.github.com/repos/TuneLab/go-truss/deployments","created_at":"2016-06-13T18:18:25Z","updated_at":"2016-10-10T00:35:58Z","pushed_at":"2016-10-13T04:37:32Z","git_url":"git://github.com/TuneLab/go-truss.git","ssh_url":"git@github.com:TuneLab/go-truss.git","clone_url":"https://github.com/TuneLab/go-truss.git","svn_url":"https://github.com/TuneLab/go-truss","homepage":"","size":10060,"stargazers_count":27,"watchers_count":27,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":10,"forks":7,"open_issues":10,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/71"},"html":{"href":"https://github.com/TuneLab/go-truss/pull/71"},"issue":{"href":"https://api.github.com/repos/TuneLab/go-truss/issues/71"},"comments":{"href":"https://api.github.com/repos/TuneLab/go-truss/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TuneLab/go-truss/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/TuneLab/go-truss/statuses/79ecc77422d283388a43b193eb6a5be15b19ef5f"}}}}
{"actor":{"display_login":"hasLeland"}}