{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/cosmos/pulls/comments/65467902","id":65467902,"diff_hunk":"@@ -0,0 +1,83 @@\n+package com.mesosphere.universe.v3\n+\n+import com.mesosphere.universe.v3.DcosReleaseVersion.{Suffix, Version}\n+import com.twitter.util.{Return, Try}\n+\n+import java.util.regex.Pattern\n+\n+object DcosReleaseVersionParser {\n+\n+  private[this] val version = \"(?:0|[1-9][0-9]*)\"\n+  private[this] val subVersion = \"\\\\.\" + version\n+  private[this] val suffix = \"[A-Za-z0-9]+\"\n+\n+  private[v3] val versionRegex = s\"^$version$$\"\n+  private[v3] val suffixRegex = s\"^$suffix$$\"\n+  private[v3] val fullRegex = s\"^$version(?:$subVersion)*(?:-$suffix)?$$\"\n+\n+  private[v3] val versionPattern = Pattern.compile(versionRegex)\n+  private[v3] val suffixPattern = Pattern.compile(suffixRegex)\n+  private[v3] val fullPattern = Pattern.compile(fullRegex)\n+\n+  def parseUnsafe(s: String): DcosReleaseVersion = parse(s).get\n+\n+  //noinspection VariablePatternShadow\n+  def parse(s: String): Try[DcosReleaseVersion] = {\n+    val errMsg = s\"Value '$s' does not conform to expected format $fullRegex\"\n+    val t = Try {\n+      assert(!s.trim.isEmpty, \"Value must not be empty\")\n+      assert(fullPattern.matcher(s).matches(), errMsg)\n+\n+      s.split('-').toList match {\n+        case version :: suffix :: Nil=>\n+          version -> Some(suffix)\n+        case version :: Nil =>","path":"cosmos-model/src/main/scala/com/mesosphere/universe/v3/DcosReleaseVersionParser.scala","position":34,"original_position":34,"commit_id":"45b54f6f2c215d8f956d2e81439d93573766ff5e","original_commit_id":"45b54f6f2c215d8f956d2e81439d93573766ff5e","user":{"login":"jsancio","id":794394,"avatar_url":"https://avatars.githubusercontent.com/u/794394?v=3","gravatar_id":"","url":"https://api.github.com/users/jsancio","html_url":"https://github.com/jsancio","followers_url":"https://api.github.com/users/jsancio/followers","following_url":"https://api.github.com/users/jsancio/following{/other_user}","gists_url":"https://api.github.com/users/jsancio/gists{/gist_id}","starred_url":"https://api.github.com/users/jsancio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsancio/subscriptions","organizations_url":"https://api.github.com/users/jsancio/orgs","repos_url":"https://api.github.com/users/jsancio/repos","events_url":"https://api.github.com/users/jsancio/events{/privacy}","received_events_url":"https://api.github.com/users/jsancio/received_events","type":"User","site_admin":false},"body":"I think you can get rid of `noinspect VariablePatternShadow` if you rename the `version` variable.","created_at":"2016-06-02T00:39:00Z","updated_at":"2016-06-02T00:39:00Z","html_url":"https://github.com/dcos/cosmos/pull/350#discussion_r65467902","pull_request_url":"https://api.github.com/repos/dcos/cosmos/pulls/350","_links":{"self":{"href":"https://api.github.com/repos/dcos/cosmos/pulls/comments/65467902"},"html":{"href":"https://github.com/dcos/cosmos/pull/350#discussion_r65467902"},"pull_request":{"href":"https://api.github.com/repos/dcos/cosmos/pulls/350"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/cosmos/pulls/350","id":72270860,"html_url":"https://github.com/dcos/cosmos/pull/350","diff_url":"https://github.com/dcos/cosmos/pull/350.diff","patch_url":"https://github.com/dcos/cosmos/pull/350.patch","issue_url":"https://api.github.com/repos/dcos/cosmos/issues/350","number":350,"state":"open","locked":false,"title":"Create new class to represent DcosReleaseVersion","user":{"login":"BenWhitehead","id":1754037,"avatar_url":"https://avatars.githubusercontent.com/u/1754037?v=3","gravatar_id":"","url":"https://api.github.com/users/BenWhitehead","html_url":"https://github.com/BenWhitehead","followers_url":"https://api.github.com/users/BenWhitehead/followers","following_url":"https://api.github.com/users/BenWhitehead/following{/other_user}","gists_url":"https://api.github.com/users/BenWhitehead/gists{/gist_id}","starred_url":"https://api.github.com/users/BenWhitehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenWhitehead/subscriptions","organizations_url":"https://api.github.com/users/BenWhitehead/orgs","repos_url":"https://api.github.com/users/BenWhitehead/repos","events_url":"https://api.github.com/users/BenWhitehead/events{/privacy}","received_events_url":"https://api.github.com/users/BenWhitehead/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-01T23:54:28Z","updated_at":"2016-06-02T00:39:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d53423b155f8475a14750898ab0b29a9a643693","assignee":null,"milestone":{"url":"https://api.github.com/repos/dcos/cosmos/milestones/16","html_url":"https://github.com/dcos/cosmos/milestones/versioning","labels_url":"https://api.github.com/repos/dcos/cosmos/milestones/16/labels","id":1743580,"number":16,"title":"versioning","description":"","creator":{"login":"jsancio","id":794394,"avatar_url":"https://avatars.githubusercontent.com/u/794394?v=3","gravatar_id":"","url":"https://api.github.com/users/jsancio","html_url":"https://github.com/jsancio","followers_url":"https://api.github.com/users/jsancio/followers","following_url":"https://api.github.com/users/jsancio/following{/other_user}","gists_url":"https://api.github.com/users/jsancio/gists{/gist_id}","starred_url":"https://api.github.com/users/jsancio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsancio/subscriptions","organizations_url":"https://api.github.com/users/jsancio/orgs","repos_url":"https://api.github.com/users/jsancio/repos","events_url":"https://api.github.com/users/jsancio/events{/privacy}","received_events_url":"https://api.github.com/users/jsancio/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":7,"state":"open","created_at":"2016-05-02T21:03:57Z","updated_at":"2016-06-01T23:54:28Z","due_on":"2016-06-06T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/dcos/cosmos/pulls/350/commits","review_comments_url":"https://api.github.com/repos/dcos/cosmos/pulls/350/comments","review_comment_url":"https://api.github.com/repos/dcos/cosmos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/cosmos/issues/350/comments","statuses_url":"https://api.github.com/repos/dcos/cosmos/statuses/45b54f6f2c215d8f956d2e81439d93573766ff5e","head":{"label":"dcos:dcos-release-version","ref":"dcos-release-version","sha":"45b54f6f2c215d8f956d2e81439d93573766ff5e","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":47585661,"name":"cosmos","full_name":"dcos/cosmos","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/cosmos","description":"An orderly, harmonius, complete system for DC/OS - package management","fork":false,"url":"https://api.github.com/repos/dcos/cosmos","forks_url":"https://api.github.com/repos/dcos/cosmos/forks","keys_url":"https://api.github.com/repos/dcos/cosmos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/cosmos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/cosmos/teams","hooks_url":"https://api.github.com/repos/dcos/cosmos/hooks","issue_events_url":"https://api.github.com/repos/dcos/cosmos/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/cosmos/events","assignees_url":"https://api.github.com/repos/dcos/cosmos/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/cosmos/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/cosmos/tags","blobs_url":"https://api.github.com/repos/dcos/cosmos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/cosmos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/cosmos/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/cosmos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/cosmos/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/cosmos/languages","stargazers_url":"https://api.github.com/repos/dcos/cosmos/stargazers","contributors_url":"https://api.github.com/repos/dcos/cosmos/contributors","subscribers_url":"https://api.github.com/repos/dcos/cosmos/subscribers","subscription_url":"https://api.github.com/repos/dcos/cosmos/subscription","commits_url":"https://api.github.com/repos/dcos/cosmos/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/cosmos/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/cosmos/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/cosmos/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/cosmos/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/cosmos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/cosmos/merges","archive_url":"https://api.github.com/repos/dcos/cosmos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/cosmos/downloads","issues_url":"https://api.github.com/repos/dcos/cosmos/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/cosmos/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/cosmos/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/cosmos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/cosmos/labels{/name}","releases_url":"https://api.github.com/repos/dcos/cosmos/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/cosmos/deployments","created_at":"2015-12-07T23:23:49Z","updated_at":"2016-05-23T15:33:17Z","pushed_at":"2016-06-01T23:54:28Z","git_url":"git://github.com/dcos/cosmos.git","ssh_url":"git@github.com:dcos/cosmos.git","clone_url":"https://github.com/dcos/cosmos.git","svn_url":"https://github.com/dcos/cosmos","homepage":"","size":629,"stargazers_count":20,"watchers_count":20,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":99,"forks":2,"open_issues":99,"watchers":20,"default_branch":"master"}},"base":{"label":"dcos:master","ref":"master","sha":"7ae982fc3db4fcb290a4953960d24d6f58dc0d10","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":47585661,"name":"cosmos","full_name":"dcos/cosmos","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/cosmos","description":"An orderly, harmonius, complete system for DC/OS - package management","fork":false,"url":"https://api.github.com/repos/dcos/cosmos","forks_url":"https://api.github.com/repos/dcos/cosmos/forks","keys_url":"https://api.github.com/repos/dcos/cosmos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/cosmos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/cosmos/teams","hooks_url":"https://api.github.com/repos/dcos/cosmos/hooks","issue_events_url":"https://api.github.com/repos/dcos/cosmos/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/cosmos/events","assignees_url":"https://api.github.com/repos/dcos/cosmos/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/cosmos/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/cosmos/tags","blobs_url":"https://api.github.com/repos/dcos/cosmos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/cosmos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/cosmos/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/cosmos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/cosmos/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/cosmos/languages","stargazers_url":"https://api.github.com/repos/dcos/cosmos/stargazers","contributors_url":"https://api.github.com/repos/dcos/cosmos/contributors","subscribers_url":"https://api.github.com/repos/dcos/cosmos/subscribers","subscription_url":"https://api.github.com/repos/dcos/cosmos/subscription","commits_url":"https://api.github.com/repos/dcos/cosmos/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/cosmos/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/cosmos/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/cosmos/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/cosmos/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/cosmos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/cosmos/merges","archive_url":"https://api.github.com/repos/dcos/cosmos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/cosmos/downloads","issues_url":"https://api.github.com/repos/dcos/cosmos/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/cosmos/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/cosmos/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/cosmos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/cosmos/labels{/name}","releases_url":"https://api.github.com/repos/dcos/cosmos/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/cosmos/deployments","created_at":"2015-12-07T23:23:49Z","updated_at":"2016-05-23T15:33:17Z","pushed_at":"2016-06-01T23:54:28Z","git_url":"git://github.com/dcos/cosmos.git","ssh_url":"git@github.com:dcos/cosmos.git","clone_url":"https://github.com/dcos/cosmos.git","svn_url":"https://github.com/dcos/cosmos","homepage":"","size":629,"stargazers_count":20,"watchers_count":20,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":99,"forks":2,"open_issues":99,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/cosmos/pulls/350"},"html":{"href":"https://github.com/dcos/cosmos/pull/350"},"issue":{"href":"https://api.github.com/repos/dcos/cosmos/issues/350"},"comments":{"href":"https://api.github.com/repos/dcos/cosmos/issues/350/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/cosmos/pulls/350/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/cosmos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/cosmos/pulls/350/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/cosmos/statuses/45b54f6f2c215d8f956d2e81439d93573766ff5e"}}}}
{"actor":{"display_login":"jsancio"}}