{"action":"closed","number":598,"pull_request":{"url":"https://api.github.com/repos/spring-io/sagan/pulls/598","id":50065249,"html_url":"https://github.com/spring-io/sagan/pull/598","diff_url":"https://github.com/spring-io/sagan/pull/598.diff","patch_url":"https://github.com/spring-io/sagan/pull/598.patch","issue_url":"https://api.github.com/repos/spring-io/sagan/issues/598","number":598,"state":"closed","locked":false,"title":"Fix issue #594 - version ordering","user":{"login":"jadekler","id":3584893,"avatar_url":"https://avatars.githubusercontent.com/u/3584893?v=3","gravatar_id":"","url":"https://api.github.com/users/jadekler","html_url":"https://github.com/jadekler","followers_url":"https://api.github.com/users/jadekler/followers","following_url":"https://api.github.com/users/jadekler/following{/other_user}","gists_url":"https://api.github.com/users/jadekler/gists{/gist_id}","starred_url":"https://api.github.com/users/jadekler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadekler/subscriptions","organizations_url":"https://api.github.com/users/jadekler/orgs","repos_url":"https://api.github.com/users/jadekler/repos","events_url":"https://api.github.com/users/jadekler/events{/privacy}","received_events_url":"https://api.github.com/users/jadekler/received_events","type":"User","site_admin":false},"body":"Issue #594 seems to be occurring because versions are stored as strings and compared as strings - 1.10 is compared to 1.9 as character '1' vs character '9' instead of number '10' vs '9'. This change addresses issue #594 by adding a comparator that cares about numbers and using that comparator whenever we call Project::getProjectReleases.\r\n\r\nTwo quick notes:\r\n\r\n- Not sure if people are comfortable solving this kind of problem through getters. Figured the alternative is to find all places we're using projectReleases and sort - which seems like a lot of duplicated effort - or change the db model to not have version as a string, which seems like a big chore.\r\n- ProjectAdminController - `@RequestMapping(value = \"{id}\", method = POST) public String save(@Valid Project project... etc` - calls Project::getProjectReleases several times before the object is fully constructed. I'm guessing it's part of the json->object building process. This has the unfortunate side-affect of our getter needing nullchecks, which sucks. Would love other suggestions if there's a better way to solve that problem. I was thinking of looking into removing setters on the object entirely and seeing if that solves it.\r\n\r\nedit: Additional note - I noticed that `ProjectAdminController` does a fair amount of mutation to Project during its CRUD operations. I'm thinking of refactoring it to be a bit more stateless. Let me know if that's a bad idea.","created_at":"2015-11-08T17:41:19Z","updated_at":"2015-12-04T13:24:35Z","closed_at":"2015-12-04T13:24:34Z","merged_at":"2015-12-04T13:24:34Z","merge_commit_sha":"01737492efb89a4bff29e0753a9a7ce5de2d9ba1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spring-io/sagan/pulls/598/commits","review_comments_url":"https://api.github.com/repos/spring-io/sagan/pulls/598/comments","review_comment_url":"https://api.github.com/repos/spring-io/sagan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-io/sagan/issues/598/comments","statuses_url":"https://api.github.com/repos/spring-io/sagan/statuses/ff1b0fad230370e46a932a25bec1e2f00c0182f7","head":{"label":"jadekler:master","ref":"master","sha":"ff1b0fad230370e46a932a25bec1e2f00c0182f7","user":{"login":"jadekler","id":3584893,"avatar_url":"https://avatars.githubusercontent.com/u/3584893?v=3","gravatar_id":"","url":"https://api.github.com/users/jadekler","html_url":"https://github.com/jadekler","followers_url":"https://api.github.com/users/jadekler/followers","following_url":"https://api.github.com/users/jadekler/following{/other_user}","gists_url":"https://api.github.com/users/jadekler/gists{/gist_id}","starred_url":"https://api.github.com/users/jadekler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadekler/subscriptions","organizations_url":"https://api.github.com/users/jadekler/orgs","repos_url":"https://api.github.com/users/jadekler/repos","events_url":"https://api.github.com/users/jadekler/events{/privacy}","received_events_url":"https://api.github.com/users/jadekler/received_events","type":"User","site_admin":false},"repo":{"id":45755763,"name":"sagan","full_name":"jadekler/sagan","owner":{"login":"jadekler","id":3584893,"avatar_url":"https://avatars.githubusercontent.com/u/3584893?v=3","gravatar_id":"","url":"https://api.github.com/users/jadekler","html_url":"https://github.com/jadekler","followers_url":"https://api.github.com/users/jadekler/followers","following_url":"https://api.github.com/users/jadekler/following{/other_user}","gists_url":"https://api.github.com/users/jadekler/gists{/gist_id}","starred_url":"https://api.github.com/users/jadekler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadekler/subscriptions","organizations_url":"https://api.github.com/users/jadekler/orgs","repos_url":"https://api.github.com/users/jadekler/repos","events_url":"https://api.github.com/users/jadekler/events{/privacy}","received_events_url":"https://api.github.com/users/jadekler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jadekler/sagan","description":"The spring.io site and reference application","fork":true,"url":"https://api.github.com/repos/jadekler/sagan","forks_url":"https://api.github.com/repos/jadekler/sagan/forks","keys_url":"https://api.github.com/repos/jadekler/sagan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jadekler/sagan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jadekler/sagan/teams","hooks_url":"https://api.github.com/repos/jadekler/sagan/hooks","issue_events_url":"https://api.github.com/repos/jadekler/sagan/issues/events{/number}","events_url":"https://api.github.com/repos/jadekler/sagan/events","assignees_url":"https://api.github.com/repos/jadekler/sagan/assignees{/user}","branches_url":"https://api.github.com/repos/jadekler/sagan/branches{/branch}","tags_url":"https://api.github.com/repos/jadekler/sagan/tags","blobs_url":"https://api.github.com/repos/jadekler/sagan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jadekler/sagan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jadekler/sagan/git/refs{/sha}","trees_url":"https://api.github.com/repos/jadekler/sagan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jadekler/sagan/statuses/{sha}","languages_url":"https://api.github.com/repos/jadekler/sagan/languages","stargazers_url":"https://api.github.com/repos/jadekler/sagan/stargazers","contributors_url":"https://api.github.com/repos/jadekler/sagan/contributors","subscribers_url":"https://api.github.com/repos/jadekler/sagan/subscribers","subscription_url":"https://api.github.com/repos/jadekler/sagan/subscription","commits_url":"https://api.github.com/repos/jadekler/sagan/commits{/sha}","git_commits_url":"https://api.github.com/repos/jadekler/sagan/git/commits{/sha}","comments_url":"https://api.github.com/repos/jadekler/sagan/comments{/number}","issue_comment_url":"https://api.github.com/repos/jadekler/sagan/issues/comments{/number}","contents_url":"https://api.github.com/repos/jadekler/sagan/contents/{+path}","compare_url":"https://api.github.com/repos/jadekler/sagan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jadekler/sagan/merges","archive_url":"https://api.github.com/repos/jadekler/sagan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jadekler/sagan/downloads","issues_url":"https://api.github.com/repos/jadekler/sagan/issues{/number}","pulls_url":"https://api.github.com/repos/jadekler/sagan/pulls{/number}","milestones_url":"https://api.github.com/repos/jadekler/sagan/milestones{/number}","notifications_url":"https://api.github.com/repos/jadekler/sagan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jadekler/sagan/labels{/name}","releases_url":"https://api.github.com/repos/jadekler/sagan/releases{/id}","created_at":"2015-11-07T21:38:29Z","updated_at":"2015-11-07T21:38:33Z","pushed_at":"2015-11-24T03:40:53Z","git_url":"git://github.com/jadekler/sagan.git","ssh_url":"git@github.com:jadekler/sagan.git","clone_url":"https://github.com/jadekler/sagan.git","svn_url":"https://github.com/jadekler/sagan","homepage":"http://spring.io","size":21867,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"spring-io:master","ref":"master","sha":"ef9aeb3b8d913a453a589f2fb21c451776258531","user":{"login":"spring-io","id":5138804,"avatar_url":"https://avatars.githubusercontent.com/u/5138804?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-io","html_url":"https://github.com/spring-io","followers_url":"https://api.github.com/users/spring-io/followers","following_url":"https://api.github.com/users/spring-io/following{/other_user}","gists_url":"https://api.github.com/users/spring-io/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-io/subscriptions","organizations_url":"https://api.github.com/users/spring-io/orgs","repos_url":"https://api.github.com/users/spring-io/repos","events_url":"https://api.github.com/users/spring-io/events{/privacy}","received_events_url":"https://api.github.com/users/spring-io/received_events","type":"Organization","site_admin":false},"repo":{"id":9934972,"name":"sagan","full_name":"spring-io/sagan","owner":{"login":"spring-io","id":5138804,"avatar_url":"https://avatars.githubusercontent.com/u/5138804?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-io","html_url":"https://github.com/spring-io","followers_url":"https://api.github.com/users/spring-io/followers","following_url":"https://api.github.com/users/spring-io/following{/other_user}","gists_url":"https://api.github.com/users/spring-io/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-io/subscriptions","organizations_url":"https://api.github.com/users/spring-io/orgs","repos_url":"https://api.github.com/users/spring-io/repos","events_url":"https://api.github.com/users/spring-io/events{/privacy}","received_events_url":"https://api.github.com/users/spring-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-io/sagan","description":"The spring.io site and reference application","fork":false,"url":"https://api.github.com/repos/spring-io/sagan","forks_url":"https://api.github.com/repos/spring-io/sagan/forks","keys_url":"https://api.github.com/repos/spring-io/sagan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-io/sagan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-io/sagan/teams","hooks_url":"https://api.github.com/repos/spring-io/sagan/hooks","issue_events_url":"https://api.github.com/repos/spring-io/sagan/issues/events{/number}","events_url":"https://api.github.com/repos/spring-io/sagan/events","assignees_url":"https://api.github.com/repos/spring-io/sagan/assignees{/user}","branches_url":"https://api.github.com/repos/spring-io/sagan/branches{/branch}","tags_url":"https://api.github.com/repos/spring-io/sagan/tags","blobs_url":"https://api.github.com/repos/spring-io/sagan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-io/sagan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-io/sagan/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-io/sagan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-io/sagan/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-io/sagan/languages","stargazers_url":"https://api.github.com/repos/spring-io/sagan/stargazers","contributors_url":"https://api.github.com/repos/spring-io/sagan/contributors","subscribers_url":"https://api.github.com/repos/spring-io/sagan/subscribers","subscription_url":"https://api.github.com/repos/spring-io/sagan/subscription","commits_url":"https://api.github.com/repos/spring-io/sagan/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-io/sagan/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-io/sagan/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-io/sagan/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-io/sagan/contents/{+path}","compare_url":"https://api.github.com/repos/spring-io/sagan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-io/sagan/merges","archive_url":"https://api.github.com/repos/spring-io/sagan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-io/sagan/downloads","issues_url":"https://api.github.com/repos/spring-io/sagan/issues{/number}","pulls_url":"https://api.github.com/repos/spring-io/sagan/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-io/sagan/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-io/sagan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-io/sagan/labels{/name}","releases_url":"https://api.github.com/repos/spring-io/sagan/releases{/id}","created_at":"2013-05-08T11:36:50Z","updated_at":"2015-12-02T09:36:00Z","pushed_at":"2015-12-04T13:24:34Z","git_url":"git://github.com/spring-io/sagan.git","ssh_url":"git@github.com:spring-io/sagan.git","clone_url":"https://github.com/spring-io/sagan.git","svn_url":"https://github.com/spring-io/sagan","homepage":"http://spring.io","size":40663,"stargazers_count":473,"watchers_count":473,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":234,"mirror_url":null,"open_issues_count":95,"forks":234,"open_issues":95,"watchers":473,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-io/sagan/pulls/598"},"html":{"href":"https://github.com/spring-io/sagan/pull/598"},"issue":{"href":"https://api.github.com/repos/spring-io/sagan/issues/598"},"comments":{"href":"https://api.github.com/repos/spring-io/sagan/issues/598/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-io/sagan/pulls/598/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-io/sagan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-io/sagan/pulls/598/commits"},"statuses":{"href":"https://api.github.com/repos/spring-io/sagan/statuses/ff1b0fad230370e46a932a25bec1e2f00c0182f7"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"bclozel","id":103264,"avatar_url":"https://avatars.githubusercontent.com/u/103264?v=3","gravatar_id":"","url":"https://api.github.com/users/bclozel","html_url":"https://github.com/bclozel","followers_url":"https://api.github.com/users/bclozel/followers","following_url":"https://api.github.com/users/bclozel/following{/other_user}","gists_url":"https://api.github.com/users/bclozel/gists{/gist_id}","starred_url":"https://api.github.com/users/bclozel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclozel/subscriptions","organizations_url":"https://api.github.com/users/bclozel/orgs","repos_url":"https://api.github.com/users/bclozel/repos","events_url":"https://api.github.com/users/bclozel/events{/privacy}","received_events_url":"https://api.github.com/users/bclozel/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":109,"deletions":4,"changed_files":3}}