{"action":"created","comment":{"url":"https://api.github.com/repos/magento-engcom/msi/pulls/comments/189073445","pull_request_review_id":121182278,"id":189073445,"diff_hunk":"@@ -0,0 +1,60 @@\n+<?php\n+/**\n+ * Copyright © Magento, Inc. All rights reserved.\n+ * See COPYING.txt for license details.\n+ */\n+declare(strict_types=1);\n+\n+namespace Magento\\InventoryCatalog\\Model\\Source\\Validator;\n+\n+use Magento\\Framework\\Validation\\ValidationResult;\n+use Magento\\Framework\\Validation\\ValidationResultFactory;\n+use Magento\\InventoryApi\\Api\\Data\\SourceInterface;\n+use Magento\\InventoryCatalogApi\\Api\\DefaultSourceProviderInterface;\n+use Magento\\InventoryApi\\Model\\SourceValidatorInterface;\n+\n+/**\n+ * Check that default source always enabled\n+ */\n+class PreventDisableValidator implements SourceValidatorInterface\n+{\n+    /**\n+     * @var ValidationResultFactory\n+     */\n+    private $validationResultFactory;\n+\n+    /**\n+     * @var DefaultSourceProviderInterface\n+     */\n+    private $defaultSourceProvider;\n+\n+    /**\n+     * @param ValidationResultFactory $validationResultFactory\n+     * @param DefaultSourceProviderInterface $defaultSourceProvider\n+     */\n+    public function __construct(\n+        ValidationResultFactory $validationResultFactory,\n+        DefaultSourceProviderInterface $defaultSourceProvider\n+    ) {\n+        $this->validationResultFactory = $validationResultFactory;\n+        $this->defaultSourceProvider = $defaultSourceProvider;\n+    }\n+\n+    /**\n+     * @inheritdoc\n+     */\n+    public function validate(SourceInterface $source): ValidationResult\n+    {\n+        $sourceCode = (string)$source->getSourceCode();\n+        if ($sourceCode !== $this->defaultSourceProvider->getCode()) {\n+            return $this->validationResultFactory->create(['errors' => []]);\n+        }\n+        $value = (bool)$source->isEnabled();\n+        if (!$value) {","path":"app/code/Magento/InventoryCatalog/Model/Source/Validator/PreventDisableValidator.php","position":53,"original_position":53,"commit_id":"715d3af89d50379e55f2b9a2cb7e63e0494154ed","original_commit_id":"715d3af89d50379e55f2b9a2cb7e63e0494154ed","user":{"login":"naydav","id":537688,"avatar_url":"https://avatars1.githubusercontent.com/u/537688?v=4","gravatar_id":"","url":"https://api.github.com/users/naydav","html_url":"https://github.com/naydav","followers_url":"https://api.github.com/users/naydav/followers","following_url":"https://api.github.com/users/naydav/following{/other_user}","gists_url":"https://api.github.com/users/naydav/gists{/gist_id}","starred_url":"https://api.github.com/users/naydav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naydav/subscriptions","organizations_url":"https://api.github.com/users/naydav/orgs","repos_url":"https://api.github.com/users/naydav/repos","events_url":"https://api.github.com/users/naydav/events{/privacy}","received_events_url":"https://api.github.com/users/naydav/received_events","type":"User","site_admin":false},"body":"SImplify logic","created_at":"2018-05-17T19:24:04Z","updated_at":"2018-05-17T19:28:22Z","html_url":"https://github.com/magento-engcom/msi/pull/1147#discussion_r189073445","pull_request_url":"https://api.github.com/repos/magento-engcom/msi/pulls/1147","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/magento-engcom/msi/pulls/comments/189073445"},"html":{"href":"https://github.com/magento-engcom/msi/pull/1147#discussion_r189073445"},"pull_request":{"href":"https://api.github.com/repos/magento-engcom/msi/pulls/1147"}}},"pull_request":{"url":"https://api.github.com/repos/magento-engcom/msi/pulls/1147","id":187935648,"html_url":"https://github.com/magento-engcom/msi/pull/1147","diff_url":"https://github.com/magento-engcom/msi/pull/1147.diff","patch_url":"https://github.com/magento-engcom/msi/pull/1147.patch","issue_url":"https://api.github.com/repos/magento-engcom/msi/issues/1147","number":1147,"state":"open","locked":false,"title":"MSI-1115: Created validator for default Source Code. Should be enabled","user":{"login":"AleksLi","id":10618641,"avatar_url":"https://avatars2.githubusercontent.com/u/10618641?v=4","gravatar_id":"","url":"https://api.github.com/users/AleksLi","html_url":"https://github.com/AleksLi","followers_url":"https://api.github.com/users/AleksLi/followers","following_url":"https://api.github.com/users/AleksLi/following{/other_user}","gists_url":"https://api.github.com/users/AleksLi/gists{/gist_id}","starred_url":"https://api.github.com/users/AleksLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AleksLi/subscriptions","organizations_url":"https://api.github.com/users/AleksLi/orgs","repos_url":"https://api.github.com/users/AleksLi/repos","events_url":"https://api.github.com/users/AleksLi/events{/privacy}","received_events_url":"https://api.github.com/users/AleksLi/received_events","type":"User","site_admin":false},"body":"### Fixed Issues (if relevant)\r\n<!--- Provide a list of fixed issues in the format magento/magento2#<issue_number>, if relevant  -->\r\n1. [magento-engcom/msi#1115](https://github.com/magento-engcom/msi/issues/1115): Prevent disabling of Default Source\r\n","created_at":"2018-05-14T20:05:02Z","updated_at":"2018-05-17T19:28:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb99e3f929dfb2503ace1c454d5665ca6b40d4f5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":709632379,"url":"https://api.github.com/repos/magento-engcom/msi/labels/Award:%20special%20achievement","name":"Award: special achievement","color":"c5def5","default":false},{"id":921505646,"url":"https://api.github.com/repos/magento-engcom/msi/labels/Top%2010%20PRs","name":"Top 10 PRs","color":"d93f0b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/magento-engcom/msi/pulls/1147/commits","review_comments_url":"https://api.github.com/repos/magento-engcom/msi/pulls/1147/comments","review_comment_url":"https://api.github.com/repos/magento-engcom/msi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magento-engcom/msi/issues/1147/comments","statuses_url":"https://api.github.com/repos/magento-engcom/msi/statuses/715d3af89d50379e55f2b9a2cb7e63e0494154ed","head":{"label":"magento-engcom:1115_default_source_prevent_disabling","ref":"1115_default_source_prevent_disabling","sha":"715d3af89d50379e55f2b9a2cb7e63e0494154ed","user":{"login":"magento-engcom","id":25439648,"avatar_url":"https://avatars0.githubusercontent.com/u/25439648?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-engcom","html_url":"https://github.com/magento-engcom","followers_url":"https://api.github.com/users/magento-engcom/followers","following_url":"https://api.github.com/users/magento-engcom/following{/other_user}","gists_url":"https://api.github.com/users/magento-engcom/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-engcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-engcom/subscriptions","organizations_url":"https://api.github.com/users/magento-engcom/orgs","repos_url":"https://api.github.com/users/magento-engcom/repos","events_url":"https://api.github.com/users/magento-engcom/events{/privacy}","received_events_url":"https://api.github.com/users/magento-engcom/received_events","type":"Organization","site_admin":false},"repo":{"id":91593797,"name":"msi","full_name":"magento-engcom/msi","owner":{"login":"magento-engcom","id":25439648,"avatar_url":"https://avatars0.githubusercontent.com/u/25439648?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-engcom","html_url":"https://github.com/magento-engcom","followers_url":"https://api.github.com/users/magento-engcom/followers","following_url":"https://api.github.com/users/magento-engcom/following{/other_user}","gists_url":"https://api.github.com/users/magento-engcom/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-engcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-engcom/subscriptions","organizations_url":"https://api.github.com/users/magento-engcom/orgs","repos_url":"https://api.github.com/users/magento-engcom/repos","events_url":"https://api.github.com/users/magento-engcom/events{/privacy}","received_events_url":"https://api.github.com/users/magento-engcom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magento-engcom/msi","description":"Development of the MSI Project. See updated list of issues on the ZenHub board","fork":true,"url":"https://api.github.com/repos/magento-engcom/msi","forks_url":"https://api.github.com/repos/magento-engcom/msi/forks","keys_url":"https://api.github.com/repos/magento-engcom/msi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magento-engcom/msi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magento-engcom/msi/teams","hooks_url":"https://api.github.com/repos/magento-engcom/msi/hooks","issue_events_url":"https://api.github.com/repos/magento-engcom/msi/issues/events{/number}","events_url":"https://api.github.com/repos/magento-engcom/msi/events","assignees_url":"https://api.github.com/repos/magento-engcom/msi/assignees{/user}","branches_url":"https://api.github.com/repos/magento-engcom/msi/branches{/branch}","tags_url":"https://api.github.com/repos/magento-engcom/msi/tags","blobs_url":"https://api.github.com/repos/magento-engcom/msi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magento-engcom/msi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magento-engcom/msi/git/refs{/sha}","trees_url":"https://api.github.com/repos/magento-engcom/msi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magento-engcom/msi/statuses/{sha}","languages_url":"https://api.github.com/repos/magento-engcom/msi/languages","stargazers_url":"https://api.github.com/repos/magento-engcom/msi/stargazers","contributors_url":"https://api.github.com/repos/magento-engcom/msi/contributors","subscribers_url":"https://api.github.com/repos/magento-engcom/msi/subscribers","subscription_url":"https://api.github.com/repos/magento-engcom/msi/subscription","commits_url":"https://api.github.com/repos/magento-engcom/msi/commits{/sha}","git_commits_url":"https://api.github.com/repos/magento-engcom/msi/git/commits{/sha}","comments_url":"https://api.github.com/repos/magento-engcom/msi/comments{/number}","issue_comment_url":"https://api.github.com/repos/magento-engcom/msi/issues/comments{/number}","contents_url":"https://api.github.com/repos/magento-engcom/msi/contents/{+path}","compare_url":"https://api.github.com/repos/magento-engcom/msi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magento-engcom/msi/merges","archive_url":"https://api.github.com/repos/magento-engcom/msi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magento-engcom/msi/downloads","issues_url":"https://api.github.com/repos/magento-engcom/msi/issues{/number}","pulls_url":"https://api.github.com/repos/magento-engcom/msi/pulls{/number}","milestones_url":"https://api.github.com/repos/magento-engcom/msi/milestones{/number}","notifications_url":"https://api.github.com/repos/magento-engcom/msi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magento-engcom/msi/labels{/name}","releases_url":"https://api.github.com/repos/magento-engcom/msi/releases{/id}","deployments_url":"https://api.github.com/repos/magento-engcom/msi/deployments","created_at":"2017-05-17T15:47:14Z","updated_at":"2018-05-17T14:47:33Z","pushed_at":"2018-05-17T19:19:37Z","git_url":"git://github.com/magento-engcom/msi.git","ssh_url":"git@github.com:magento-engcom/msi.git","clone_url":"https://github.com/magento-engcom/msi.git","svn_url":"https://github.com/magento-engcom/msi","homepage":"https://app.zenhub.com/workspace/o/magento-engcom/msi/boards?repos=91593797","size":435965,"stargazers_count":94,"watchers_count":94,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"archived":false,"open_issues_count":261,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":36,"open_issues":261,"watchers":94,"default_branch":"2.3-develop"}},"base":{"label":"magento-engcom:2.3-develop","ref":"2.3-develop","sha":"d7513cfe9437e343f3bc9d860c7b781b54b2015b","user":{"login":"magento-engcom","id":25439648,"avatar_url":"https://avatars0.githubusercontent.com/u/25439648?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-engcom","html_url":"https://github.com/magento-engcom","followers_url":"https://api.github.com/users/magento-engcom/followers","following_url":"https://api.github.com/users/magento-engcom/following{/other_user}","gists_url":"https://api.github.com/users/magento-engcom/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-engcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-engcom/subscriptions","organizations_url":"https://api.github.com/users/magento-engcom/orgs","repos_url":"https://api.github.com/users/magento-engcom/repos","events_url":"https://api.github.com/users/magento-engcom/events{/privacy}","received_events_url":"https://api.github.com/users/magento-engcom/received_events","type":"Organization","site_admin":false},"repo":{"id":91593797,"name":"msi","full_name":"magento-engcom/msi","owner":{"login":"magento-engcom","id":25439648,"avatar_url":"https://avatars0.githubusercontent.com/u/25439648?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-engcom","html_url":"https://github.com/magento-engcom","followers_url":"https://api.github.com/users/magento-engcom/followers","following_url":"https://api.github.com/users/magento-engcom/following{/other_user}","gists_url":"https://api.github.com/users/magento-engcom/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-engcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-engcom/subscriptions","organizations_url":"https://api.github.com/users/magento-engcom/orgs","repos_url":"https://api.github.com/users/magento-engcom/repos","events_url":"https://api.github.com/users/magento-engcom/events{/privacy}","received_events_url":"https://api.github.com/users/magento-engcom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magento-engcom/msi","description":"Development of the MSI Project. See updated list of issues on the ZenHub board","fork":true,"url":"https://api.github.com/repos/magento-engcom/msi","forks_url":"https://api.github.com/repos/magento-engcom/msi/forks","keys_url":"https://api.github.com/repos/magento-engcom/msi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magento-engcom/msi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magento-engcom/msi/teams","hooks_url":"https://api.github.com/repos/magento-engcom/msi/hooks","issue_events_url":"https://api.github.com/repos/magento-engcom/msi/issues/events{/number}","events_url":"https://api.github.com/repos/magento-engcom/msi/events","assignees_url":"https://api.github.com/repos/magento-engcom/msi/assignees{/user}","branches_url":"https://api.github.com/repos/magento-engcom/msi/branches{/branch}","tags_url":"https://api.github.com/repos/magento-engcom/msi/tags","blobs_url":"https://api.github.com/repos/magento-engcom/msi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magento-engcom/msi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magento-engcom/msi/git/refs{/sha}","trees_url":"https://api.github.com/repos/magento-engcom/msi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magento-engcom/msi/statuses/{sha}","languages_url":"https://api.github.com/repos/magento-engcom/msi/languages","stargazers_url":"https://api.github.com/repos/magento-engcom/msi/stargazers","contributors_url":"https://api.github.com/repos/magento-engcom/msi/contributors","subscribers_url":"https://api.github.com/repos/magento-engcom/msi/subscribers","subscription_url":"https://api.github.com/repos/magento-engcom/msi/subscription","commits_url":"https://api.github.com/repos/magento-engcom/msi/commits{/sha}","git_commits_url":"https://api.github.com/repos/magento-engcom/msi/git/commits{/sha}","comments_url":"https://api.github.com/repos/magento-engcom/msi/comments{/number}","issue_comment_url":"https://api.github.com/repos/magento-engcom/msi/issues/comments{/number}","contents_url":"https://api.github.com/repos/magento-engcom/msi/contents/{+path}","compare_url":"https://api.github.com/repos/magento-engcom/msi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magento-engcom/msi/merges","archive_url":"https://api.github.com/repos/magento-engcom/msi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magento-engcom/msi/downloads","issues_url":"https://api.github.com/repos/magento-engcom/msi/issues{/number}","pulls_url":"https://api.github.com/repos/magento-engcom/msi/pulls{/number}","milestones_url":"https://api.github.com/repos/magento-engcom/msi/milestones{/number}","notifications_url":"https://api.github.com/repos/magento-engcom/msi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magento-engcom/msi/labels{/name}","releases_url":"https://api.github.com/repos/magento-engcom/msi/releases{/id}","deployments_url":"https://api.github.com/repos/magento-engcom/msi/deployments","created_at":"2017-05-17T15:47:14Z","updated_at":"2018-05-17T14:47:33Z","pushed_at":"2018-05-17T19:19:37Z","git_url":"git://github.com/magento-engcom/msi.git","ssh_url":"git@github.com:magento-engcom/msi.git","clone_url":"https://github.com/magento-engcom/msi.git","svn_url":"https://github.com/magento-engcom/msi","homepage":"https://app.zenhub.com/workspace/o/magento-engcom/msi/boards?repos=91593797","size":435965,"stargazers_count":94,"watchers_count":94,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"archived":false,"open_issues_count":261,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":36,"open_issues":261,"watchers":94,"default_branch":"2.3-develop"}},"_links":{"self":{"href":"https://api.github.com/repos/magento-engcom/msi/pulls/1147"},"html":{"href":"https://github.com/magento-engcom/msi/pull/1147"},"issue":{"href":"https://api.github.com/repos/magento-engcom/msi/issues/1147"},"comments":{"href":"https://api.github.com/repos/magento-engcom/msi/issues/1147/comments"},"review_comments":{"href":"https://api.github.com/repos/magento-engcom/msi/pulls/1147/comments"},"review_comment":{"href":"https://api.github.com/repos/magento-engcom/msi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magento-engcom/msi/pulls/1147/commits"},"statuses":{"href":"https://api.github.com/repos/magento-engcom/msi/statuses/715d3af89d50379e55f2b9a2cb7e63e0494154ed"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"naydav"}}