{"action":"created","comment":{"url":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/comments/84188124","pull_request_review_id":4956870,"id":84188124,"diff_hunk":"@@ -0,0 +1,158 @@\n+// Copyright (c) 2016 Uber Technologies, Inc.\n+//\n+// Permission is hereby granted, free of charge, to any person obtaining a copy\n+// of this software and associated documentation files (the \"Software\"), to deal\n+// in the Software without restriction, including without limitation the rights\n+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+// copies of the Software, and to permit persons to whom the Software is\n+// furnished to do so, subject to the following conditions:\n+//\n+// The above copyright notice and this permission notice shall be included in\n+// all copies or substantial portions of the Software.\n+//\n+// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+// THE SOFTWARE.\n+\n+package version\n+\n+import (\n+\t\"fmt\"\n+\t\"regexp\"\n+\t\"strconv\"\n+\t\"strings\"\n+)\n+\n+type semVer struct {\n+\tMajor uint\n+\tMinor uint\n+\tPatch uint\n+\tPre   []string\n+\tMeta  string\n+}\n+\n+// Following http://semver.org/spec/v2.0.0.html\n+const numPart = `([0-9]+)\\.([0-9]+)\\.([0-9]+)`\n+const preReleasePart = `-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)`\n+const metaPart = `\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)`\n+\n+var semVerRegex = regexp.MustCompile(`^` + numPart + `(?:` + preReleasePart + `)?(?:` + metaPart + `)?$`)\n+\n+func parseSemVer(v string) (semVer, error) {\n+\tr := semVer{}\n+\tparts := semVerRegex.FindStringSubmatch(v)\n+\tif parts == nil {\n+\t\treturn r, fmt.Errorf(`cannot parse as semantic version: \"%s\"`, v)","path":"version/semver.go","position":49,"original_position":49,"commit_id":"d4956a5b55b42a1027a3159a61b2f33ef90b8e3a","original_commit_id":"755b3428db8b4f7389961769b4233fa10c35e746","user":{"login":"bombela","id":216204,"avatar_url":"https://avatars.githubusercontent.com/u/216204?v=3","gravatar_id":"","url":"https://api.github.com/users/bombela","html_url":"https://github.com/bombela","followers_url":"https://api.github.com/users/bombela/followers","following_url":"https://api.github.com/users/bombela/following{/other_user}","gists_url":"https://api.github.com/users/bombela/gists{/gist_id}","starred_url":"https://api.github.com/users/bombela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bombela/subscriptions","organizations_url":"https://api.github.com/users/bombela/orgs","repos_url":"https://api.github.com/users/bombela/repos","events_url":"https://api.github.com/users/bombela/events{/privacy}","received_events_url":"https://api.github.com/users/bombela/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-10-19T23:23:52Z","updated_at":"2016-10-19T23:33:55Z","html_url":"https://github.com/thriftrw/thriftrw-go/pull/247#discussion_r84188124","pull_request_url":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/247","_links":{"self":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/comments/84188124"},"html":{"href":"https://github.com/thriftrw/thriftrw-go/pull/247#discussion_r84188124"},"pull_request":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/247"}}},"pull_request":{"url":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/247","id":89920673,"html_url":"https://github.com/thriftrw/thriftrw-go/pull/247","diff_url":"https://github.com/thriftrw/thriftrw-go/pull/247.diff","patch_url":"https://github.com/thriftrw/thriftrw-go/pull/247.patch","issue_url":"https://api.github.com/repos/thriftrw/thriftrw-go/issues/247","number":247,"state":"open","locked":false,"title":"Generated code will be checked for version compatibility","user":{"login":"bombela","id":216204,"avatar_url":"https://avatars.githubusercontent.com/u/216204?v=3","gravatar_id":"","url":"https://api.github.com/users/bombela","html_url":"https://github.com/bombela","followers_url":"https://api.github.com/users/bombela/followers","following_url":"https://api.github.com/users/bombela/following{/other_user}","gists_url":"https://api.github.com/users/bombela/gists{/gist_id}","starred_url":"https://api.github.com/users/bombela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bombela/subscriptions","organizations_url":"https://api.github.com/users/bombela/orgs","repos_url":"https://api.github.com/users/bombela/repos","events_url":"https://api.github.com/users/bombela/events{/privacy}","received_events_url":"https://api.github.com/users/bombela/received_events","type":"User","site_admin":false},"body":"- Every generated package is now calling `thriftrw/version.CheckCompatibilityWithGeneratedCodeAt()`\r\n- thriftrw can then check if the version of thriftrw used to generate the code is compatible with the current version\r\n\r\n\r\nfix #246","created_at":"2016-10-19T00:02:43Z","updated_at":"2016-10-19T23:33:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17232c50c815e4737eabb20caf5c99d14382e8a4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/247/commits","review_comments_url":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/247/comments","review_comment_url":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thriftrw/thriftrw-go/issues/247/comments","statuses_url":"https://api.github.com/repos/thriftrw/thriftrw-go/statuses/d4956a5b55b42a1027a3159a61b2f33ef90b8e3a","head":{"label":"thriftrw:checkver","ref":"checkver","sha":"d4956a5b55b42a1027a3159a61b2f33ef90b8e3a","user":{"login":"thriftrw","id":16569516,"avatar_url":"https://avatars.githubusercontent.com/u/16569516?v=3","gravatar_id":"","url":"https://api.github.com/users/thriftrw","html_url":"https://github.com/thriftrw","followers_url":"https://api.github.com/users/thriftrw/followers","following_url":"https://api.github.com/users/thriftrw/following{/other_user}","gists_url":"https://api.github.com/users/thriftrw/gists{/gist_id}","starred_url":"https://api.github.com/users/thriftrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thriftrw/subscriptions","organizations_url":"https://api.github.com/users/thriftrw/orgs","repos_url":"https://api.github.com/users/thriftrw/repos","events_url":"https://api.github.com/users/thriftrw/events{/privacy}","received_events_url":"https://api.github.com/users/thriftrw/received_events","type":"Organization","site_admin":false},"repo":{"id":45574831,"name":"thriftrw-go","full_name":"thriftrw/thriftrw-go","owner":{"login":"thriftrw","id":16569516,"avatar_url":"https://avatars.githubusercontent.com/u/16569516?v=3","gravatar_id":"","url":"https://api.github.com/users/thriftrw","html_url":"https://github.com/thriftrw","followers_url":"https://api.github.com/users/thriftrw/followers","following_url":"https://api.github.com/users/thriftrw/following{/other_user}","gists_url":"https://api.github.com/users/thriftrw/gists{/gist_id}","starred_url":"https://api.github.com/users/thriftrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thriftrw/subscriptions","organizations_url":"https://api.github.com/users/thriftrw/orgs","repos_url":"https://api.github.com/users/thriftrw/repos","events_url":"https://api.github.com/users/thriftrw/events{/privacy}","received_events_url":"https://api.github.com/users/thriftrw/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thriftrw/thriftrw-go","description":"A Thrift encoding code generator and library for Go","fork":false,"url":"https://api.github.com/repos/thriftrw/thriftrw-go","forks_url":"https://api.github.com/repos/thriftrw/thriftrw-go/forks","keys_url":"https://api.github.com/repos/thriftrw/thriftrw-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thriftrw/thriftrw-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thriftrw/thriftrw-go/teams","hooks_url":"https://api.github.com/repos/thriftrw/thriftrw-go/hooks","issue_events_url":"https://api.github.com/repos/thriftrw/thriftrw-go/issues/events{/number}","events_url":"https://api.github.com/repos/thriftrw/thriftrw-go/events","assignees_url":"https://api.github.com/repos/thriftrw/thriftrw-go/assignees{/user}","branches_url":"https://api.github.com/repos/thriftrw/thriftrw-go/branches{/branch}","tags_url":"https://api.github.com/repos/thriftrw/thriftrw-go/tags","blobs_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thriftrw/thriftrw-go/statuses/{sha}","languages_url":"https://api.github.com/repos/thriftrw/thriftrw-go/languages","stargazers_url":"https://api.github.com/repos/thriftrw/thriftrw-go/stargazers","contributors_url":"https://api.github.com/repos/thriftrw/thriftrw-go/contributors","subscribers_url":"https://api.github.com/repos/thriftrw/thriftrw-go/subscribers","subscription_url":"https://api.github.com/repos/thriftrw/thriftrw-go/subscription","commits_url":"https://api.github.com/repos/thriftrw/thriftrw-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/thriftrw/thriftrw-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/thriftrw/thriftrw-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/thriftrw/thriftrw-go/contents/{+path}","compare_url":"https://api.github.com/repos/thriftrw/thriftrw-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thriftrw/thriftrw-go/merges","archive_url":"https://api.github.com/repos/thriftrw/thriftrw-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thriftrw/thriftrw-go/downloads","issues_url":"https://api.github.com/repos/thriftrw/thriftrw-go/issues{/number}","pulls_url":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls{/number}","milestones_url":"https://api.github.com/repos/thriftrw/thriftrw-go/milestones{/number}","notifications_url":"https://api.github.com/repos/thriftrw/thriftrw-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thriftrw/thriftrw-go/labels{/name}","releases_url":"https://api.github.com/repos/thriftrw/thriftrw-go/releases{/id}","deployments_url":"https://api.github.com/repos/thriftrw/thriftrw-go/deployments","created_at":"2015-11-04T23:43:00Z","updated_at":"2016-09-20T19:31:17Z","pushed_at":"2016-10-19T20:41:39Z","git_url":"git://github.com/thriftrw/thriftrw-go.git","ssh_url":"git@github.com:thriftrw/thriftrw-go.git","clone_url":"https://github.com/thriftrw/thriftrw-go.git","svn_url":"https://github.com/thriftrw/thriftrw-go","homepage":"","size":974,"stargazers_count":10,"watchers_count":10,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":34,"forks":1,"open_issues":34,"watchers":10,"default_branch":"dev"}},"base":{"label":"thriftrw:dev","ref":"dev","sha":"17d16d1406b99c8ce790364357613da5ff411c38","user":{"login":"thriftrw","id":16569516,"avatar_url":"https://avatars.githubusercontent.com/u/16569516?v=3","gravatar_id":"","url":"https://api.github.com/users/thriftrw","html_url":"https://github.com/thriftrw","followers_url":"https://api.github.com/users/thriftrw/followers","following_url":"https://api.github.com/users/thriftrw/following{/other_user}","gists_url":"https://api.github.com/users/thriftrw/gists{/gist_id}","starred_url":"https://api.github.com/users/thriftrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thriftrw/subscriptions","organizations_url":"https://api.github.com/users/thriftrw/orgs","repos_url":"https://api.github.com/users/thriftrw/repos","events_url":"https://api.github.com/users/thriftrw/events{/privacy}","received_events_url":"https://api.github.com/users/thriftrw/received_events","type":"Organization","site_admin":false},"repo":{"id":45574831,"name":"thriftrw-go","full_name":"thriftrw/thriftrw-go","owner":{"login":"thriftrw","id":16569516,"avatar_url":"https://avatars.githubusercontent.com/u/16569516?v=3","gravatar_id":"","url":"https://api.github.com/users/thriftrw","html_url":"https://github.com/thriftrw","followers_url":"https://api.github.com/users/thriftrw/followers","following_url":"https://api.github.com/users/thriftrw/following{/other_user}","gists_url":"https://api.github.com/users/thriftrw/gists{/gist_id}","starred_url":"https://api.github.com/users/thriftrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thriftrw/subscriptions","organizations_url":"https://api.github.com/users/thriftrw/orgs","repos_url":"https://api.github.com/users/thriftrw/repos","events_url":"https://api.github.com/users/thriftrw/events{/privacy}","received_events_url":"https://api.github.com/users/thriftrw/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thriftrw/thriftrw-go","description":"A Thrift encoding code generator and library for Go","fork":false,"url":"https://api.github.com/repos/thriftrw/thriftrw-go","forks_url":"https://api.github.com/repos/thriftrw/thriftrw-go/forks","keys_url":"https://api.github.com/repos/thriftrw/thriftrw-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thriftrw/thriftrw-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thriftrw/thriftrw-go/teams","hooks_url":"https://api.github.com/repos/thriftrw/thriftrw-go/hooks","issue_events_url":"https://api.github.com/repos/thriftrw/thriftrw-go/issues/events{/number}","events_url":"https://api.github.com/repos/thriftrw/thriftrw-go/events","assignees_url":"https://api.github.com/repos/thriftrw/thriftrw-go/assignees{/user}","branches_url":"https://api.github.com/repos/thriftrw/thriftrw-go/branches{/branch}","tags_url":"https://api.github.com/repos/thriftrw/thriftrw-go/tags","blobs_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thriftrw/thriftrw-go/statuses/{sha}","languages_url":"https://api.github.com/repos/thriftrw/thriftrw-go/languages","stargazers_url":"https://api.github.com/repos/thriftrw/thriftrw-go/stargazers","contributors_url":"https://api.github.com/repos/thriftrw/thriftrw-go/contributors","subscribers_url":"https://api.github.com/repos/thriftrw/thriftrw-go/subscribers","subscription_url":"https://api.github.com/repos/thriftrw/thriftrw-go/subscription","commits_url":"https://api.github.com/repos/thriftrw/thriftrw-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/thriftrw/thriftrw-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/thriftrw/thriftrw-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/thriftrw/thriftrw-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/thriftrw/thriftrw-go/contents/{+path}","compare_url":"https://api.github.com/repos/thriftrw/thriftrw-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thriftrw/thriftrw-go/merges","archive_url":"https://api.github.com/repos/thriftrw/thriftrw-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thriftrw/thriftrw-go/downloads","issues_url":"https://api.github.com/repos/thriftrw/thriftrw-go/issues{/number}","pulls_url":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls{/number}","milestones_url":"https://api.github.com/repos/thriftrw/thriftrw-go/milestones{/number}","notifications_url":"https://api.github.com/repos/thriftrw/thriftrw-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thriftrw/thriftrw-go/labels{/name}","releases_url":"https://api.github.com/repos/thriftrw/thriftrw-go/releases{/id}","deployments_url":"https://api.github.com/repos/thriftrw/thriftrw-go/deployments","created_at":"2015-11-04T23:43:00Z","updated_at":"2016-09-20T19:31:17Z","pushed_at":"2016-10-19T20:41:39Z","git_url":"git://github.com/thriftrw/thriftrw-go.git","ssh_url":"git@github.com:thriftrw/thriftrw-go.git","clone_url":"https://github.com/thriftrw/thriftrw-go.git","svn_url":"https://github.com/thriftrw/thriftrw-go","homepage":"","size":974,"stargazers_count":10,"watchers_count":10,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":34,"forks":1,"open_issues":34,"watchers":10,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/247"},"html":{"href":"https://github.com/thriftrw/thriftrw-go/pull/247"},"issue":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/issues/247"},"comments":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/issues/247/comments"},"review_comments":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/247/comments"},"review_comment":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/pulls/247/commits"},"statuses":{"href":"https://api.github.com/repos/thriftrw/thriftrw-go/statuses/d4956a5b55b42a1027a3159a61b2f33ef90b8e3a"}}}}
{"actor":{"display_login":"bombela"}}