{"action":"created","issue":{"url":"https://api.github.com/repos/openfaas/faas-cli/issues/354","repository_url":"https://api.github.com/repos/openfaas/faas-cli","labels_url":"https://api.github.com/repos/openfaas/faas-cli/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/openfaas/faas-cli/issues/354/comments","events_url":"https://api.github.com/repos/openfaas/faas-cli/issues/354/events","html_url":"https://github.com/openfaas/faas-cli/issues/354","id":307389014,"number":354,"title":"Suggestion: block appending of the same function more than once","user":{"login":"samueleaton","id":9119269,"avatar_url":"https://avatars1.githubusercontent.com/u/9119269?v=4","gravatar_id":"","url":"https://api.github.com/users/samueleaton","html_url":"https://github.com/samueleaton","followers_url":"https://api.github.com/users/samueleaton/followers","following_url":"https://api.github.com/users/samueleaton/following{/other_user}","gists_url":"https://api.github.com/users/samueleaton/gists{/gist_id}","starred_url":"https://api.github.com/users/samueleaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samueleaton/subscriptions","organizations_url":"https://api.github.com/users/samueleaton/orgs","repos_url":"https://api.github.com/users/samueleaton/repos","events_url":"https://api.github.com/users/samueleaton/events{/privacy}","received_events_url":"https://api.github.com/users/samueleaton/received_events","type":"User","site_admin":false},"labels":[{"id":580795723,"url":"https://api.github.com/repos/openfaas/faas-cli/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true},{"id":853532060,"url":"https://api.github.com/repos/openfaas/faas-cli/labels/priority/low","name":"priority/low","color":"ededed","default":false},{"id":665867061,"url":"https://api.github.com/repos/openfaas/faas-cli/labels/proposal","name":"proposal","color":"fbca04","default":false},{"id":875850221,"url":"https://api.github.com/repos/openfaas/faas-cli/labels/review","name":"review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-21T19:34:28Z","updated_at":"2018-03-22T16:30:31Z","closed_at":null,"author_association":"NONE","body":"Summary: Using \"append\" with the \"new\" command allows duplicate function names\r\n\r\nUsing the `--append` option appends function to yaml file regardless of if the function name is already taken, creating ambiguous yaml file.\r\n\r\n## Expected Behaviour\r\nIt should return an error if the function name would result in a duplicate.\r\n\r\n## Current Behaviour\r\nit will continue to append.\r\n\r\nExample when running `faas-cli new yee --lang ruby -f functions.yml` more than once.\r\n\r\n```yml\r\nfunctions:\r\n  yee:\r\n    lang: ruby\r\n    handler: ./yee\r\n    image: yee\r\n  yee:\r\n    lang: ruby\r\n    handler: ./yee\r\n    image: yee\r\n```\r\n\r\n## Your Environment\r\n- Docker `17.12.0-ce`\r\n- Using Docker Swarm\r\n- MacOS"},"comment":{"url":"https://api.github.com/repos/openfaas/faas-cli/issues/comments/375370512","html_url":"https://github.com/openfaas/faas-cli/issues/354#issuecomment-375370512","issue_url":"https://api.github.com/repos/openfaas/faas-cli/issues/354","id":375370512,"user":{"login":"samueleaton","id":9119269,"avatar_url":"https://avatars1.githubusercontent.com/u/9119269?v=4","gravatar_id":"","url":"https://api.github.com/users/samueleaton","html_url":"https://github.com/samueleaton","followers_url":"https://api.github.com/users/samueleaton/followers","following_url":"https://api.github.com/users/samueleaton/following{/other_user}","gists_url":"https://api.github.com/users/samueleaton/gists{/gist_id}","starred_url":"https://api.github.com/users/samueleaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samueleaton/subscriptions","organizations_url":"https://api.github.com/users/samueleaton/orgs","repos_url":"https://api.github.com/users/samueleaton/repos","events_url":"https://api.github.com/users/samueleaton/events{/privacy}","received_events_url":"https://api.github.com/users/samueleaton/received_events","type":"User","site_admin":false},"created_at":"2018-03-22T16:30:31Z","updated_at":"2018-03-22T16:30:31Z","author_association":"NONE","body":"Its mostly about duplicate keys creating ambiguity and potential for buggy software. I also thought it was invalid YAML so I guess one could say faas-cli generates invalid YAML which I suppose _could_ be a bug.\r\n\r\nFrom the [YAML spec](http://www.yaml.org/spec/1.2/spec.html): \r\n> JSON's RFC4627 requires that mappings keys merely “SHOULD” be unique, while YAML insists they “MUST” be. Technically, YAML therefore complies with the JSON spec, choosing to treat duplicates as an error.\r\n"}}
{"actor":{"display_login":"samueleaton"}}