{"action":"closed","number":491,"pull_request":{"url":"https://api.github.com/repos/giantswarm/cli/pulls/491","id":51897041,"html_url":"https://github.com/giantswarm/cli/pull/491","diff_url":"https://github.com/giantswarm/cli/pull/491.diff","patch_url":"https://github.com/giantswarm/cli/pull/491.patch","issue_url":"https://api.github.com/repos/giantswarm/cli/issues/491","number":491,"state":"closed","locked":false,"title":"Warn on unresolved variables in swarm.json","user":{"login":"JosephSalisbury","id":297653,"avatar_url":"https://avatars.githubusercontent.com/u/297653?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephSalisbury","html_url":"https://github.com/JosephSalisbury","followers_url":"https://api.github.com/users/JosephSalisbury/followers","following_url":"https://api.github.com/users/JosephSalisbury/following{/other_user}","gists_url":"https://api.github.com/users/JosephSalisbury/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephSalisbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephSalisbury/subscriptions","organizations_url":"https://api.github.com/users/JosephSalisbury/orgs","repos_url":"https://api.github.com/users/JosephSalisbury/repos","events_url":"https://api.github.com/users/JosephSalisbury/events{/privacy}","received_events_url":"https://api.github.com/users/JosephSalisbury/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/giantswarm/cli/issues/21\r\n\r\nAny variables defined in swarm.json that have not been supplied will not be resolved, which may cause issues further down, so this change introduces a check that runs after creating the service definition, searches for any tokens that look like unresolved variables, and prints a warning if it finds any.\r\n\r\nSo, with the helloworld example, if the user doesn't use\r\n```\r\nswarm up --var=domain=helloworld-$USER.gigantic.io\r\n```\r\nand just does\r\n```\r\nswarm up\r\n```\r\nthen the user will be warned:\r\n\r\n```\r\nJosephs-MacBook-Pro:helloworld joseph$ ../cli/swarm up\r\nWe found a token in swarm.json that looks like a variable that has not been resolved:\r\n- $domain\r\nPlease make sure to define any variables that are required.\r\nCreating 'helloworld' in the 'salisbury_joe/testing' environment…\r\nCannot create service due to a validation error in 'swarm.json'.\r\n\r\n    Validation error: invalid service definition: invalid format for domains: Port must be a number, got '$domain': strconv.ParseInt: parsing \"$domain\": invalid syntax","created_at":"2015-11-26T10:44:35Z","updated_at":"2015-11-27T09:24:52Z","closed_at":"2015-11-27T09:24:52Z","merged_at":"2015-11-27T09:24:52Z","merge_commit_sha":"aa5b2575bc450bcc587b82e5ca5bc6ef67b5799a","assignee":{"login":"JosephSalisbury","id":297653,"avatar_url":"https://avatars.githubusercontent.com/u/297653?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephSalisbury","html_url":"https://github.com/JosephSalisbury","followers_url":"https://api.github.com/users/JosephSalisbury/followers","following_url":"https://api.github.com/users/JosephSalisbury/following{/other_user}","gists_url":"https://api.github.com/users/JosephSalisbury/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephSalisbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephSalisbury/subscriptions","organizations_url":"https://api.github.com/users/JosephSalisbury/orgs","repos_url":"https://api.github.com/users/JosephSalisbury/repos","events_url":"https://api.github.com/users/JosephSalisbury/events{/privacy}","received_events_url":"https://api.github.com/users/JosephSalisbury/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/giantswarm/cli/pulls/491/commits","review_comments_url":"https://api.github.com/repos/giantswarm/cli/pulls/491/comments","review_comment_url":"https://api.github.com/repos/giantswarm/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/giantswarm/cli/issues/491/comments","statuses_url":"https://api.github.com/repos/giantswarm/cli/statuses/c8191b4ea4a60582427fa9fdb2bef9079c50aac8","head":{"label":"giantswarm:unresolved_variables","ref":"unresolved_variables","sha":"c8191b4ea4a60582427fa9fdb2bef9079c50aac8","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":30184261,"name":"cli","full_name":"giantswarm/cli","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/cli","description":"A command line tool for Giant Swarm","fork":false,"url":"https://api.github.com/repos/giantswarm/cli","forks_url":"https://api.github.com/repos/giantswarm/cli/forks","keys_url":"https://api.github.com/repos/giantswarm/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantswarm/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantswarm/cli/teams","hooks_url":"https://api.github.com/repos/giantswarm/cli/hooks","issue_events_url":"https://api.github.com/repos/giantswarm/cli/issues/events{/number}","events_url":"https://api.github.com/repos/giantswarm/cli/events","assignees_url":"https://api.github.com/repos/giantswarm/cli/assignees{/user}","branches_url":"https://api.github.com/repos/giantswarm/cli/branches{/branch}","tags_url":"https://api.github.com/repos/giantswarm/cli/tags","blobs_url":"https://api.github.com/repos/giantswarm/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantswarm/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantswarm/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantswarm/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantswarm/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/giantswarm/cli/languages","stargazers_url":"https://api.github.com/repos/giantswarm/cli/stargazers","contributors_url":"https://api.github.com/repos/giantswarm/cli/contributors","subscribers_url":"https://api.github.com/repos/giantswarm/cli/subscribers","subscription_url":"https://api.github.com/repos/giantswarm/cli/subscription","commits_url":"https://api.github.com/repos/giantswarm/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantswarm/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantswarm/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantswarm/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantswarm/cli/contents/{+path}","compare_url":"https://api.github.com/repos/giantswarm/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantswarm/cli/merges","archive_url":"https://api.github.com/repos/giantswarm/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantswarm/cli/downloads","issues_url":"https://api.github.com/repos/giantswarm/cli/issues{/number}","pulls_url":"https://api.github.com/repos/giantswarm/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/giantswarm/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/giantswarm/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantswarm/cli/labels{/name}","releases_url":"https://api.github.com/repos/giantswarm/cli/releases{/id}","created_at":"2015-02-02T11:35:56Z","updated_at":"2015-10-30T18:17:16Z","pushed_at":"2015-11-27T09:24:52Z","git_url":"git://github.com/giantswarm/cli.git","ssh_url":"git@github.com:giantswarm/cli.git","clone_url":"https://github.com/giantswarm/cli.git","svn_url":"https://github.com/giantswarm/cli","homepage":null,"size":845,"stargazers_count":11,"watchers_count":11,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":109,"forks":0,"open_issues":109,"watchers":11,"default_branch":"master"}},"base":{"label":"giantswarm:master","ref":"master","sha":"8d99abb6ea12ddf248883989677cb4b1140c2edf","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":30184261,"name":"cli","full_name":"giantswarm/cli","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/cli","description":"A command line tool for Giant Swarm","fork":false,"url":"https://api.github.com/repos/giantswarm/cli","forks_url":"https://api.github.com/repos/giantswarm/cli/forks","keys_url":"https://api.github.com/repos/giantswarm/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantswarm/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantswarm/cli/teams","hooks_url":"https://api.github.com/repos/giantswarm/cli/hooks","issue_events_url":"https://api.github.com/repos/giantswarm/cli/issues/events{/number}","events_url":"https://api.github.com/repos/giantswarm/cli/events","assignees_url":"https://api.github.com/repos/giantswarm/cli/assignees{/user}","branches_url":"https://api.github.com/repos/giantswarm/cli/branches{/branch}","tags_url":"https://api.github.com/repos/giantswarm/cli/tags","blobs_url":"https://api.github.com/repos/giantswarm/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantswarm/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantswarm/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantswarm/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantswarm/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/giantswarm/cli/languages","stargazers_url":"https://api.github.com/repos/giantswarm/cli/stargazers","contributors_url":"https://api.github.com/repos/giantswarm/cli/contributors","subscribers_url":"https://api.github.com/repos/giantswarm/cli/subscribers","subscription_url":"https://api.github.com/repos/giantswarm/cli/subscription","commits_url":"https://api.github.com/repos/giantswarm/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantswarm/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantswarm/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantswarm/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantswarm/cli/contents/{+path}","compare_url":"https://api.github.com/repos/giantswarm/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantswarm/cli/merges","archive_url":"https://api.github.com/repos/giantswarm/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantswarm/cli/downloads","issues_url":"https://api.github.com/repos/giantswarm/cli/issues{/number}","pulls_url":"https://api.github.com/repos/giantswarm/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/giantswarm/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/giantswarm/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantswarm/cli/labels{/name}","releases_url":"https://api.github.com/repos/giantswarm/cli/releases{/id}","created_at":"2015-02-02T11:35:56Z","updated_at":"2015-10-30T18:17:16Z","pushed_at":"2015-11-27T09:24:52Z","git_url":"git://github.com/giantswarm/cli.git","ssh_url":"git@github.com:giantswarm/cli.git","clone_url":"https://github.com/giantswarm/cli.git","svn_url":"https://github.com/giantswarm/cli","homepage":null,"size":845,"stargazers_count":11,"watchers_count":11,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":109,"forks":0,"open_issues":109,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/giantswarm/cli/pulls/491"},"html":{"href":"https://github.com/giantswarm/cli/pull/491"},"issue":{"href":"https://api.github.com/repos/giantswarm/cli/issues/491"},"comments":{"href":"https://api.github.com/repos/giantswarm/cli/issues/491/comments"},"review_comments":{"href":"https://api.github.com/repos/giantswarm/cli/pulls/491/comments"},"review_comment":{"href":"https://api.github.com/repos/giantswarm/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/giantswarm/cli/pulls/491/commits"},"statuses":{"href":"https://api.github.com/repos/giantswarm/cli/statuses/c8191b4ea4a60582427fa9fdb2bef9079c50aac8"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"JosephSalisbury","id":297653,"avatar_url":"https://avatars.githubusercontent.com/u/297653?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephSalisbury","html_url":"https://github.com/JosephSalisbury","followers_url":"https://api.github.com/users/JosephSalisbury/followers","following_url":"https://api.github.com/users/JosephSalisbury/following{/other_user}","gists_url":"https://api.github.com/users/JosephSalisbury/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephSalisbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephSalisbury/subscriptions","organizations_url":"https://api.github.com/users/JosephSalisbury/orgs","repos_url":"https://api.github.com/users/JosephSalisbury/repos","events_url":"https://api.github.com/users/JosephSalisbury/events{/privacy}","received_events_url":"https://api.github.com/users/JosephSalisbury/received_events","type":"User","site_admin":false},"comments":15,"review_comments":3,"commits":6,"additions":97,"deletions":0,"changed_files":6}}