{"action":"created","comment":{"url":"https://api.github.com/repos/docker/cli/pulls/comments/206768972","pull_request_review_id":142244109,"id":206768972,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjc2ODk3Mg==","diff_hunk":"@@ -0,0 +1,24 @@\n+package stack\n+\n+import (\n+\t\"fmt\"\n+\t\"testing\"\n+\n+\t\"gotest.tools/golden\"\n+\t\"gotest.tools/icmd\"\n+)\n+\n+func TestStackDeployHelp(t *testing.T) {\n+\tt.Run(\"Swarm\", func(t *testing.T) {\n+\t\ttestStackDeployHelp(t, \"swarm\")\n+\t})\n+\tt.Run(\"Kubernetes\", func(t *testing.T) {\n+\t\ttestStackDeployHelp(t, \"kubernetes\")\n+\t})\n+}\n+\n+func testStackDeployHelp(t *testing.T, orchestrator string) {\n+\tresult := icmd.RunCommand(\"docker\", \"stack\", \"deploy\", \"--orchestrator\", orchestrator, \"--help\")\n+\tresult.Assert(t, icmd.Success)\n+\tgolden.Assert(t, result.Stdout(), fmt.Sprintf(\"stack-deploy-help-%s.golden\", orchestrator))","path":"e2e/stack/help_test.go","position":23,"original_position":23,"commit_id":"21cce52b3060414aa76b89d4d401ada74b178789","original_commit_id":"21cce52b3060414aa76b89d4d401ada74b178789","user":{"login":"albers","id":2901725,"node_id":"MDQ6VXNlcjI5MDE3MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/2901725?v=4","gravatar_id":"","url":"https://api.github.com/users/albers","html_url":"https://github.com/albers","followers_url":"https://api.github.com/users/albers/followers","following_url":"https://api.github.com/users/albers/following{/other_user}","gists_url":"https://api.github.com/users/albers/gists{/gist_id}","starred_url":"https://api.github.com/users/albers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albers/subscriptions","organizations_url":"https://api.github.com/users/albers/orgs","repos_url":"https://api.github.com/users/albers/repos","events_url":"https://api.github.com/users/albers/events{/privacy}","received_events_url":"https://api.github.com/users/albers/received_events","type":"User","site_admin":false},"body":"Is this the commonly used way to verify command outputs in this project? This will break every time an option or help message is added/modified, this producing unnecessary maintenance work.\r\n\r\nAlternatively, we could check for the presence of specific flags via substring checks.","created_at":"2018-08-01T06:40:39Z","updated_at":"2018-08-01T06:40:39Z","html_url":"https://github.com/docker/cli/pull/1251#discussion_r206768972","pull_request_url":"https://api.github.com/repos/docker/cli/pulls/1251","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/docker/cli/pulls/comments/206768972"},"html":{"href":"https://github.com/docker/cli/pull/1251#discussion_r206768972"},"pull_request":{"href":"https://api.github.com/repos/docker/cli/pulls/1251"}}},"pull_request":{"url":"https://api.github.com/repos/docker/cli/pulls/1251","id":205273610,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MjczNjEw","html_url":"https://github.com/docker/cli/pull/1251","diff_url":"https://github.com/docker/cli/pull/1251.diff","patch_url":"https://github.com/docker/cli/pull/1251.patch","issue_url":"https://api.github.com/repos/docker/cli/issues/1251","number":1251,"state":"open","locked":false,"title":"Fix help message flags on docker stack commands and sub-commands","user":{"login":"silvin-lubecki","id":31478878,"node_id":"MDQ6VXNlcjMxNDc4ODc4","avatar_url":"https://avatars0.githubusercontent.com/u/31478878?v=4","gravatar_id":"","url":"https://api.github.com/users/silvin-lubecki","html_url":"https://github.com/silvin-lubecki","followers_url":"https://api.github.com/users/silvin-lubecki/followers","following_url":"https://api.github.com/users/silvin-lubecki/following{/other_user}","gists_url":"https://api.github.com/users/silvin-lubecki/gists{/gist_id}","starred_url":"https://api.github.com/users/silvin-lubecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silvin-lubecki/subscriptions","organizations_url":"https://api.github.com/users/silvin-lubecki/orgs","repos_url":"https://api.github.com/users/silvin-lubecki/repos","events_url":"https://api.github.com/users/silvin-lubecki/events{/privacy}","received_events_url":"https://api.github.com/users/silvin-lubecki/received_events","type":"User","site_admin":false},"body":"**- What I did**\r\nFix issue #1243 \r\nAdd an e2e test as regression test\r\n\r\n**- How I did it**\r\nPersistentPreRunE needs to be called within the help function to initialize all the flags (notably the orchestrator flag)\r\n\r\n**- How to verify it**\r\n```sh\r\n$ docker stack deploy --help --orchestrator=kubernetes\r\n\r\nUsage:\tdocker stack deploy [OPTIONS] STACK\r\n\r\nDeploy a new stack or update an existing stack\r\n\r\nAliases:\r\n  deploy, up\r\n\r\nOptions:\r\n  -c, --compose-file strings   Path to a Compose file, or \"-\" to read from stdin\r\n      --kubeconfig string      Kubernetes config file\r\n      --namespace string       Kubernetes namespace to use\r\n      --orchestrator string    Orchestrator to use (swarm|kubernetes|all)\r\n\r\n$ docker stack deploy --help --orchestrator=swarm\r\n\r\nUsage:\tdocker stack deploy [OPTIONS] STACK\r\n\r\nDeploy a new stack or update an existing stack\r\n\r\nAliases:\r\n  deploy, up\r\n\r\nOptions:\r\n      --bundle-file string     Path to a Distributed Application Bundle file\r\n  -c, --compose-file strings   Path to a Compose file, or \"-\" to read from stdin\r\n      --orchestrator string    Orchestrator to use (swarm|kubernetes|all)\r\n      --prune                  Prune services that are no longer referenced\r\n      --resolve-image string   Query the registry to resolve image digest and supported platforms (\"always\"|\"changed\"|\"never\") (default \"always\")\r\n      --with-registry-auth     Send registry authentication details to Swarm agents\r\n```\r\n\r\n**- Description for the changelog**\r\n* Fix #1243 help message flags on docker stack commands and sub-commands\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n![image](https://user-images.githubusercontent.com/31478878/43493328-bbfb6dd8-952d-11e8-9f9c-b46bb8291fe8.png)\r\n\r\nLots of kudos for @albers !!","created_at":"2018-07-31T23:54:47Z","updated_at":"2018-08-01T06:40:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"763c89fd4922c591017ea7f81b4a7b5f1cec7dfa","assignee":null,"assignees":[],"requested_reviewers":[{"login":"vdemeester","id":6508,"node_id":"MDQ6VXNlcjY1MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/6508?v=4","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false},{"login":"thaJeztah","id":1804568,"node_id":"MDQ6VXNlcjE4MDQ1Njg=","avatar_url":"https://avatars2.githubusercontent.com/u/1804568?v=4","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":585916035,"node_id":"MDU6TGFiZWw1ODU5MTYwMzU=","url":"https://api.github.com/repos/docker/cli/labels/kind/bug","name":"kind/bug","color":"FF8C94","default":false},{"id":585916069,"node_id":"MDU6TGFiZWw1ODU5MTYwNjk=","url":"https://api.github.com/repos/docker/cli/labels/status/0-triage","name":"status/0-triage","color":"EEEEEE","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/docker/cli/pulls/1251/commits","review_comments_url":"https://api.github.com/repos/docker/cli/pulls/1251/comments","review_comment_url":"https://api.github.com/repos/docker/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/cli/issues/1251/comments","statuses_url":"https://api.github.com/repos/docker/cli/statuses/21cce52b3060414aa76b89d4d401ada74b178789","head":{"label":"silvin-lubecki:fix-stack-help-command","ref":"fix-stack-help-command","sha":"21cce52b3060414aa76b89d4d401ada74b178789","user":{"login":"silvin-lubecki","id":31478878,"node_id":"MDQ6VXNlcjMxNDc4ODc4","avatar_url":"https://avatars0.githubusercontent.com/u/31478878?v=4","gravatar_id":"","url":"https://api.github.com/users/silvin-lubecki","html_url":"https://github.com/silvin-lubecki","followers_url":"https://api.github.com/users/silvin-lubecki/followers","following_url":"https://api.github.com/users/silvin-lubecki/following{/other_user}","gists_url":"https://api.github.com/users/silvin-lubecki/gists{/gist_id}","starred_url":"https://api.github.com/users/silvin-lubecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silvin-lubecki/subscriptions","organizations_url":"https://api.github.com/users/silvin-lubecki/orgs","repos_url":"https://api.github.com/users/silvin-lubecki/repos","events_url":"https://api.github.com/users/silvin-lubecki/events{/privacy}","received_events_url":"https://api.github.com/users/silvin-lubecki/received_events","type":"User","site_admin":false},"repo":{"id":107957524,"node_id":"MDEwOlJlcG9zaXRvcnkxMDc5NTc1MjQ=","name":"cli","full_name":"silvin-lubecki/cli","owner":{"login":"silvin-lubecki","id":31478878,"node_id":"MDQ6VXNlcjMxNDc4ODc4","avatar_url":"https://avatars0.githubusercontent.com/u/31478878?v=4","gravatar_id":"","url":"https://api.github.com/users/silvin-lubecki","html_url":"https://github.com/silvin-lubecki","followers_url":"https://api.github.com/users/silvin-lubecki/followers","following_url":"https://api.github.com/users/silvin-lubecki/following{/other_user}","gists_url":"https://api.github.com/users/silvin-lubecki/gists{/gist_id}","starred_url":"https://api.github.com/users/silvin-lubecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silvin-lubecki/subscriptions","organizations_url":"https://api.github.com/users/silvin-lubecki/orgs","repos_url":"https://api.github.com/users/silvin-lubecki/repos","events_url":"https://api.github.com/users/silvin-lubecki/events{/privacy}","received_events_url":"https://api.github.com/users/silvin-lubecki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/silvin-lubecki/cli","description":"The Docker CLI","fork":true,"url":"https://api.github.com/repos/silvin-lubecki/cli","forks_url":"https://api.github.com/repos/silvin-lubecki/cli/forks","keys_url":"https://api.github.com/repos/silvin-lubecki/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silvin-lubecki/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silvin-lubecki/cli/teams","hooks_url":"https://api.github.com/repos/silvin-lubecki/cli/hooks","issue_events_url":"https://api.github.com/repos/silvin-lubecki/cli/issues/events{/number}","events_url":"https://api.github.com/repos/silvin-lubecki/cli/events","assignees_url":"https://api.github.com/repos/silvin-lubecki/cli/assignees{/user}","branches_url":"https://api.github.com/repos/silvin-lubecki/cli/branches{/branch}","tags_url":"https://api.github.com/repos/silvin-lubecki/cli/tags","blobs_url":"https://api.github.com/repos/silvin-lubecki/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silvin-lubecki/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silvin-lubecki/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/silvin-lubecki/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silvin-lubecki/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/silvin-lubecki/cli/languages","stargazers_url":"https://api.github.com/repos/silvin-lubecki/cli/stargazers","contributors_url":"https://api.github.com/repos/silvin-lubecki/cli/contributors","subscribers_url":"https://api.github.com/repos/silvin-lubecki/cli/subscribers","subscription_url":"https://api.github.com/repos/silvin-lubecki/cli/subscription","commits_url":"https://api.github.com/repos/silvin-lubecki/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/silvin-lubecki/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/silvin-lubecki/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/silvin-lubecki/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/silvin-lubecki/cli/contents/{+path}","compare_url":"https://api.github.com/repos/silvin-lubecki/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silvin-lubecki/cli/merges","archive_url":"https://api.github.com/repos/silvin-lubecki/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silvin-lubecki/cli/downloads","issues_url":"https://api.github.com/repos/silvin-lubecki/cli/issues{/number}","pulls_url":"https://api.github.com/repos/silvin-lubecki/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/silvin-lubecki/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/silvin-lubecki/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silvin-lubecki/cli/labels{/name}","releases_url":"https://api.github.com/repos/silvin-lubecki/cli/releases{/id}","deployments_url":"https://api.github.com/repos/silvin-lubecki/cli/deployments","created_at":"2017-10-23T09:03:56Z","updated_at":"2018-07-31T23:49:18Z","pushed_at":"2018-07-31T23:49:02Z","git_url":"git://github.com/silvin-lubecki/cli.git","ssh_url":"git@github.com:silvin-lubecki/cli.git","clone_url":"https://github.com/silvin-lubecki/cli.git","svn_url":"https://github.com/silvin-lubecki/cli","homepage":null,"size":19769,"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":1,"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","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"08f5f52cdc15ba2e2c89689ac4eec25ba3335b23","user":{"login":"docker","id":5429470,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/5429470?v=4","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":88013053,"node_id":"MDEwOlJlcG9zaXRvcnk4ODAxMzA1Mw==","name":"cli","full_name":"docker/cli","owner":{"login":"docker","id":5429470,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/5429470?v=4","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/cli","description":"The Docker CLI","fork":false,"url":"https://api.github.com/repos/docker/cli","forks_url":"https://api.github.com/repos/docker/cli/forks","keys_url":"https://api.github.com/repos/docker/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/cli/teams","hooks_url":"https://api.github.com/repos/docker/cli/hooks","issue_events_url":"https://api.github.com/repos/docker/cli/issues/events{/number}","events_url":"https://api.github.com/repos/docker/cli/events","assignees_url":"https://api.github.com/repos/docker/cli/assignees{/user}","branches_url":"https://api.github.com/repos/docker/cli/branches{/branch}","tags_url":"https://api.github.com/repos/docker/cli/tags","blobs_url":"https://api.github.com/repos/docker/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/cli/languages","stargazers_url":"https://api.github.com/repos/docker/cli/stargazers","contributors_url":"https://api.github.com/repos/docker/cli/contributors","subscribers_url":"https://api.github.com/repos/docker/cli/subscribers","subscription_url":"https://api.github.com/repos/docker/cli/subscription","commits_url":"https://api.github.com/repos/docker/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/cli/contents/{+path}","compare_url":"https://api.github.com/repos/docker/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/cli/merges","archive_url":"https://api.github.com/repos/docker/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/cli/downloads","issues_url":"https://api.github.com/repos/docker/cli/issues{/number}","pulls_url":"https://api.github.com/repos/docker/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/cli/labels{/name}","releases_url":"https://api.github.com/repos/docker/cli/releases{/id}","deployments_url":"https://api.github.com/repos/docker/cli/deployments","created_at":"2017-04-12T05:27:42Z","updated_at":"2018-08-01T06:05:59Z","pushed_at":"2018-07-31T23:54:48Z","git_url":"git://github.com/docker/cli.git","ssh_url":"git@github.com:docker/cli.git","clone_url":"https://github.com/docker/cli.git","svn_url":"https://github.com/docker/cli","homepage":null,"size":19802,"stargazers_count":758,"watchers_count":758,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":466,"mirror_url":null,"archived":false,"open_issues_count":249,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":466,"open_issues":249,"watchers":758,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/cli/pulls/1251"},"html":{"href":"https://github.com/docker/cli/pull/1251"},"issue":{"href":"https://api.github.com/repos/docker/cli/issues/1251"},"comments":{"href":"https://api.github.com/repos/docker/cli/issues/1251/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/cli/pulls/1251/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/cli/pulls/1251/commits"},"statuses":{"href":"https://api.github.com/repos/docker/cli/statuses/21cce52b3060414aa76b89d4d401ada74b178789"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"albers"}}