{"action":"opened","number":275,"pull_request":{"url":"https://api.github.com/repos/fnproject/cli/pulls/275","id":186967415,"html_url":"https://github.com/fnproject/cli/pull/275","diff_url":"https://github.com/fnproject/cli/pull/275.diff","patch_url":"https://github.com/fnproject/cli/pull/275.patch","issue_url":"https://api.github.com/repos/fnproject/cli/issues/275","number":275,"state":"open","locked":false,"title":"Duplication bug in WriteYamlFile function","user":{"login":"JadeRedworth","id":25709275,"avatar_url":"https://avatars2.githubusercontent.com/u/25709275?v=4","gravatar_id":"","url":"https://api.github.com/users/JadeRedworth","html_url":"https://github.com/JadeRedworth","followers_url":"https://api.github.com/users/JadeRedworth/followers","following_url":"https://api.github.com/users/JadeRedworth/following{/other_user}","gists_url":"https://api.github.com/users/JadeRedworth/gists{/gist_id}","starred_url":"https://api.github.com/users/JadeRedworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JadeRedworth/subscriptions","organizations_url":"https://api.github.com/users/JadeRedworth/orgs","repos_url":"https://api.github.com/users/JadeRedworth/repos","events_url":"https://api.github.com/users/JadeRedworth/events{/privacy}","received_events_url":"https://api.github.com/users/JadeRedworth/received_events","type":"User","site_admin":false},"body":"I noticed the `WriteYamlFile()` causes key/value pairs to be duplicated rather than updated:\r\n\r\nCurrent:\r\n```\r\nconfig.yaml\r\n    current-context: default\r\n    testing: testing\r\n    current-context: test\r\n    testing: testing\r\n```\r\n\r\nExpected:\r\n```\r\nconfig.yaml\r\n    current-context: default\r\n    testing: testing\r\n```\r\n\r\n\r\nAlthough it doesn't affect the `use/update` commands as they still behave how you would expect, it does need to be reverted back to how it previously was before changed were made within this PR [#261 Update context command ](https://github.com/fnproject/cli/pull/261).\r\n\r\n_note: Unless I am missing something obvious with this line:\r\n`return yaml.NewEncoder(file).Encode(&values)`_\r\n\r\n","created_at":"2018-05-09T16:00:49Z","updated_at":"2018-05-09T16:00:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fnproject/cli/pulls/275/commits","review_comments_url":"https://api.github.com/repos/fnproject/cli/pulls/275/comments","review_comment_url":"https://api.github.com/repos/fnproject/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fnproject/cli/issues/275/comments","statuses_url":"https://api.github.com/repos/fnproject/cli/statuses/5fec4b48d41a681586d5d2a8d130878174af3e3e","head":{"label":"JadeRedworth:write-file-bug","ref":"write-file-bug","sha":"5fec4b48d41a681586d5d2a8d130878174af3e3e","user":{"login":"JadeRedworth","id":25709275,"avatar_url":"https://avatars2.githubusercontent.com/u/25709275?v=4","gravatar_id":"","url":"https://api.github.com/users/JadeRedworth","html_url":"https://github.com/JadeRedworth","followers_url":"https://api.github.com/users/JadeRedworth/followers","following_url":"https://api.github.com/users/JadeRedworth/following{/other_user}","gists_url":"https://api.github.com/users/JadeRedworth/gists{/gist_id}","starred_url":"https://api.github.com/users/JadeRedworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JadeRedworth/subscriptions","organizations_url":"https://api.github.com/users/JadeRedworth/orgs","repos_url":"https://api.github.com/users/JadeRedworth/repos","events_url":"https://api.github.com/users/JadeRedworth/events{/privacy}","received_events_url":"https://api.github.com/users/JadeRedworth/received_events","type":"User","site_admin":false},"repo":{"id":128381384,"name":"cli","full_name":"JadeRedworth/cli","owner":{"login":"JadeRedworth","id":25709275,"avatar_url":"https://avatars2.githubusercontent.com/u/25709275?v=4","gravatar_id":"","url":"https://api.github.com/users/JadeRedworth","html_url":"https://github.com/JadeRedworth","followers_url":"https://api.github.com/users/JadeRedworth/followers","following_url":"https://api.github.com/users/JadeRedworth/following{/other_user}","gists_url":"https://api.github.com/users/JadeRedworth/gists{/gist_id}","starred_url":"https://api.github.com/users/JadeRedworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JadeRedworth/subscriptions","organizations_url":"https://api.github.com/users/JadeRedworth/orgs","repos_url":"https://api.github.com/users/JadeRedworth/repos","events_url":"https://api.github.com/users/JadeRedworth/events{/privacy}","received_events_url":"https://api.github.com/users/JadeRedworth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JadeRedworth/cli","description":"CLI tool for fnproject. ","fork":true,"url":"https://api.github.com/repos/JadeRedworth/cli","forks_url":"https://api.github.com/repos/JadeRedworth/cli/forks","keys_url":"https://api.github.com/repos/JadeRedworth/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JadeRedworth/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JadeRedworth/cli/teams","hooks_url":"https://api.github.com/repos/JadeRedworth/cli/hooks","issue_events_url":"https://api.github.com/repos/JadeRedworth/cli/issues/events{/number}","events_url":"https://api.github.com/repos/JadeRedworth/cli/events","assignees_url":"https://api.github.com/repos/JadeRedworth/cli/assignees{/user}","branches_url":"https://api.github.com/repos/JadeRedworth/cli/branches{/branch}","tags_url":"https://api.github.com/repos/JadeRedworth/cli/tags","blobs_url":"https://api.github.com/repos/JadeRedworth/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JadeRedworth/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JadeRedworth/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/JadeRedworth/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JadeRedworth/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/JadeRedworth/cli/languages","stargazers_url":"https://api.github.com/repos/JadeRedworth/cli/stargazers","contributors_url":"https://api.github.com/repos/JadeRedworth/cli/contributors","subscribers_url":"https://api.github.com/repos/JadeRedworth/cli/subscribers","subscription_url":"https://api.github.com/repos/JadeRedworth/cli/subscription","commits_url":"https://api.github.com/repos/JadeRedworth/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/JadeRedworth/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/JadeRedworth/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/JadeRedworth/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/JadeRedworth/cli/contents/{+path}","compare_url":"https://api.github.com/repos/JadeRedworth/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JadeRedworth/cli/merges","archive_url":"https://api.github.com/repos/JadeRedworth/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JadeRedworth/cli/downloads","issues_url":"https://api.github.com/repos/JadeRedworth/cli/issues{/number}","pulls_url":"https://api.github.com/repos/JadeRedworth/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/JadeRedworth/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/JadeRedworth/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JadeRedworth/cli/labels{/name}","releases_url":"https://api.github.com/repos/JadeRedworth/cli/releases{/id}","deployments_url":"https://api.github.com/repos/JadeRedworth/cli/deployments","created_at":"2018-04-06T10:33:59Z","updated_at":"2018-05-08T15:05:49Z","pushed_at":"2018-05-09T15:46:11Z","git_url":"git://github.com/JadeRedworth/cli.git","ssh_url":"git@github.com:JadeRedworth/cli.git","clone_url":"https://github.com/JadeRedworth/cli.git","svn_url":"https://github.com/JadeRedworth/cli","homepage":"https://fnproject.io","size":393,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fnproject:master","ref":"master","sha":"3dfa909e01d72e44f5f6a1a2cfc77303cad314f9","user":{"login":"fnproject","id":30273834,"avatar_url":"https://avatars2.githubusercontent.com/u/30273834?v=4","gravatar_id":"","url":"https://api.github.com/users/fnproject","html_url":"https://github.com/fnproject","followers_url":"https://api.github.com/users/fnproject/followers","following_url":"https://api.github.com/users/fnproject/following{/other_user}","gists_url":"https://api.github.com/users/fnproject/gists{/gist_id}","starred_url":"https://api.github.com/users/fnproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnproject/subscriptions","organizations_url":"https://api.github.com/users/fnproject/orgs","repos_url":"https://api.github.com/users/fnproject/repos","events_url":"https://api.github.com/users/fnproject/events{/privacy}","received_events_url":"https://api.github.com/users/fnproject/received_events","type":"Organization","site_admin":false},"repo":{"id":98561430,"name":"cli","full_name":"fnproject/cli","owner":{"login":"fnproject","id":30273834,"avatar_url":"https://avatars2.githubusercontent.com/u/30273834?v=4","gravatar_id":"","url":"https://api.github.com/users/fnproject","html_url":"https://github.com/fnproject","followers_url":"https://api.github.com/users/fnproject/followers","following_url":"https://api.github.com/users/fnproject/following{/other_user}","gists_url":"https://api.github.com/users/fnproject/gists{/gist_id}","starred_url":"https://api.github.com/users/fnproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnproject/subscriptions","organizations_url":"https://api.github.com/users/fnproject/orgs","repos_url":"https://api.github.com/users/fnproject/repos","events_url":"https://api.github.com/users/fnproject/events{/privacy}","received_events_url":"https://api.github.com/users/fnproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fnproject/cli","description":"CLI tool for fnproject. ","fork":false,"url":"https://api.github.com/repos/fnproject/cli","forks_url":"https://api.github.com/repos/fnproject/cli/forks","keys_url":"https://api.github.com/repos/fnproject/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fnproject/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fnproject/cli/teams","hooks_url":"https://api.github.com/repos/fnproject/cli/hooks","issue_events_url":"https://api.github.com/repos/fnproject/cli/issues/events{/number}","events_url":"https://api.github.com/repos/fnproject/cli/events","assignees_url":"https://api.github.com/repos/fnproject/cli/assignees{/user}","branches_url":"https://api.github.com/repos/fnproject/cli/branches{/branch}","tags_url":"https://api.github.com/repos/fnproject/cli/tags","blobs_url":"https://api.github.com/repos/fnproject/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fnproject/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fnproject/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/fnproject/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fnproject/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/fnproject/cli/languages","stargazers_url":"https://api.github.com/repos/fnproject/cli/stargazers","contributors_url":"https://api.github.com/repos/fnproject/cli/contributors","subscribers_url":"https://api.github.com/repos/fnproject/cli/subscribers","subscription_url":"https://api.github.com/repos/fnproject/cli/subscription","commits_url":"https://api.github.com/repos/fnproject/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/fnproject/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/fnproject/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/fnproject/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/fnproject/cli/contents/{+path}","compare_url":"https://api.github.com/repos/fnproject/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fnproject/cli/merges","archive_url":"https://api.github.com/repos/fnproject/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fnproject/cli/downloads","issues_url":"https://api.github.com/repos/fnproject/cli/issues{/number}","pulls_url":"https://api.github.com/repos/fnproject/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/fnproject/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/fnproject/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fnproject/cli/labels{/name}","releases_url":"https://api.github.com/repos/fnproject/cli/releases{/id}","deployments_url":"https://api.github.com/repos/fnproject/cli/deployments","created_at":"2017-07-27T17:01:37Z","updated_at":"2018-05-09T14:26:45Z","pushed_at":"2018-05-09T14:26:45Z","git_url":"git://github.com/fnproject/cli.git","ssh_url":"git@github.com:fnproject/cli.git","clone_url":"https://github.com/fnproject/cli.git","svn_url":"https://github.com/fnproject/cli","homepage":"https://fnproject.io","size":405,"stargazers_count":55,"watchers_count":55,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":74,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":24,"open_issues":74,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fnproject/cli/pulls/275"},"html":{"href":"https://github.com/fnproject/cli/pull/275"},"issue":{"href":"https://api.github.com/repos/fnproject/cli/issues/275"},"comments":{"href":"https://api.github.com/repos/fnproject/cli/issues/275/comments"},"review_comments":{"href":"https://api.github.com/repos/fnproject/cli/pulls/275/comments"},"review_comment":{"href":"https://api.github.com/repos/fnproject/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fnproject/cli/pulls/275/commits"},"statuses":{"href":"https://api.github.com/repos/fnproject/cli/statuses/5fec4b48d41a681586d5d2a8d130878174af3e3e"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":6,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"JadeRedworth"}}