{"action":"created","comment":{"url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/comments/79496013","id":79496013,"diff_hunk":"@@ -0,0 +1,287 @@\n+package interactive\n+\n+import (\n+\t\"bytes\"\n+\t\"encoding/json\"\n+\t\"fmt\"\n+\t\"net/url\"\n+\t\"strings\"\n+\t\"sync\"\n+\n+\t\"github.com/Sirupsen/logrus\"\n+\tschematypes \"github.com/taskcluster/go-schematypes\"\n+\t\"github.com/taskcluster/taskcluster-worker/engines\"\n+\t\"github.com/taskcluster/taskcluster-worker/plugins\"\n+\t\"github.com/taskcluster/taskcluster-worker/runtime\"\n+\t\"github.com/taskcluster/taskcluster-worker/runtime/ioext\"\n+)\n+\n+// defaultArtifactPrefix is the default artifact prefix used if nothing is\n+// configured or given in the task definition\n+const defaultArtifactPrefix = \"private/interactive/\"\n+\n+// defaultShellToolURL is the default URL for the tool that can connect to the\n+// shell socket and display an interactive shell session.\n+const defaultShellToolURL = \"https://tools.taskcluster.net/shell/\"\n+\n+// defaultShellToolURL is the default URL for the tool that can list displays\n+// and connect to the display socket with interactive noVNC session.\n+const defaultDisplayToolURL = \"https://tools.taskcluster.net/display/\"\n+\n+type provider struct {\n+\tplugins.PluginProviderBase\n+}\n+\n+func (provider) ConfigSchema() schematypes.Schema {\n+\treturn configSchema\n+}\n+func (provider) NewPlugin(options plugins.PluginOptions) (plugins.Plugin, error) {\n+\tvar c config\n+\tif schematypes.MustMap(configSchema, options.Config, &c) != nil {\n+\t\treturn nil, engines.ErrContractViolation\n+\t}\n+\tif c.ArtifactPrefix == \"\" {\n+\t\tc.ArtifactPrefix = defaultArtifactPrefix\n+\t}\n+\tif c.ShellToolURL == \"\" {\n+\t\tc.ShellToolURL = defaultShellToolURL\n+\t}\n+\tif c.DisplayToolURL == \"\" {\n+\t\tc.DisplayToolURL = defaultDisplayToolURL\n+\t}\n+\treturn &plugin{\n+\t\tconfig: c,\n+\t\tlog:    options.Log,\n+\t}, nil\n+}\n+\n+type plugin struct {\n+\tplugins.PluginBase\n+\tconfig config\n+\tlog    *logrus.Entry\n+}\n+\n+func (p *plugin) PayloadSchema() schematypes.Object {\n+\ts := schematypes.Object{\n+\t\tMetaData: schematypes.MetaData{\n+\t\t\tTitle: \"Interactive Features\",\n+\t\t\tDescription: `Settings for interactive features, all options are optional\n+\t\t\t\tan empty object can be used to enable the interactive features with\n+\t\t\t\tdefault options.`,\n+\t\t},\n+\t\tProperties: schematypes.Properties{\n+\t\t\t\"disableDisplay\": schematypes.Boolean{},\n+\t\t\t\"disableShell\":   schematypes.Boolean{},\n+\t\t},\n+\t}\n+\tif !p.config.ForbidCustomArtifactPrefix {\n+\t\ts.Properties[\"artifactPrefix\"] = schematypes.String{\n+\t\t\tMetaData: schematypes.MetaData{\n+\t\t\t\tTitle: \"Artifact Prefix\",\n+\t\t\t\tDescription: \"Prefix for the interactive artifacts will be used to \" +\n+\t\t\t\t\t\"create `<prefix>/shell.html`, `<prefix>/display.html` and \" +\n+\t\t\t\t\t\"`<prefix>/sockets.json`. The prefix defaults to `\" +\n+\t\t\t\t\tp.config.ArtifactPrefix + \"`\",\n+\t\t\t},\n+\t\t\tPattern:       `^[\\x20-.0-\\x7e][\\x20-\\x7e]*/$`,\n+\t\t\tMaximumLength: 255,\n+\t\t}\n+\t}\n+\treturn schematypes.Object{\n+\t\tProperties: schematypes.Properties{\n+\t\t\t\"interactive\": s,\n+\t\t},\n+\t}\n+}\n+\n+func (p *plugin) NewTaskPlugin(options plugins.TaskPluginOptions) (\n+\tplugins.TaskPlugin, error,\n+) {\n+\tvar P payload\n+\tif schematypes.MustMap(p.PayloadSchema(), options.Payload, &P) != nil {","path":"plugins/interactive/interactive.go","position":101,"original_position":101,"commit_id":"bd3e3d21c09b93009d50ed109c28d11a1843b341","original_commit_id":"68430cce825225767db06d236c5a6ac318f19ce6","user":{"login":"jonasfj","id":149732,"avatar_url":"https://avatars.githubusercontent.com/u/149732?v=3","gravatar_id":"","url":"https://api.github.com/users/jonasfj","html_url":"https://github.com/jonasfj","followers_url":"https://api.github.com/users/jonasfj/followers","following_url":"https://api.github.com/users/jonasfj/following{/other_user}","gists_url":"https://api.github.com/users/jonasfj/gists{/gist_id}","starred_url":"https://api.github.com/users/jonasfj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonasfj/subscriptions","organizations_url":"https://api.github.com/users/jonasfj/orgs","repos_url":"https://api.github.com/users/jonasfj/repos","events_url":"https://api.github.com/users/jonasfj/events{/privacy}","received_events_url":"https://api.github.com/users/jonasfj/received_events","type":"User","site_admin":false},"body":"same as above, it's a constract violation.","created_at":"2016-09-19T21:42:47Z","updated_at":"2016-09-19T21:42:47Z","html_url":"https://github.com/taskcluster/taskcluster-worker/pull/110#discussion_r79496013","pull_request_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/110","_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/comments/79496013"},"html":{"href":"https://github.com/taskcluster/taskcluster-worker/pull/110#discussion_r79496013"},"pull_request":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/110"}}},"pull_request":{"url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/110","id":85481613,"html_url":"https://github.com/taskcluster/taskcluster-worker/pull/110","diff_url":"https://github.com/taskcluster/taskcluster-worker/pull/110.diff","patch_url":"https://github.com/taskcluster/taskcluster-worker/pull/110.patch","issue_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/110","number":110,"state":"open","locked":false,"title":"Interactive plugin done","user":{"login":"jonasfj","id":149732,"avatar_url":"https://avatars.githubusercontent.com/u/149732?v=3","gravatar_id":"","url":"https://api.github.com/users/jonasfj","html_url":"https://github.com/jonasfj","followers_url":"https://api.github.com/users/jonasfj/followers","following_url":"https://api.github.com/users/jonasfj/following{/other_user}","gists_url":"https://api.github.com/users/jonasfj/gists{/gist_id}","starred_url":"https://api.github.com/users/jonasfj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonasfj/subscriptions","organizations_url":"https://api.github.com/users/jonasfj/orgs","repos_url":"https://api.github.com/users/jonasfj/repos","events_url":"https://api.github.com/users/jonasfj/events{/privacy}","received_events_url":"https://api.github.com/users/jonasfj/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-15T21:13:55Z","updated_at":"2016-09-19T21:42:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"822593ff7588e36013e07fd9500166538670b751","assignee":{"login":"walac","id":611309,"avatar_url":"https://avatars.githubusercontent.com/u/611309?v=3","gravatar_id":"","url":"https://api.github.com/users/walac","html_url":"https://github.com/walac","followers_url":"https://api.github.com/users/walac/followers","following_url":"https://api.github.com/users/walac/following{/other_user}","gists_url":"https://api.github.com/users/walac/gists{/gist_id}","starred_url":"https://api.github.com/users/walac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walac/subscriptions","organizations_url":"https://api.github.com/users/walac/orgs","repos_url":"https://api.github.com/users/walac/repos","events_url":"https://api.github.com/users/walac/events{/privacy}","received_events_url":"https://api.github.com/users/walac/received_events","type":"User","site_admin":false},"assignees":[{"login":"walac","id":611309,"avatar_url":"https://avatars.githubusercontent.com/u/611309?v=3","gravatar_id":"","url":"https://api.github.com/users/walac","html_url":"https://github.com/walac","followers_url":"https://api.github.com/users/walac/followers","following_url":"https://api.github.com/users/walac/following{/other_user}","gists_url":"https://api.github.com/users/walac/gists{/gist_id}","starred_url":"https://api.github.com/users/walac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walac/subscriptions","organizations_url":"https://api.github.com/users/walac/orgs","repos_url":"https://api.github.com/users/walac/repos","events_url":"https://api.github.com/users/walac/events{/privacy}","received_events_url":"https://api.github.com/users/walac/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/110/commits","review_comments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/110/comments","review_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/110/comments","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/statuses/bd3e3d21c09b93009d50ed109c28d11a1843b341","head":{"label":"taskcluster:interactive","ref":"interactive","sha":"bd3e3d21c09b93009d50ed109c28d11a1843b341","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":43515791,"name":"taskcluster-worker","full_name":"taskcluster/taskcluster-worker","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/taskcluster-worker","description":"Primary worker for TaskCluster","fork":false,"url":"https://api.github.com/repos/taskcluster/taskcluster-worker","forks_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/forks","keys_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/teams","hooks_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/events","assignees_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/tags","blobs_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/languages","stargazers_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/subscription","commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/merges","archive_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/downloads","issues_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/releases{/id}","deployments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/deployments","created_at":"2015-10-01T19:15:39Z","updated_at":"2016-03-02T00:08:50Z","pushed_at":"2016-09-16T21:29:44Z","git_url":"git://github.com/taskcluster/taskcluster-worker.git","ssh_url":"git@github.com:taskcluster/taskcluster-worker.git","clone_url":"https://github.com/taskcluster/taskcluster-worker.git","svn_url":"https://github.com/taskcluster/taskcluster-worker","homepage":"https://godoc.org/github.com/taskcluster/taskcluster-worker","size":87485,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":5,"default_branch":"master"}},"base":{"label":"taskcluster:master","ref":"master","sha":"1790416d60e37de03579968e5ec83bc7b5a88ae9","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":43515791,"name":"taskcluster-worker","full_name":"taskcluster/taskcluster-worker","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/taskcluster-worker","description":"Primary worker for TaskCluster","fork":false,"url":"https://api.github.com/repos/taskcluster/taskcluster-worker","forks_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/forks","keys_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/teams","hooks_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/events","assignees_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/tags","blobs_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/languages","stargazers_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/subscription","commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/merges","archive_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/downloads","issues_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/releases{/id}","deployments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/deployments","created_at":"2015-10-01T19:15:39Z","updated_at":"2016-03-02T00:08:50Z","pushed_at":"2016-09-16T21:29:44Z","git_url":"git://github.com/taskcluster/taskcluster-worker.git","ssh_url":"git@github.com:taskcluster/taskcluster-worker.git","clone_url":"https://github.com/taskcluster/taskcluster-worker.git","svn_url":"https://github.com/taskcluster/taskcluster-worker","homepage":"https://godoc.org/github.com/taskcluster/taskcluster-worker","size":87485,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/110"},"html":{"href":"https://github.com/taskcluster/taskcluster-worker/pull/110"},"issue":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/110"},"comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/statuses/bd3e3d21c09b93009d50ed109c28d11a1843b341"}}}}
{"actor":{"display_login":"jonasfj"}}