{"action":"created","comment":{"url":"https://api.github.com/repos/geofffranks/spruce/pulls/comments/217912731","pull_request_review_id":155743314,"id":217912731,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzkxMjczMQ==","diff_hunk":"@@ -451,12 +475,35 @@ func getArrayModifications(obj []interface{}, simpleList bool) []ModificationDef\n \t\tcase !isString:\n \t\t\t//Do absolutely nothing\n \n+\t\tcase mergeRegEx.MatchString(e): // check for (( merge ))\n+\t\t\tresult = append(result, ModificationDefinition{listOp: listOpMergeOnKey})\n+\t\t\tcontinue\n+\n+\t\tcase mergeOnKeyRegEx.MatchString(e): // check for (( merge on \"key\" ))\n+\t\t\t/* #0 is the whole string,\n+\t\t\t * #1 is string 'on'\n+\t\t\t * #2 is the named-entry identifying key\n+\t\t\t */\n+\t\t\tif captures := mergeOnKeyRegEx.FindStringSubmatch(e); len(captures) == 3 {\n+\t\t\t\tkey := strings.TrimSpace(captures[2])\n+\t\t\t\tresult = append(result, ModificationDefinition{listOp: listOpMergeOnKey, key: key})\n+\t\t\t\tcontinue\n+\t\t\t}\n+\n+\t\tcase inlineRegEx.MatchString(e): // check for (( inline ))\n+\t\t\tresult = append(result, ModificationDefinition{listOp: listOpMergeInline})\n+\t\t\tcontinue\n+\n+\t\tcase replaceRegEx.MatchString(e): // check for (( replace ))\n+\t\t\tresult = append(result, ModificationDefinition{listOp: listOpReplace})\n+\t\t\tcontinue\n+","path":"merge.go","position":326,"original_position":326,"commit_id":"c7b127888f856b1d758381c9942fe086dd28cc70","original_commit_id":"c7b127888f856b1d758381c9942fe086dd28cc70","user":{"login":"HeavyWombat","id":1979133,"node_id":"MDQ6VXNlcjE5NzkxMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1979133?v=4","gravatar_id":"","url":"https://api.github.com/users/HeavyWombat","html_url":"https://github.com/HeavyWombat","followers_url":"https://api.github.com/users/HeavyWombat/followers","following_url":"https://api.github.com/users/HeavyWombat/following{/other_user}","gists_url":"https://api.github.com/users/HeavyWombat/gists{/gist_id}","starred_url":"https://api.github.com/users/HeavyWombat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeavyWombat/subscriptions","organizations_url":"https://api.github.com/users/HeavyWombat/orgs","repos_url":"https://api.github.com/users/HeavyWombat/repos","events_url":"https://api.github.com/users/HeavyWombat/events{/privacy}","received_events_url":"https://api.github.com/users/HeavyWombat/received_events","type":"User","site_admin":false},"body":"Sure, I checked the coverage report to verify the code portions are still somehow tested, but it makes perfect sense to explicitly test that. It kind of breaks the style not testing some of the operators that way.","created_at":"2018-09-16T12:32:27Z","updated_at":"2018-09-16T12:32:27Z","html_url":"https://github.com/geofffranks/spruce/pull/268#discussion_r217912731","pull_request_url":"https://api.github.com/repos/geofffranks/spruce/pulls/268","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/geofffranks/spruce/pulls/comments/217912731"},"html":{"href":"https://github.com/geofffranks/spruce/pull/268#discussion_r217912731"},"pull_request":{"href":"https://api.github.com/repos/geofffranks/spruce/pulls/268"}},"in_reply_to_id":216662310},"pull_request":{"url":"https://api.github.com/repos/geofffranks/spruce/pulls/268","id":211872117,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExODcyMTE3","html_url":"https://github.com/geofffranks/spruce/pull/268","diff_url":"https://github.com/geofffranks/spruce/pull/268.diff","patch_url":"https://github.com/geofffranks/spruce/pull/268.patch","issue_url":"https://api.github.com/repos/geofffranks/spruce/issues/268","number":268,"state":"open","locked":false,"title":"Fix implicit/default merge behaves different than explicit merge ","user":{"login":"HeavyWombat","id":1979133,"node_id":"MDQ6VXNlcjE5NzkxMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1979133?v=4","gravatar_id":"","url":"https://api.github.com/users/HeavyWombat","html_url":"https://github.com/HeavyWombat","followers_url":"https://api.github.com/users/HeavyWombat/followers","following_url":"https://api.github.com/users/HeavyWombat/following{/other_user}","gists_url":"https://api.github.com/users/HeavyWombat/gists{/gist_id}","starred_url":"https://api.github.com/users/HeavyWombat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeavyWombat/subscriptions","organizations_url":"https://api.github.com/users/HeavyWombat/orgs","repos_url":"https://api.github.com/users/HeavyWombat/repos","events_url":"https://api.github.com/users/HeavyWombat/events{/privacy}","received_events_url":"https://api.github.com/users/HeavyWombat/received_events","type":"User","site_admin":false},"body":"Fix issue #267 by harmonizing the way Spruce processes list modifications. Due to historic reasons, `inline`, `replace` and (default) `merge` had a different path through the `mergeArray` routine of Spruce. Operators like `insert` or `delete` introduced a general purpose type to encapsulate the details about their intended modifications. In order to fix the issue, I saw no other way than to unify these two ways into one common style.\r\n\r\nSince this covers quite some functions of Spruce, I decided to separate the required changes into different commits:\r\n- One commit to add the test cases,\r\n- one commit to fix the issue,\r\n- and three commits to clean-up the code.\r\n\r\nIn theory, the last three commits could be removed from the PR.\r\n\r\n","created_at":"2018-08-29T20:08:46Z","updated_at":"2018-09-16T12:32:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95cd9b02517d12a142e331ac4a0ed689aa18bce1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/geofffranks/spruce/pulls/268/commits","review_comments_url":"https://api.github.com/repos/geofffranks/spruce/pulls/268/comments","review_comment_url":"https://api.github.com/repos/geofffranks/spruce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geofffranks/spruce/issues/268/comments","statuses_url":"https://api.github.com/repos/geofffranks/spruce/statuses/c7b127888f856b1d758381c9942fe086dd28cc70","head":{"label":"HeavyWombat:issue-267","ref":"issue-267","sha":"c7b127888f856b1d758381c9942fe086dd28cc70","user":{"login":"HeavyWombat","id":1979133,"node_id":"MDQ6VXNlcjE5NzkxMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1979133?v=4","gravatar_id":"","url":"https://api.github.com/users/HeavyWombat","html_url":"https://github.com/HeavyWombat","followers_url":"https://api.github.com/users/HeavyWombat/followers","following_url":"https://api.github.com/users/HeavyWombat/following{/other_user}","gists_url":"https://api.github.com/users/HeavyWombat/gists{/gist_id}","starred_url":"https://api.github.com/users/HeavyWombat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeavyWombat/subscriptions","organizations_url":"https://api.github.com/users/HeavyWombat/orgs","repos_url":"https://api.github.com/users/HeavyWombat/repos","events_url":"https://api.github.com/users/HeavyWombat/events{/privacy}","received_events_url":"https://api.github.com/users/HeavyWombat/received_events","type":"User","site_admin":false},"repo":{"id":56126739,"node_id":"MDEwOlJlcG9zaXRvcnk1NjEyNjczOQ==","name":"spruce","full_name":"HeavyWombat/spruce","private":false,"owner":{"login":"HeavyWombat","id":1979133,"node_id":"MDQ6VXNlcjE5NzkxMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1979133?v=4","gravatar_id":"","url":"https://api.github.com/users/HeavyWombat","html_url":"https://github.com/HeavyWombat","followers_url":"https://api.github.com/users/HeavyWombat/followers","following_url":"https://api.github.com/users/HeavyWombat/following{/other_user}","gists_url":"https://api.github.com/users/HeavyWombat/gists{/gist_id}","starred_url":"https://api.github.com/users/HeavyWombat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeavyWombat/subscriptions","organizations_url":"https://api.github.com/users/HeavyWombat/orgs","repos_url":"https://api.github.com/users/HeavyWombat/repos","events_url":"https://api.github.com/users/HeavyWombat/events{/privacy}","received_events_url":"https://api.github.com/users/HeavyWombat/received_events","type":"User","site_admin":false},"html_url":"https://github.com/HeavyWombat/spruce","description":"A BOSH template merge tool","fork":true,"url":"https://api.github.com/repos/HeavyWombat/spruce","forks_url":"https://api.github.com/repos/HeavyWombat/spruce/forks","keys_url":"https://api.github.com/repos/HeavyWombat/spruce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HeavyWombat/spruce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HeavyWombat/spruce/teams","hooks_url":"https://api.github.com/repos/HeavyWombat/spruce/hooks","issue_events_url":"https://api.github.com/repos/HeavyWombat/spruce/issues/events{/number}","events_url":"https://api.github.com/repos/HeavyWombat/spruce/events","assignees_url":"https://api.github.com/repos/HeavyWombat/spruce/assignees{/user}","branches_url":"https://api.github.com/repos/HeavyWombat/spruce/branches{/branch}","tags_url":"https://api.github.com/repos/HeavyWombat/spruce/tags","blobs_url":"https://api.github.com/repos/HeavyWombat/spruce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HeavyWombat/spruce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HeavyWombat/spruce/git/refs{/sha}","trees_url":"https://api.github.com/repos/HeavyWombat/spruce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HeavyWombat/spruce/statuses/{sha}","languages_url":"https://api.github.com/repos/HeavyWombat/spruce/languages","stargazers_url":"https://api.github.com/repos/HeavyWombat/spruce/stargazers","contributors_url":"https://api.github.com/repos/HeavyWombat/spruce/contributors","subscribers_url":"https://api.github.com/repos/HeavyWombat/spruce/subscribers","subscription_url":"https://api.github.com/repos/HeavyWombat/spruce/subscription","commits_url":"https://api.github.com/repos/HeavyWombat/spruce/commits{/sha}","git_commits_url":"https://api.github.com/repos/HeavyWombat/spruce/git/commits{/sha}","comments_url":"https://api.github.com/repos/HeavyWombat/spruce/comments{/number}","issue_comment_url":"https://api.github.com/repos/HeavyWombat/spruce/issues/comments{/number}","contents_url":"https://api.github.com/repos/HeavyWombat/spruce/contents/{+path}","compare_url":"https://api.github.com/repos/HeavyWombat/spruce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HeavyWombat/spruce/merges","archive_url":"https://api.github.com/repos/HeavyWombat/spruce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HeavyWombat/spruce/downloads","issues_url":"https://api.github.com/repos/HeavyWombat/spruce/issues{/number}","pulls_url":"https://api.github.com/repos/HeavyWombat/spruce/pulls{/number}","milestones_url":"https://api.github.com/repos/HeavyWombat/spruce/milestones{/number}","notifications_url":"https://api.github.com/repos/HeavyWombat/spruce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HeavyWombat/spruce/labels{/name}","releases_url":"https://api.github.com/repos/HeavyWombat/spruce/releases{/id}","deployments_url":"https://api.github.com/repos/HeavyWombat/spruce/deployments","created_at":"2016-04-13T06:26:48Z","updated_at":"2018-08-27T07:24:27Z","pushed_at":"2018-08-29T19:57:48Z","git_url":"git://github.com/HeavyWombat/spruce.git","ssh_url":"git@github.com:HeavyWombat/spruce.git","clone_url":"https://github.com/HeavyWombat/spruce.git","svn_url":"https://github.com/HeavyWombat/spruce","homepage":null,"size":2466,"stargazers_count":0,"watchers_count":0,"language":"Go","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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"geofffranks:master","ref":"master","sha":"cba3644f1ff98fd20c4be667786b3e23f05159f4","user":{"login":"geofffranks","id":7180882,"node_id":"MDQ6VXNlcjcxODA4ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/7180882?v=4","gravatar_id":"","url":"https://api.github.com/users/geofffranks","html_url":"https://github.com/geofffranks","followers_url":"https://api.github.com/users/geofffranks/followers","following_url":"https://api.github.com/users/geofffranks/following{/other_user}","gists_url":"https://api.github.com/users/geofffranks/gists{/gist_id}","starred_url":"https://api.github.com/users/geofffranks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geofffranks/subscriptions","organizations_url":"https://api.github.com/users/geofffranks/orgs","repos_url":"https://api.github.com/users/geofffranks/repos","events_url":"https://api.github.com/users/geofffranks/events{/privacy}","received_events_url":"https://api.github.com/users/geofffranks/received_events","type":"User","site_admin":false},"repo":{"id":38989614,"node_id":"MDEwOlJlcG9zaXRvcnkzODk4OTYxNA==","name":"spruce","full_name":"geofffranks/spruce","private":false,"owner":{"login":"geofffranks","id":7180882,"node_id":"MDQ6VXNlcjcxODA4ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/7180882?v=4","gravatar_id":"","url":"https://api.github.com/users/geofffranks","html_url":"https://github.com/geofffranks","followers_url":"https://api.github.com/users/geofffranks/followers","following_url":"https://api.github.com/users/geofffranks/following{/other_user}","gists_url":"https://api.github.com/users/geofffranks/gists{/gist_id}","starred_url":"https://api.github.com/users/geofffranks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geofffranks/subscriptions","organizations_url":"https://api.github.com/users/geofffranks/orgs","repos_url":"https://api.github.com/users/geofffranks/repos","events_url":"https://api.github.com/users/geofffranks/events{/privacy}","received_events_url":"https://api.github.com/users/geofffranks/received_events","type":"User","site_admin":false},"html_url":"https://github.com/geofffranks/spruce","description":"A BOSH template merge tool","fork":false,"url":"https://api.github.com/repos/geofffranks/spruce","forks_url":"https://api.github.com/repos/geofffranks/spruce/forks","keys_url":"https://api.github.com/repos/geofffranks/spruce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geofffranks/spruce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geofffranks/spruce/teams","hooks_url":"https://api.github.com/repos/geofffranks/spruce/hooks","issue_events_url":"https://api.github.com/repos/geofffranks/spruce/issues/events{/number}","events_url":"https://api.github.com/repos/geofffranks/spruce/events","assignees_url":"https://api.github.com/repos/geofffranks/spruce/assignees{/user}","branches_url":"https://api.github.com/repos/geofffranks/spruce/branches{/branch}","tags_url":"https://api.github.com/repos/geofffranks/spruce/tags","blobs_url":"https://api.github.com/repos/geofffranks/spruce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geofffranks/spruce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geofffranks/spruce/git/refs{/sha}","trees_url":"https://api.github.com/repos/geofffranks/spruce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geofffranks/spruce/statuses/{sha}","languages_url":"https://api.github.com/repos/geofffranks/spruce/languages","stargazers_url":"https://api.github.com/repos/geofffranks/spruce/stargazers","contributors_url":"https://api.github.com/repos/geofffranks/spruce/contributors","subscribers_url":"https://api.github.com/repos/geofffranks/spruce/subscribers","subscription_url":"https://api.github.com/repos/geofffranks/spruce/subscription","commits_url":"https://api.github.com/repos/geofffranks/spruce/commits{/sha}","git_commits_url":"https://api.github.com/repos/geofffranks/spruce/git/commits{/sha}","comments_url":"https://api.github.com/repos/geofffranks/spruce/comments{/number}","issue_comment_url":"https://api.github.com/repos/geofffranks/spruce/issues/comments{/number}","contents_url":"https://api.github.com/repos/geofffranks/spruce/contents/{+path}","compare_url":"https://api.github.com/repos/geofffranks/spruce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geofffranks/spruce/merges","archive_url":"https://api.github.com/repos/geofffranks/spruce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geofffranks/spruce/downloads","issues_url":"https://api.github.com/repos/geofffranks/spruce/issues{/number}","pulls_url":"https://api.github.com/repos/geofffranks/spruce/pulls{/number}","milestones_url":"https://api.github.com/repos/geofffranks/spruce/milestones{/number}","notifications_url":"https://api.github.com/repos/geofffranks/spruce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geofffranks/spruce/labels{/name}","releases_url":"https://api.github.com/repos/geofffranks/spruce/releases{/id}","deployments_url":"https://api.github.com/repos/geofffranks/spruce/deployments","created_at":"2015-07-13T03:34:39Z","updated_at":"2018-09-07T14:29:39Z","pushed_at":"2018-09-02T02:17:11Z","git_url":"git://github.com/geofffranks/spruce.git","ssh_url":"git@github.com:geofffranks/spruce.git","clone_url":"https://github.com/geofffranks/spruce.git","svn_url":"https://github.com/geofffranks/spruce","homepage":null,"size":2465,"stargazers_count":160,"watchers_count":160,"language":"Go","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":18,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":36,"open_issues":18,"watchers":160,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geofffranks/spruce/pulls/268"},"html":{"href":"https://github.com/geofffranks/spruce/pull/268"},"issue":{"href":"https://api.github.com/repos/geofffranks/spruce/issues/268"},"comments":{"href":"https://api.github.com/repos/geofffranks/spruce/issues/268/comments"},"review_comments":{"href":"https://api.github.com/repos/geofffranks/spruce/pulls/268/comments"},"review_comment":{"href":"https://api.github.com/repos/geofffranks/spruce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geofffranks/spruce/pulls/268/commits"},"statuses":{"href":"https://api.github.com/repos/geofffranks/spruce/statuses/c7b127888f856b1d758381c9942fe086dd28cc70"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"HeavyWombat"}}