{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/comments/178210350","pull_request_review_id":108238537,"id":178210350,"diff_hunk":"@@ -0,0 +1,79 @@\n+/*\n+Copyright 2018 Google LLC\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package cmd\n+\n+import (\n+\t\"fmt\"\n+\t\"io\"\n+\n+\tyaml \"gopkg.in/yaml.v2\"\n+\n+\t\"github.com/pkg/errors\"\n+\t\"github.com/sirupsen/logrus\"\n+\t\"github.com/spf13/cobra\"\n+\n+\t\"github.com/GoogleCloudPlatform/skaffold/pkg/skaffold/config\"\n+\t\"github.com/GoogleCloudPlatform/skaffold/pkg/skaffold/schema\"\n+\tschemautil \"github.com/GoogleCloudPlatform/skaffold/pkg/skaffold/schema/util\"\n+\t\"github.com/GoogleCloudPlatform/skaffold/pkg/skaffold/util\"\n+)\n+\n+func NewCmdFix(out io.Writer) *cobra.Command {\n+\tcmd := &cobra.Command{\n+\t\tUse:   \"fix\",\n+\t\tShort: \"Converts old skaffold.yaml to newest schema version\",\n+\t\tRun: func(cmd *cobra.Command, args []string) {\n+\t\t\tcontents, err := util.ReadConfiguration(filename)\n+\t\t\tif err != nil {\n+\t\t\t\tlogrus.Errorf(\"fix: %s\", err)\n+\t\t\t}\n+\t\t\tcfg, err := config.GetConfig(contents, false, true)\n+\t\t\tif err != nil {\n+\t\t\t\tlogrus.Error(err)\n+\t\t\t\treturn\n+\t\t\t}\n+\t\t\tif cfg.GetVersion() == config.LatestVersion {\n+\t\t\t\tfmt.Println(\"config is already latest version\")","path":"cmd/skaffold/app/cmd/fix.go","position":50,"original_position":50,"commit_id":"3c0fb29352f8a2ba4b3871a1c24c1b932fa5d76e","original_commit_id":"3c0fb29352f8a2ba4b3871a1c24c1b932fa5d76e","user":{"login":"nkubala","id":5531168,"avatar_url":"https://avatars2.githubusercontent.com/u/5531168?v=4","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-03-30T00:04:58Z","updated_at":"2018-03-30T00:04:58Z","html_url":"https://github.com/GoogleCloudPlatform/skaffold/pull/291#discussion_r178210350","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/291","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/comments/178210350"},"html":{"href":"https://github.com/GoogleCloudPlatform/skaffold/pull/291#discussion_r178210350"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/291"}},"in_reply_to_id":178196303},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/291","id":177858676,"html_url":"https://github.com/GoogleCloudPlatform/skaffold/pull/291","diff_url":"https://github.com/GoogleCloudPlatform/skaffold/pull/291.diff","patch_url":"https://github.com/GoogleCloudPlatform/skaffold/pull/291.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/issues/291","number":291,"state":"open","locked":false,"title":"Add `skaffold fix` to automatically update user configs","user":{"login":"nkubala","id":5531168,"avatar_url":"https://avatars2.githubusercontent.com/u/5531168?v=4","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"body":"This change adds a new command to skaffold, `fix`, which will automatically update user configs to the latest version, and output them as `<config_filename>.new` (e.g. `skaffold.yaml.new`). When an older (incompatible) config is passed to skaffold, it will tell the user to run `skaffold fix` to update their config.\r\n\r\nAlong with the addition of this command, this adds support for skaffold config versioning, which will allow us to make breaking changes to the config as needed. When these changes are made, a `Transformer` should be created with a `transform(*VersionedConfig)` method, which will convert the old version of the config into one compatible with the latest schema. These will then be applied in series to update any older config version to the latest version.\r\n\r\nThe main change to existing code is moving the main skaffold components from using structs imported from the `config` package, to using typed structs imported from `schema/<version>` (e.g `schema/v1alpha1`). This will make it more explicit when we make breaking changes to the config objects what in the code actually needs to be fixed.\r\n\r\nThis is the first code in the repo to make use of the `apiVersion` field in the config, and this is where config versioning will happen from now on.\r\n\r\nFixes #254 ","created_at":"2018-03-27T20:39:18Z","updated_at":"2018-03-30T00:04:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00cce82f1b242ee777fe56068c4492ae12f499a0","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dgageot","id":153495,"avatar_url":"https://avatars2.githubusercontent.com/u/153495?v=4","gravatar_id":"","url":"https://api.github.com/users/dgageot","html_url":"https://github.com/dgageot","followers_url":"https://api.github.com/users/dgageot/followers","following_url":"https://api.github.com/users/dgageot/following{/other_user}","gists_url":"https://api.github.com/users/dgageot/gists{/gist_id}","starred_url":"https://api.github.com/users/dgageot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgageot/subscriptions","organizations_url":"https://api.github.com/users/dgageot/orgs","repos_url":"https://api.github.com/users/dgageot/repos","events_url":"https://api.github.com/users/dgageot/events{/privacy}","received_events_url":"https://api.github.com/users/dgageot/received_events","type":"User","site_admin":false},{"login":"viglesiasce","id":410279,"avatar_url":"https://avatars2.githubusercontent.com/u/410279?v=4","gravatar_id":"","url":"https://api.github.com/users/viglesiasce","html_url":"https://github.com/viglesiasce","followers_url":"https://api.github.com/users/viglesiasce/followers","following_url":"https://api.github.com/users/viglesiasce/following{/other_user}","gists_url":"https://api.github.com/users/viglesiasce/gists{/gist_id}","starred_url":"https://api.github.com/users/viglesiasce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viglesiasce/subscriptions","organizations_url":"https://api.github.com/users/viglesiasce/orgs","repos_url":"https://api.github.com/users/viglesiasce/repos","events_url":"https://api.github.com/users/viglesiasce/events{/privacy}","received_events_url":"https://api.github.com/users/viglesiasce/received_events","type":"User","site_admin":false},{"login":"dlorenc","id":1714486,"avatar_url":"https://avatars1.githubusercontent.com/u/1714486?v=4","gravatar_id":"","url":"https://api.github.com/users/dlorenc","html_url":"https://github.com/dlorenc","followers_url":"https://api.github.com/users/dlorenc/followers","following_url":"https://api.github.com/users/dlorenc/following{/other_user}","gists_url":"https://api.github.com/users/dlorenc/gists{/gist_id}","starred_url":"https://api.github.com/users/dlorenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlorenc/subscriptions","organizations_url":"https://api.github.com/users/dlorenc/orgs","repos_url":"https://api.github.com/users/dlorenc/repos","events_url":"https://api.github.com/users/dlorenc/events{/privacy}","received_events_url":"https://api.github.com/users/dlorenc/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/291/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/291/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/issues/291/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/statuses/3c0fb29352f8a2ba4b3871a1c24c1b932fa5d76e","head":{"label":"nkubala:fix","ref":"fix","sha":"3c0fb29352f8a2ba4b3871a1c24c1b932fa5d76e","user":{"login":"nkubala","id":5531168,"avatar_url":"https://avatars2.githubusercontent.com/u/5531168?v=4","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"repo":{"id":126401394,"name":"skaffold","full_name":"nkubala/skaffold","owner":{"login":"nkubala","id":5531168,"avatar_url":"https://avatars2.githubusercontent.com/u/5531168?v=4","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nkubala/skaffold","description":"Easy and Repeatable Kubernetes Development","fork":true,"url":"https://api.github.com/repos/nkubala/skaffold","forks_url":"https://api.github.com/repos/nkubala/skaffold/forks","keys_url":"https://api.github.com/repos/nkubala/skaffold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nkubala/skaffold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nkubala/skaffold/teams","hooks_url":"https://api.github.com/repos/nkubala/skaffold/hooks","issue_events_url":"https://api.github.com/repos/nkubala/skaffold/issues/events{/number}","events_url":"https://api.github.com/repos/nkubala/skaffold/events","assignees_url":"https://api.github.com/repos/nkubala/skaffold/assignees{/user}","branches_url":"https://api.github.com/repos/nkubala/skaffold/branches{/branch}","tags_url":"https://api.github.com/repos/nkubala/skaffold/tags","blobs_url":"https://api.github.com/repos/nkubala/skaffold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nkubala/skaffold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nkubala/skaffold/git/refs{/sha}","trees_url":"https://api.github.com/repos/nkubala/skaffold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nkubala/skaffold/statuses/{sha}","languages_url":"https://api.github.com/repos/nkubala/skaffold/languages","stargazers_url":"https://api.github.com/repos/nkubala/skaffold/stargazers","contributors_url":"https://api.github.com/repos/nkubala/skaffold/contributors","subscribers_url":"https://api.github.com/repos/nkubala/skaffold/subscribers","subscription_url":"https://api.github.com/repos/nkubala/skaffold/subscription","commits_url":"https://api.github.com/repos/nkubala/skaffold/commits{/sha}","git_commits_url":"https://api.github.com/repos/nkubala/skaffold/git/commits{/sha}","comments_url":"https://api.github.com/repos/nkubala/skaffold/comments{/number}","issue_comment_url":"https://api.github.com/repos/nkubala/skaffold/issues/comments{/number}","contents_url":"https://api.github.com/repos/nkubala/skaffold/contents/{+path}","compare_url":"https://api.github.com/repos/nkubala/skaffold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nkubala/skaffold/merges","archive_url":"https://api.github.com/repos/nkubala/skaffold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nkubala/skaffold/downloads","issues_url":"https://api.github.com/repos/nkubala/skaffold/issues{/number}","pulls_url":"https://api.github.com/repos/nkubala/skaffold/pulls{/number}","milestones_url":"https://api.github.com/repos/nkubala/skaffold/milestones{/number}","notifications_url":"https://api.github.com/repos/nkubala/skaffold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nkubala/skaffold/labels{/name}","releases_url":"https://api.github.com/repos/nkubala/skaffold/releases{/id}","deployments_url":"https://api.github.com/repos/nkubala/skaffold/deployments","created_at":"2018-03-22T22:17:08Z","updated_at":"2018-03-28T21:21:24Z","pushed_at":"2018-03-29T23:20:13Z","git_url":"git://github.com/nkubala/skaffold.git","ssh_url":"git@github.com:nkubala/skaffold.git","clone_url":"https://github.com/nkubala/skaffold.git","svn_url":"https://github.com/nkubala/skaffold","homepage":"","size":12493,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"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":"GoogleCloudPlatform:master","ref":"master","sha":"2b7a9f10fa15ab132c09104b016f3f0127ff65fe","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":118654121,"name":"skaffold","full_name":"GoogleCloudPlatform/skaffold","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/skaffold","description":"Easy and Repeatable Kubernetes Development","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/deployments","created_at":"2018-01-23T18:51:29Z","updated_at":"2018-03-29T21:42:04Z","pushed_at":"2018-03-29T22:16:47Z","git_url":"git://github.com/GoogleCloudPlatform/skaffold.git","ssh_url":"git@github.com:GoogleCloudPlatform/skaffold.git","clone_url":"https://github.com/GoogleCloudPlatform/skaffold.git","svn_url":"https://github.com/GoogleCloudPlatform/skaffold","homepage":"","size":12458,"stargazers_count":2910,"watchers_count":2910,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":86,"mirror_url":null,"archived":false,"open_issues_count":95,"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":86,"open_issues":95,"watchers":2910,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/291"},"html":{"href":"https://github.com/GoogleCloudPlatform/skaffold/pull/291"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/issues/291"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/issues/291/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/291/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/pulls/291/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/skaffold/statuses/3c0fb29352f8a2ba4b3871a1c24c1b932fa5d76e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nkubala"}}