{"action":"created","comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/comments/186022233","pull_request_review_id":117531036,"id":186022233,"diff_hunk":"@@ -0,0 +1,293 @@\n+<?php\n+\n+namespace SilverStripe\\Upgrader\\Composer;\n+\n+use Composer\\Semver\\Semver;\n+use Composer\\Semver\\VersionParser;\n+\n+/**\n+ * Represent a packagist package.\n+ */\n+class Package\n+{\n+\n+    /**\n+     * List of supported Silverstripe Module.\n+     * @var array\n+     */\n+    const SUPPORTED_MODULES = [\n+        \"assertchris/hash-compat\",","path":"src/Composer/Package.php","position":19,"original_position":19,"commit_id":"dfb19d5bbea1766fd47f4434d380dc6384cc193f","original_commit_id":"dfb19d5bbea1766fd47f4434d380dc6384cc193f","user":{"login":"robbieaverill","id":5170590,"avatar_url":"https://avatars1.githubusercontent.com/u/5170590?v=4","gravatar_id":"","url":"https://api.github.com/users/robbieaverill","html_url":"https://github.com/robbieaverill","followers_url":"https://api.github.com/users/robbieaverill/followers","following_url":"https://api.github.com/users/robbieaverill/following{/other_user}","gists_url":"https://api.github.com/users/robbieaverill/gists{/gist_id}","starred_url":"https://api.github.com/users/robbieaverill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbieaverill/subscriptions","organizations_url":"https://api.github.com/users/robbieaverill/orgs","repos_url":"https://api.github.com/users/robbieaverill/repos","events_url":"https://api.github.com/users/robbieaverill/events{/privacy}","received_events_url":"https://api.github.com/users/robbieaverill/received_events","type":"User","site_admin":false},"body":"Oh that’s what you meant! There is a supported-modules repo on this GitHub account with a JSON file containing these but it’s probably out f date. We could use that and update it?","created_at":"2018-05-04T08:50:00Z","updated_at":"2018-05-04T08:50:00Z","html_url":"https://github.com/silverstripe/silverstripe-upgrader/pull/67#discussion_r186022233","pull_request_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/67","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/comments/186022233"},"html":{"href":"https://github.com/silverstripe/silverstripe-upgrader/pull/67#discussion_r186022233"},"pull_request":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/67"}},"in_reply_to_id":185978524},"pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/67","id":185127624,"html_url":"https://github.com/silverstripe/silverstripe-upgrader/pull/67","diff_url":"https://github.com/silverstripe/silverstripe-upgrader/pull/67.diff","patch_url":"https://github.com/silverstripe/silverstripe-upgrader/pull/67.patch","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/issues/67","number":67,"state":"open","locked":false,"title":"Add a recomposer command to upgrade a composer schema.","user":{"login":"maxime-rainville","id":1168676,"avatar_url":"https://avatars0.githubusercontent.com/u/1168676?v=4","gravatar_id":"","url":"https://api.github.com/users/maxime-rainville","html_url":"https://github.com/maxime-rainville","followers_url":"https://api.github.com/users/maxime-rainville/followers","following_url":"https://api.github.com/users/maxime-rainville/following{/other_user}","gists_url":"https://api.github.com/users/maxime-rainville/gists{/gist_id}","starred_url":"https://api.github.com/users/maxime-rainville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxime-rainville/subscriptions","organizations_url":"https://api.github.com/users/maxime-rainville/orgs","repos_url":"https://api.github.com/users/maxime-rainville/repos","events_url":"https://api.github.com/users/maxime-rainville/events{/privacy}","received_events_url":"https://api.github.com/users/maxime-rainville/received_events","type":"User","site_admin":false},"body":"Added a command to upgrade your `composer.json` file.\r\n\r\n# High level explanation of what's going on\r\nYou can use the `ComposerSchema` class to interact with a compose.json file. This class as an `upgrade` method that accepts an array of _rules_ that will be applied to the requirements in the file.\r\n\r\nThe main rule is called `rebuild`. This rule will create an empty composer file and try add back all the dependencies one-by-one but with a constraint on SS4.\r\n\r\nOnce it's done that, it will try to find a combination of recipe that could replace some of the packages.\r\n\r\nAt the end of the process, you should always have a composer file with all the dependencies you started of with (or equivalent recipes). Your dependencies might/probably will have conflicts that will need to be resolved manually.\r\n\r\n# Patience is a virtue\r\nThis command can take quite bit of time to run, because it's making a lot of calls to composer and fetching a lot dependencies from Packagist. Running it on a composer file with 50 dependencies can take 6-10 min.\r\n\r\nI've tried to add a bit of caching, but it's kind-of-dirty and hackish. Also because we're fetching things from the internet some of the unit test will have non-deterministic results (e.g.: Someone updating their package version online could break a test). I tried the write the test to minimize the risk of this happening, but short of completely mocking up composer, itm ight not be possible to work around this.\r\n\r\n# Parent issue\r\n#45 ","created_at":"2018-05-01T06:21:35Z","updated_at":"2018-05-04T08:50:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d23085f58bef58afabda35670c757aebf3d555c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/67/commits","review_comments_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/67/comments","review_comment_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/comments{/number}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/issues/67/comments","statuses_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/statuses/dfb19d5bbea1766fd47f4434d380dc6384cc193f","head":{"label":"open-sausages:pulls/1/recomposer","ref":"pulls/1/recomposer","sha":"dfb19d5bbea1766fd47f4434d380dc6384cc193f","user":{"login":"open-sausages","id":12824172,"avatar_url":"https://avatars2.githubusercontent.com/u/12824172?v=4","gravatar_id":"","url":"https://api.github.com/users/open-sausages","html_url":"https://github.com/open-sausages","followers_url":"https://api.github.com/users/open-sausages/followers","following_url":"https://api.github.com/users/open-sausages/following{/other_user}","gists_url":"https://api.github.com/users/open-sausages/gists{/gist_id}","starred_url":"https://api.github.com/users/open-sausages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-sausages/subscriptions","organizations_url":"https://api.github.com/users/open-sausages/orgs","repos_url":"https://api.github.com/users/open-sausages/repos","events_url":"https://api.github.com/users/open-sausages/events{/privacy}","received_events_url":"https://api.github.com/users/open-sausages/received_events","type":"Organization","site_admin":false},"repo":{"id":70861985,"name":"silverstripe-upgrader","full_name":"open-sausages/silverstripe-upgrader","owner":{"login":"open-sausages","id":12824172,"avatar_url":"https://avatars2.githubusercontent.com/u/12824172?v=4","gravatar_id":"","url":"https://api.github.com/users/open-sausages","html_url":"https://github.com/open-sausages","followers_url":"https://api.github.com/users/open-sausages/followers","following_url":"https://api.github.com/users/open-sausages/following{/other_user}","gists_url":"https://api.github.com/users/open-sausages/gists{/gist_id}","starred_url":"https://api.github.com/users/open-sausages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-sausages/subscriptions","organizations_url":"https://api.github.com/users/open-sausages/orgs","repos_url":"https://api.github.com/users/open-sausages/repos","events_url":"https://api.github.com/users/open-sausages/events{/privacy}","received_events_url":"https://api.github.com/users/open-sausages/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-sausages/silverstripe-upgrader","description":"A tool to help upgrade your code to handle API changes in packages you used.","fork":true,"url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader","forks_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/forks","keys_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/teams","hooks_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/hooks","issue_events_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/issues/events{/number}","events_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/events","assignees_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/assignees{/user}","branches_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/branches{/branch}","tags_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/tags","blobs_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/statuses/{sha}","languages_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/languages","stargazers_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/stargazers","contributors_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/contributors","subscribers_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/subscribers","subscription_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/subscription","commits_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/contents/{+path}","compare_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/merges","archive_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/downloads","issues_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/issues{/number}","pulls_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/pulls{/number}","milestones_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/milestones{/number}","notifications_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/labels{/name}","releases_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/releases{/id}","deployments_url":"https://api.github.com/repos/open-sausages/silverstripe-upgrader/deployments","created_at":"2016-10-14T01:19:56Z","updated_at":"2016-10-14T01:19:57Z","pushed_at":"2018-05-04T05:46:24Z","git_url":"git://github.com/open-sausages/silverstripe-upgrader.git","ssh_url":"git@github.com:open-sausages/silverstripe-upgrader.git","clone_url":"https://github.com/open-sausages/silverstripe-upgrader.git","svn_url":"https://github.com/open-sausages/silverstripe-upgrader","homepage":null,"size":433,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"silverstripe:master","ref":"master","sha":"324471ffffc5b690a43f312f09cff69542c4366b","user":{"login":"silverstripe","id":379348,"avatar_url":"https://avatars0.githubusercontent.com/u/379348?v=4","gravatar_id":"","url":"https://api.github.com/users/silverstripe","html_url":"https://github.com/silverstripe","followers_url":"https://api.github.com/users/silverstripe/followers","following_url":"https://api.github.com/users/silverstripe/following{/other_user}","gists_url":"https://api.github.com/users/silverstripe/gists{/gist_id}","starred_url":"https://api.github.com/users/silverstripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverstripe/subscriptions","organizations_url":"https://api.github.com/users/silverstripe/orgs","repos_url":"https://api.github.com/users/silverstripe/repos","events_url":"https://api.github.com/users/silverstripe/events{/privacy}","received_events_url":"https://api.github.com/users/silverstripe/received_events","type":"Organization","site_admin":false},"repo":{"id":57424901,"name":"silverstripe-upgrader","full_name":"silverstripe/silverstripe-upgrader","owner":{"login":"silverstripe","id":379348,"avatar_url":"https://avatars0.githubusercontent.com/u/379348?v=4","gravatar_id":"","url":"https://api.github.com/users/silverstripe","html_url":"https://github.com/silverstripe","followers_url":"https://api.github.com/users/silverstripe/followers","following_url":"https://api.github.com/users/silverstripe/following{/other_user}","gists_url":"https://api.github.com/users/silverstripe/gists{/gist_id}","starred_url":"https://api.github.com/users/silverstripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverstripe/subscriptions","organizations_url":"https://api.github.com/users/silverstripe/orgs","repos_url":"https://api.github.com/users/silverstripe/repos","events_url":"https://api.github.com/users/silverstripe/events{/privacy}","received_events_url":"https://api.github.com/users/silverstripe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/silverstripe/silverstripe-upgrader","description":"A tool to help upgrade your code to handle API changes in packages you used.","fork":false,"url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader","forks_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/forks","keys_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/teams","hooks_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/hooks","issue_events_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/issues/events{/number}","events_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/events","assignees_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/assignees{/user}","branches_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/branches{/branch}","tags_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/tags","blobs_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/git/refs{/sha}","trees_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/statuses/{sha}","languages_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/languages","stargazers_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/stargazers","contributors_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/contributors","subscribers_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/subscribers","subscription_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/subscription","commits_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/commits{/sha}","git_commits_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/git/commits{/sha}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/comments{/number}","issue_comment_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/issues/comments{/number}","contents_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/contents/{+path}","compare_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/merges","archive_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/downloads","issues_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/issues{/number}","pulls_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls{/number}","milestones_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/milestones{/number}","notifications_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/labels{/name}","releases_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/releases{/id}","deployments_url":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/deployments","created_at":"2016-04-30T03:09:51Z","updated_at":"2018-05-02T03:06:49Z","pushed_at":"2018-05-04T00:50:12Z","git_url":"git://github.com/silverstripe/silverstripe-upgrader.git","ssh_url":"git@github.com:silverstripe/silverstripe-upgrader.git","clone_url":"https://github.com/silverstripe/silverstripe-upgrader.git","svn_url":"https://github.com/silverstripe/silverstripe-upgrader","homepage":null,"size":318,"stargazers_count":29,"watchers_count":29,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":21,"license":null,"forks":9,"open_issues":21,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/67"},"html":{"href":"https://github.com/silverstripe/silverstripe-upgrader/pull/67"},"issue":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/issues/67"},"comments":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/silverstripe/silverstripe-upgrader/statuses/dfb19d5bbea1766fd47f4434d380dc6384cc193f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"robbieaverill"}}