{"action":"created","comment":{"url":"https://api.github.com/repos/giantswarm/user-config/pulls/comments/39383739","id":39383739,"diff_hunk":"@@ -1,155 +1,416 @@\n package userconfig\n \n import (\n-\t\"reflect\"\n+\t\"fmt\"\n+\t\"sort\"\n+\t\"strconv\"\n+\t\"strings\"\n )\n \n type DiffType string\n \n const (\n-\t// Used to indicate that the app-name in the two files was changed\n-\tInfoAppNameChanged DiffType = \"infoAppNameChanged\"\n+\t// DiffInfoServiceNameUpdated\n+\tDiffInfoServiceNameUpdated DiffType = \"service-name-updated\"\n \n-\t// Used to indicate that a node (service or component) was added. `Name` in the DiffInfo describes the node that was added.\n-\tInfoNodeAdded DiffType = \"node-added\"\n+\t// DiffInfoComponentAdded\n+\tDiffInfoComponentAdded DiffType = \"component-added\"\n \n-\t// Used to indicate that a node (service or component) was removed. `Name` in the DiffInfo describes the node that was removed.\n-\tInfoNodeRemoved DiffType = \"node-removed\"\n+\t// DiffInfoComponentRemoved\n+\tDiffInfoComponentRemoved DiffType = \"component-removed\"\n \n-\t// Used to indicate that the scaling config of a component changed.\n-\tInfoComponentScalingUpdated DiffType = \"component-scaling-changed\"\n+\t// DiffInfoComponentUpdated\n+\tDiffInfoComponentUpdated DiffType = \"component-updated\"\n \n-\t// Used to indicate that the InstanceConfig in the ComponentConfig identified by `Name` changed.\n-\tInfoInstanceConfigUpdated DiffType = \"instance-update\"\n+\t// DiffInfoComponentImageUpdated\n+\tDiffInfoComponentImageUpdated DiffType = \"component-image-updated\"\n \n-\t// Used to indicate that the component itself changed (but not the underlying InstanceConfig). `Name` in the DiffInfo describes the node that was changed.\n-\tInfoComponentUpdated DiffType = \"component-update\"\n+\t// DiffInfoComponentEntrypointUpdated\n+\tDiffInfoComponentEntrypointUpdated DiffType = \"component-entrypoint-updated\"\n+\n+\t// DiffInfoComponentPortsUpdated\n+\tDiffInfoComponentPortsUpdated DiffType = \"component-ports-updated\"\n+\n+\t// DiffInfoComponentEnvUpdated\n+\tDiffInfoComponentEnvUpdated DiffType = \"component-env-updated\"\n+\n+\t// DiffInfoComponentVolumesUpdated\n+\tDiffInfoComponentVolumesUpdated DiffType = \"component-volumes-updated\"\n+\n+\t// DiffInfoComponentArgsUpdated\n+\tDiffInfoComponentArgsUpdated DiffType = \"component-args-updated\"\n+\n+\t// DiffInfoComponentDomainsUpdated\n+\tDiffInfoComponentDomainsUpdated DiffType = \"component-domains-updated\"\n+\n+\t// DiffInfoComponentLinksUpdated\n+\tDiffInfoComponentLinksUpdated DiffType = \"component-links-updated\"\n+\n+\t// DiffInfoComponentExposeUpdated\n+\tDiffInfoComponentExposeUpdated DiffType = \"component-expose-updated\"\n+\n+\t// DiffInfoComponentScaleUpdated\n+\tDiffInfoComponentScaleUpdated DiffType = \"component-scale-updated\"\n+\n+\t// DiffInfoComponentPodUpdated\n+\tDiffInfoComponentPodUpdated DiffType = \"component-pod-updated\"\n+\n+\t// DiffInfoComponentSignalReadyUpdated\n+\tDiffInfoComponentSignalReadyUpdated DiffType = \"component-signal-ready-updated\"\n )\n \n type DiffInfo struct {\n-\t// What type changed: app, service, component\n \tType DiffType\n \n-\t// Path to the node that changed.\n-\tName []string\n+\tOld string\n+\tNew string\n+}\n+\n+func (di DiffInfo) Action() string {\n+\tswitch di.Type {\n+\tcase DiffInfoServiceNameUpdated:\n+\t\treturn \"re-create service\"\n+\tcase DiffInfoComponentAdded:\n+\t\treturn \"add component\"\n+\tcase DiffInfoComponentRemoved:\n+\t\treturn \"remove component\"\n+\tcase DiffInfoComponentUpdated:\n+\t\treturn \"update component\"\n+\tdefault:\n+\t\tpanic(\"unknown diff type\")\n+\t}\n+}\n+\n+func (di DiffInfo) Reason() string {","path":"diff.go","position":100,"original_position":100,"commit_id":"ce8c62c4b34277848b80b0750f09dd8738cd903a","original_commit_id":"ce8c62c4b34277848b80b0750f09dd8738cd903a","user":{"login":"ewoutp","id":4750892,"avatar_url":"https://avatars.githubusercontent.com/u/4750892?v=3","gravatar_id":"","url":"https://api.github.com/users/ewoutp","html_url":"https://github.com/ewoutp","followers_url":"https://api.github.com/users/ewoutp/followers","following_url":"https://api.github.com/users/ewoutp/following{/other_user}","gists_url":"https://api.github.com/users/ewoutp/gists{/gist_id}","starred_url":"https://api.github.com/users/ewoutp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewoutp/subscriptions","organizations_url":"https://api.github.com/users/ewoutp/orgs","repos_url":"https://api.github.com/users/ewoutp/repos","events_url":"https://api.github.com/users/ewoutp/events{/privacy}","received_events_url":"https://api.github.com/users/ewoutp/received_events","type":"User","site_admin":false},"body":"Please add comment describing the meaning and expected use of the return values.","created_at":"2015-09-14T11:31:30Z","updated_at":"2015-09-14T11:31:30Z","html_url":"https://github.com/giantswarm/user-config/pull/60#discussion_r39383739","pull_request_url":"https://api.github.com/repos/giantswarm/user-config/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/giantswarm/user-config/pulls/comments/39383739"},"html":{"href":"https://github.com/giantswarm/user-config/pull/60#discussion_r39383739"},"pull_request":{"href":"https://api.github.com/repos/giantswarm/user-config/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/giantswarm/user-config/pulls/60","id":44560660,"html_url":"https://github.com/giantswarm/user-config/pull/60","diff_url":"https://github.com/giantswarm/user-config/pull/60.diff","patch_url":"https://github.com/giantswarm/user-config/pull/60.patch","issue_url":"https://api.github.com/repos/giantswarm/user-config/issues/60","number":60,"state":"open","locked":false,"title":"basic diff to detect differences between service definitions","user":{"login":"zyndiecate","id":552769,"avatar_url":"https://avatars.githubusercontent.com/u/552769?v=3","gravatar_id":"","url":"https://api.github.com/users/zyndiecate","html_url":"https://github.com/zyndiecate","followers_url":"https://api.github.com/users/zyndiecate/followers","following_url":"https://api.github.com/users/zyndiecate/following{/other_user}","gists_url":"https://api.github.com/users/zyndiecate/gists{/gist_id}","starred_url":"https://api.github.com/users/zyndiecate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyndiecate/subscriptions","organizations_url":"https://api.github.com/users/zyndiecate/orgs","repos_url":"https://api.github.com/users/zyndiecate/repos","events_url":"https://api.github.com/users/zyndiecate/events{/privacy}","received_events_url":"https://api.github.com/users/zyndiecate/received_events","type":"User","site_admin":false},"body":"This implements basic diff functionality to detect differences between service definitions. This will be necessary to implement service definition updates. ","created_at":"2015-09-09T15:00:09Z","updated_at":"2015-09-14T11:31:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"608a3454db926331c7eea0076516cebeb48ef5cf","assignee":{"login":"zyndiecate","id":552769,"avatar_url":"https://avatars.githubusercontent.com/u/552769?v=3","gravatar_id":"","url":"https://api.github.com/users/zyndiecate","html_url":"https://github.com/zyndiecate","followers_url":"https://api.github.com/users/zyndiecate/followers","following_url":"https://api.github.com/users/zyndiecate/following{/other_user}","gists_url":"https://api.github.com/users/zyndiecate/gists{/gist_id}","starred_url":"https://api.github.com/users/zyndiecate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyndiecate/subscriptions","organizations_url":"https://api.github.com/users/zyndiecate/orgs","repos_url":"https://api.github.com/users/zyndiecate/repos","events_url":"https://api.github.com/users/zyndiecate/events{/privacy}","received_events_url":"https://api.github.com/users/zyndiecate/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/giantswarm/user-config/pulls/60/commits","review_comments_url":"https://api.github.com/repos/giantswarm/user-config/pulls/60/comments","review_comment_url":"https://api.github.com/repos/giantswarm/user-config/pulls/comments{/number}","comments_url":"https://api.github.com/repos/giantswarm/user-config/issues/60/comments","statuses_url":"https://api.github.com/repos/giantswarm/user-config/statuses/ce8c62c4b34277848b80b0750f09dd8738cd903a","head":{"label":"giantswarm:diff","ref":"diff","sha":"ce8c62c4b34277848b80b0750f09dd8738cd903a","user":{"login":"giantswarm","id":7556340,"avatar_url":"https://avatars.githubusercontent.com/u/7556340?v=3","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"repo":{"id":30184290,"name":"user-config","full_name":"giantswarm/user-config","owner":{"login":"giantswarm","id":7556340,"avatar_url":"https://avatars.githubusercontent.com/u/7556340?v=3","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/giantswarm/user-config","description":"Data structures used for the Giant Swarm service definition (swarm.json)","fork":false,"url":"https://api.github.com/repos/giantswarm/user-config","forks_url":"https://api.github.com/repos/giantswarm/user-config/forks","keys_url":"https://api.github.com/repos/giantswarm/user-config/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantswarm/user-config/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantswarm/user-config/teams","hooks_url":"https://api.github.com/repos/giantswarm/user-config/hooks","issue_events_url":"https://api.github.com/repos/giantswarm/user-config/issues/events{/number}","events_url":"https://api.github.com/repos/giantswarm/user-config/events","assignees_url":"https://api.github.com/repos/giantswarm/user-config/assignees{/user}","branches_url":"https://api.github.com/repos/giantswarm/user-config/branches{/branch}","tags_url":"https://api.github.com/repos/giantswarm/user-config/tags","blobs_url":"https://api.github.com/repos/giantswarm/user-config/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantswarm/user-config/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantswarm/user-config/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantswarm/user-config/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantswarm/user-config/statuses/{sha}","languages_url":"https://api.github.com/repos/giantswarm/user-config/languages","stargazers_url":"https://api.github.com/repos/giantswarm/user-config/stargazers","contributors_url":"https://api.github.com/repos/giantswarm/user-config/contributors","subscribers_url":"https://api.github.com/repos/giantswarm/user-config/subscribers","subscription_url":"https://api.github.com/repos/giantswarm/user-config/subscription","commits_url":"https://api.github.com/repos/giantswarm/user-config/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantswarm/user-config/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantswarm/user-config/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantswarm/user-config/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantswarm/user-config/contents/{+path}","compare_url":"https://api.github.com/repos/giantswarm/user-config/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantswarm/user-config/merges","archive_url":"https://api.github.com/repos/giantswarm/user-config/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantswarm/user-config/downloads","issues_url":"https://api.github.com/repos/giantswarm/user-config/issues{/number}","pulls_url":"https://api.github.com/repos/giantswarm/user-config/pulls{/number}","milestones_url":"https://api.github.com/repos/giantswarm/user-config/milestones{/number}","notifications_url":"https://api.github.com/repos/giantswarm/user-config/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantswarm/user-config/labels{/name}","releases_url":"https://api.github.com/repos/giantswarm/user-config/releases{/id}","created_at":"2015-02-02T11:36:25Z","updated_at":"2015-09-02T07:14:52Z","pushed_at":"2015-09-12T15:27:07Z","git_url":"git://github.com/giantswarm/user-config.git","ssh_url":"git@github.com:giantswarm/user-config.git","clone_url":"https://github.com/giantswarm/user-config.git","svn_url":"https://github.com/giantswarm/user-config","homepage":"","size":1055,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"giantswarm:master","ref":"master","sha":"0558e68ca6cbd70f17e5ae480e6717f4f3448c29","user":{"login":"giantswarm","id":7556340,"avatar_url":"https://avatars.githubusercontent.com/u/7556340?v=3","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"repo":{"id":30184290,"name":"user-config","full_name":"giantswarm/user-config","owner":{"login":"giantswarm","id":7556340,"avatar_url":"https://avatars.githubusercontent.com/u/7556340?v=3","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/giantswarm/user-config","description":"Data structures used for the Giant Swarm service definition (swarm.json)","fork":false,"url":"https://api.github.com/repos/giantswarm/user-config","forks_url":"https://api.github.com/repos/giantswarm/user-config/forks","keys_url":"https://api.github.com/repos/giantswarm/user-config/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantswarm/user-config/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantswarm/user-config/teams","hooks_url":"https://api.github.com/repos/giantswarm/user-config/hooks","issue_events_url":"https://api.github.com/repos/giantswarm/user-config/issues/events{/number}","events_url":"https://api.github.com/repos/giantswarm/user-config/events","assignees_url":"https://api.github.com/repos/giantswarm/user-config/assignees{/user}","branches_url":"https://api.github.com/repos/giantswarm/user-config/branches{/branch}","tags_url":"https://api.github.com/repos/giantswarm/user-config/tags","blobs_url":"https://api.github.com/repos/giantswarm/user-config/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantswarm/user-config/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantswarm/user-config/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantswarm/user-config/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantswarm/user-config/statuses/{sha}","languages_url":"https://api.github.com/repos/giantswarm/user-config/languages","stargazers_url":"https://api.github.com/repos/giantswarm/user-config/stargazers","contributors_url":"https://api.github.com/repos/giantswarm/user-config/contributors","subscribers_url":"https://api.github.com/repos/giantswarm/user-config/subscribers","subscription_url":"https://api.github.com/repos/giantswarm/user-config/subscription","commits_url":"https://api.github.com/repos/giantswarm/user-config/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantswarm/user-config/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantswarm/user-config/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantswarm/user-config/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantswarm/user-config/contents/{+path}","compare_url":"https://api.github.com/repos/giantswarm/user-config/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantswarm/user-config/merges","archive_url":"https://api.github.com/repos/giantswarm/user-config/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantswarm/user-config/downloads","issues_url":"https://api.github.com/repos/giantswarm/user-config/issues{/number}","pulls_url":"https://api.github.com/repos/giantswarm/user-config/pulls{/number}","milestones_url":"https://api.github.com/repos/giantswarm/user-config/milestones{/number}","notifications_url":"https://api.github.com/repos/giantswarm/user-config/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantswarm/user-config/labels{/name}","releases_url":"https://api.github.com/repos/giantswarm/user-config/releases{/id}","created_at":"2015-02-02T11:36:25Z","updated_at":"2015-09-02T07:14:52Z","pushed_at":"2015-09-12T15:27:07Z","git_url":"git://github.com/giantswarm/user-config.git","ssh_url":"git@github.com:giantswarm/user-config.git","clone_url":"https://github.com/giantswarm/user-config.git","svn_url":"https://github.com/giantswarm/user-config","homepage":"","size":1055,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/giantswarm/user-config/pulls/60"},"html":{"href":"https://github.com/giantswarm/user-config/pull/60"},"issue":{"href":"https://api.github.com/repos/giantswarm/user-config/issues/60"},"comments":{"href":"https://api.github.com/repos/giantswarm/user-config/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/giantswarm/user-config/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/giantswarm/user-config/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/giantswarm/user-config/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/giantswarm/user-config/statuses/ce8c62c4b34277848b80b0750f09dd8738cd903a"}}}}