{"action":"created","comment":{"url":"https://api.github.com/repos/yast/yast-storage-ng/pulls/comments/271751760","pull_request_review_id":222219186,"id":271751760,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3MTc1MTc2MA==","diff_hunk":"@@ -39,6 +39,55 @@ def stub_partitioning_features(features = {})\n \n   let(:initial_partitioning_features) { {} }\n \n+  describe \"#deep_copy\" do\n+    subject(:settings) { described_class.new_for_current_product }\n+\n+    let(:volumes) do\n+      [\n+        {\n+          \"mount_point\" => \"/\", \"fs_type\" => \"xfs\", \"weight\" => 60,\n+          \"desired_size\" => \"20GiB\", \"max_size\" => \"40GiB\"\n+        },\n+        { \"mount_point\" => \"/home\", \"fs_type\" => \"xfs\", \"weight\" => 40, \"desired_size\" => \"10GiB\" },\n+        # This should reuse the existing logical swap\n+        { \"mount_point\" => \"swap\", \"fs_type\" => \"swap\", \"desired_size\" => \"3GiB\" }\n+      ]\n+    end\n+\n+    let(:partitioning) do\n+      { \"proposal\" => {}, \"volumes\" => volumes }\n+    end\n+\n+    before do\n+      stub_partitioning_features(partitioning)\n+    end\n+\n+    it \"returns a deep copy of settings\" do\n+      copy = settings.deep_copy\n+\n+      # Let's simply check two nested levels: it's expected to find the same amount of objects with\n+      # a different identity. In other words, object must look equal but be different.","path":"test/y2storage/proposal_settings_test.rb","position":31,"original_position":31,"commit_id":"37f3f2f47171f71fc5f744bda7788aba70856ba4","original_commit_id":"37f3f2f47171f71fc5f744bda7788aba70856ba4","user":{"login":"lslezak","id":907998,"node_id":"MDQ6VXNlcjkwNzk5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/907998?v=4","gravatar_id":"","url":"https://api.github.com/users/lslezak","html_url":"https://github.com/lslezak","followers_url":"https://api.github.com/users/lslezak/followers","following_url":"https://api.github.com/users/lslezak/following{/other_user}","gists_url":"https://api.github.com/users/lslezak/gists{/gist_id}","starred_url":"https://api.github.com/users/lslezak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lslezak/subscriptions","organizations_url":"https://api.github.com/users/lslezak/orgs","repos_url":"https://api.github.com/users/lslezak/repos","events_url":"https://api.github.com/users/lslezak/events{/privacy}","received_events_url":"https://api.github.com/users/lslezak/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n      # a different identity. In other words, the objects must be equal but must be different instances.\r\n```","created_at":"2019-04-03T13:49:29Z","updated_at":"2019-04-03T13:52:17Z","html_url":"https://github.com/yast/yast-storage-ng/pull/889#discussion_r271751760","pull_request_url":"https://api.github.com/repos/yast/yast-storage-ng/pulls/889","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/yast/yast-storage-ng/pulls/comments/271751760"},"html":{"href":"https://github.com/yast/yast-storage-ng/pull/889#discussion_r271751760"},"pull_request":{"href":"https://api.github.com/repos/yast/yast-storage-ng/pulls/889"}}},"pull_request":{"url":"https://api.github.com/repos/yast/yast-storage-ng/pulls/889","id":266923205,"node_id":"MDExOlB1bGxSZXF1ZXN0MjY2OTIzMjA1","html_url":"https://github.com/yast/yast-storage-ng/pull/889","diff_url":"https://github.com/yast/yast-storage-ng/pull/889.diff","patch_url":"https://github.com/yast/yast-storage-ng/pull/889.patch","issue_url":"https://api.github.com/repos/yast/yast-storage-ng/issues/889","number":889,"state":"open","locked":false,"title":"Fix resetting proposal settings","user":{"login":"dgdavid","id":1691872,"node_id":"MDQ6VXNlcjE2OTE4NzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1691872?v=4","gravatar_id":"","url":"https://api.github.com/users/dgdavid","html_url":"https://github.com/dgdavid","followers_url":"https://api.github.com/users/dgdavid/followers","following_url":"https://api.github.com/users/dgdavid/following{/other_user}","gists_url":"https://api.github.com/users/dgdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/dgdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgdavid/subscriptions","organizations_url":"https://api.github.com/users/dgdavid/orgs","repos_url":"https://api.github.com/users/dgdavid/repos","events_url":"https://api.github.com/users/dgdavid/events{/privacy}","received_events_url":"https://api.github.com/users/dgdavid/received_events","type":"User","site_admin":false},"body":"## Problem\r\n\r\nInitial settings are not being restored before each proposal attempt because\r\n\r\n> `Yast.deep_copy` is quite a fail that only copies one level, leaving the second level as references instead of copies. — [extracted from Ancor's comment](https://github.com/yast/yast-storage-ng/pull/889#discussion_r271681321)\r\n\r\nSee also, \r\n\r\n- https://bugzilla.suse.com/show_bug.cgi?id=1130392\r\n- https://trello.com/c/KJpkiH4P/889-1130392-storage-disabled-volumes-stay-disabled-during-proposal-process\r\n\r\n## Solution\r\n\r\n~~Overwrite the [`ProposalSettings#dup`](https://github.com/yast/yast-storage-ng/compare/SLE-15-SP1...feature/bsc-1130392-fix-reset-proposal-settings?expand=1#diff-30d4c4c7ff63d32d4f2fa075e77d3290R209)~~ Added a [`ProposalSettings#deep_copy`](https://github.com/yast/yast-storage-ng/pull/889/files#diff-30d4c4c7ff63d32d4f2fa075e77d3290R208) method to make a copy based on a `Marshal` serialization  instead of use `Yast.deep_copy` because\r\n\r\n>  It did its job with the YCP -> Ruby translation, but it should never be used in new code because it does not do what it promises. We should use Ruby mechanisms for performing deep copies, such as Marshall. —  [extracted from Ancor's comment](https://github.com/yast/yast-storage-ng/pull/889#discussion_r271681321)\r\n\r\n\r\n## Testing\r\n\r\n- Added a new unit tests\r\n- Fixed some existing tests","created_at":"2019-04-03T07:29:58Z","updated_at":"2019-04-03T13:52:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1823bc5727c6db8bf17ce32eed3a9d74faf43778","assignee":null,"assignees":[],"requested_reviewers":[{"login":"joseivanlopez","id":1112304,"node_id":"MDQ6VXNlcjExMTIzMDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1112304?v=4","gravatar_id":"","url":"https://api.github.com/users/joseivanlopez","html_url":"https://github.com/joseivanlopez","followers_url":"https://api.github.com/users/joseivanlopez/followers","following_url":"https://api.github.com/users/joseivanlopez/following{/other_user}","gists_url":"https://api.github.com/users/joseivanlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/joseivanlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joseivanlopez/subscriptions","organizations_url":"https://api.github.com/users/joseivanlopez/orgs","repos_url":"https://api.github.com/users/joseivanlopez/repos","events_url":"https://api.github.com/users/joseivanlopez/events{/privacy}","received_events_url":"https://api.github.com/users/joseivanlopez/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/yast/yast-storage-ng/pulls/889/commits","review_comments_url":"https://api.github.com/repos/yast/yast-storage-ng/pulls/889/comments","review_comment_url":"https://api.github.com/repos/yast/yast-storage-ng/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yast/yast-storage-ng/issues/889/comments","statuses_url":"https://api.github.com/repos/yast/yast-storage-ng/statuses/37f3f2f47171f71fc5f744bda7788aba70856ba4","head":{"label":"yast:feature/bsc-1130392-fix-reset-proposal-settings","ref":"feature/bsc-1130392-fix-reset-proposal-settings","sha":"37f3f2f47171f71fc5f744bda7788aba70856ba4","user":{"login":"yast","id":909990,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkwOTk5MA==","avatar_url":"https://avatars1.githubusercontent.com/u/909990?v=4","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"repo":{"id":46064409,"node_id":"MDEwOlJlcG9zaXRvcnk0NjA2NDQwOQ==","name":"yast-storage-ng","full_name":"yast/yast-storage-ng","private":false,"owner":{"login":"yast","id":909990,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkwOTk5MA==","avatar_url":"https://avatars1.githubusercontent.com/u/909990?v=4","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/yast/yast-storage-ng","description":"Rewrite of https://github.com/yast/yast-storage","fork":false,"url":"https://api.github.com/repos/yast/yast-storage-ng","forks_url":"https://api.github.com/repos/yast/yast-storage-ng/forks","keys_url":"https://api.github.com/repos/yast/yast-storage-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yast/yast-storage-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yast/yast-storage-ng/teams","hooks_url":"https://api.github.com/repos/yast/yast-storage-ng/hooks","issue_events_url":"https://api.github.com/repos/yast/yast-storage-ng/issues/events{/number}","events_url":"https://api.github.com/repos/yast/yast-storage-ng/events","assignees_url":"https://api.github.com/repos/yast/yast-storage-ng/assignees{/user}","branches_url":"https://api.github.com/repos/yast/yast-storage-ng/branches{/branch}","tags_url":"https://api.github.com/repos/yast/yast-storage-ng/tags","blobs_url":"https://api.github.com/repos/yast/yast-storage-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yast/yast-storage-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yast/yast-storage-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/yast/yast-storage-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yast/yast-storage-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/yast/yast-storage-ng/languages","stargazers_url":"https://api.github.com/repos/yast/yast-storage-ng/stargazers","contributors_url":"https://api.github.com/repos/yast/yast-storage-ng/contributors","subscribers_url":"https://api.github.com/repos/yast/yast-storage-ng/subscribers","subscription_url":"https://api.github.com/repos/yast/yast-storage-ng/subscription","commits_url":"https://api.github.com/repos/yast/yast-storage-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/yast/yast-storage-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/yast/yast-storage-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/yast/yast-storage-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/yast/yast-storage-ng/contents/{+path}","compare_url":"https://api.github.com/repos/yast/yast-storage-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yast/yast-storage-ng/merges","archive_url":"https://api.github.com/repos/yast/yast-storage-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yast/yast-storage-ng/downloads","issues_url":"https://api.github.com/repos/yast/yast-storage-ng/issues{/number}","pulls_url":"https://api.github.com/repos/yast/yast-storage-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/yast/yast-storage-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/yast/yast-storage-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yast/yast-storage-ng/labels{/name}","releases_url":"https://api.github.com/repos/yast/yast-storage-ng/releases{/id}","deployments_url":"https://api.github.com/repos/yast/yast-storage-ng/deployments","created_at":"2015-11-12T16:09:03Z","updated_at":"2019-04-02T14:21:24Z","pushed_at":"2019-04-03T13:22:04Z","git_url":"git://github.com/yast/yast-storage-ng.git","ssh_url":"git@github.com:yast/yast-storage-ng.git","clone_url":"https://github.com/yast/yast-storage-ng.git","svn_url":"https://github.com/yast/yast-storage-ng","homepage":"http://yast.github.io/","size":13062,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":19,"open_issues":4,"watchers":5,"default_branch":"master"}},"base":{"label":"yast:SLE-15-SP1","ref":"SLE-15-SP1","sha":"5f7aa018094ec565c901c4885cc5031150303957","user":{"login":"yast","id":909990,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkwOTk5MA==","avatar_url":"https://avatars1.githubusercontent.com/u/909990?v=4","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"repo":{"id":46064409,"node_id":"MDEwOlJlcG9zaXRvcnk0NjA2NDQwOQ==","name":"yast-storage-ng","full_name":"yast/yast-storage-ng","private":false,"owner":{"login":"yast","id":909990,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkwOTk5MA==","avatar_url":"https://avatars1.githubusercontent.com/u/909990?v=4","gravatar_id":"","url":"https://api.github.com/users/yast","html_url":"https://github.com/yast","followers_url":"https://api.github.com/users/yast/followers","following_url":"https://api.github.com/users/yast/following{/other_user}","gists_url":"https://api.github.com/users/yast/gists{/gist_id}","starred_url":"https://api.github.com/users/yast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yast/subscriptions","organizations_url":"https://api.github.com/users/yast/orgs","repos_url":"https://api.github.com/users/yast/repos","events_url":"https://api.github.com/users/yast/events{/privacy}","received_events_url":"https://api.github.com/users/yast/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/yast/yast-storage-ng","description":"Rewrite of https://github.com/yast/yast-storage","fork":false,"url":"https://api.github.com/repos/yast/yast-storage-ng","forks_url":"https://api.github.com/repos/yast/yast-storage-ng/forks","keys_url":"https://api.github.com/repos/yast/yast-storage-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yast/yast-storage-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yast/yast-storage-ng/teams","hooks_url":"https://api.github.com/repos/yast/yast-storage-ng/hooks","issue_events_url":"https://api.github.com/repos/yast/yast-storage-ng/issues/events{/number}","events_url":"https://api.github.com/repos/yast/yast-storage-ng/events","assignees_url":"https://api.github.com/repos/yast/yast-storage-ng/assignees{/user}","branches_url":"https://api.github.com/repos/yast/yast-storage-ng/branches{/branch}","tags_url":"https://api.github.com/repos/yast/yast-storage-ng/tags","blobs_url":"https://api.github.com/repos/yast/yast-storage-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yast/yast-storage-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yast/yast-storage-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/yast/yast-storage-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yast/yast-storage-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/yast/yast-storage-ng/languages","stargazers_url":"https://api.github.com/repos/yast/yast-storage-ng/stargazers","contributors_url":"https://api.github.com/repos/yast/yast-storage-ng/contributors","subscribers_url":"https://api.github.com/repos/yast/yast-storage-ng/subscribers","subscription_url":"https://api.github.com/repos/yast/yast-storage-ng/subscription","commits_url":"https://api.github.com/repos/yast/yast-storage-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/yast/yast-storage-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/yast/yast-storage-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/yast/yast-storage-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/yast/yast-storage-ng/contents/{+path}","compare_url":"https://api.github.com/repos/yast/yast-storage-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yast/yast-storage-ng/merges","archive_url":"https://api.github.com/repos/yast/yast-storage-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yast/yast-storage-ng/downloads","issues_url":"https://api.github.com/repos/yast/yast-storage-ng/issues{/number}","pulls_url":"https://api.github.com/repos/yast/yast-storage-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/yast/yast-storage-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/yast/yast-storage-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yast/yast-storage-ng/labels{/name}","releases_url":"https://api.github.com/repos/yast/yast-storage-ng/releases{/id}","deployments_url":"https://api.github.com/repos/yast/yast-storage-ng/deployments","created_at":"2015-11-12T16:09:03Z","updated_at":"2019-04-02T14:21:24Z","pushed_at":"2019-04-03T13:22:04Z","git_url":"git://github.com/yast/yast-storage-ng.git","ssh_url":"git@github.com:yast/yast-storage-ng.git","clone_url":"https://github.com/yast/yast-storage-ng.git","svn_url":"https://github.com/yast/yast-storage-ng","homepage":"http://yast.github.io/","size":13062,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":19,"open_issues":4,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yast/yast-storage-ng/pulls/889"},"html":{"href":"https://github.com/yast/yast-storage-ng/pull/889"},"issue":{"href":"https://api.github.com/repos/yast/yast-storage-ng/issues/889"},"comments":{"href":"https://api.github.com/repos/yast/yast-storage-ng/issues/889/comments"},"review_comments":{"href":"https://api.github.com/repos/yast/yast-storage-ng/pulls/889/comments"},"review_comment":{"href":"https://api.github.com/repos/yast/yast-storage-ng/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yast/yast-storage-ng/pulls/889/commits"},"statuses":{"href":"https://api.github.com/repos/yast/yast-storage-ng/statuses/37f3f2f47171f71fc5f744bda7788aba70856ba4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lslezak"}}