{"action":"created","comment":{"url":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/comments/222389571","pull_request_review_id":161264963,"id":222389571,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjM4OTU3MQ==","diff_hunk":"@@ -1,51 +1,46 @@\n 'use strict';\n \n const cp = require('child_process');\n-const crypto = require('crypto');\n \n const CONTAINER = 'devsnek/js-eval';\n \n+class Output {\n+  constructor(stdout, err) {\n+    this.stdout = stdout;\n+    if (err) {\n+      this.killed = err.killed;\n+      this.code = err.code;\n+      this.signal = err.signal;\n+    }\n+  }\n+  toString() {\n+    return this.stdout;\n+  }\n+}\n+\n module.exports = (code, { environment = 'node-cjs', timeout, cpus, memory, net = 'none' } = {}) =>\n   new Promise((resolve, reject) => {\n-    const name = `jseval-${crypto.randomBytes(8).toString('hex')}`;","path":"index.js","position":24,"original_position":24,"commit_id":"04d3ce126ae9b55f34f97c5a79a96761fb02d726","original_commit_id":"04d3ce126ae9b55f34f97c5a79a96761fb02d726","user":{"login":"caub","id":3134574,"node_id":"MDQ6VXNlcjMxMzQ1NzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3134574?v=4","gravatar_id":"","url":"https://api.github.com/users/caub","html_url":"https://github.com/caub","followers_url":"https://api.github.com/users/caub/followers","following_url":"https://api.github.com/users/caub/following{/other_user}","gists_url":"https://api.github.com/users/caub/gists{/gist_id}","starred_url":"https://api.github.com/users/caub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caub/subscriptions","organizations_url":"https://api.github.com/users/caub/orgs","repos_url":"https://api.github.com/users/caub/repos","events_url":"https://api.github.com/users/caub/events{/privacy}","received_events_url":"https://api.github.com/users/caub/received_events","type":"User","site_admin":false},"body":"yea, but deleting all of them is easy with `docker rm $(docker ps -qf label=jseval)`. It'd also work by name prefix `docker rm $(docker ps -qf name=jseval-)`","created_at":"2018-10-03T17:02:12Z","updated_at":"2018-10-03T17:02:12Z","html_url":"https://github.com/devsnek/docker-js-eval/pull/6#discussion_r222389571","pull_request_url":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/6","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/comments/222389571"},"html":{"href":"https://github.com/devsnek/docker-js-eval/pull/6#discussion_r222389571"},"pull_request":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/6"}},"in_reply_to_id":222389185},"pull_request":{"url":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/6","id":219136953,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MTM2OTUz","html_url":"https://github.com/devsnek/docker-js-eval/pull/6","diff_url":"https://github.com/devsnek/docker-js-eval/pull/6.diff","patch_url":"https://github.com/devsnek/docker-js-eval/pull/6.patch","issue_url":"https://api.github.com/repos/devsnek/docker-js-eval/issues/6","number":6,"state":"open","locked":false,"title":"fix and test timeouts","user":{"login":"caub","id":3134574,"node_id":"MDQ6VXNlcjMxMzQ1NzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3134574?v=4","gravatar_id":"","url":"https://api.github.com/users/caub","html_url":"https://github.com/caub","followers_url":"https://api.github.com/users/caub/followers","following_url":"https://api.github.com/users/caub/following{/other_user}","gists_url":"https://api.github.com/users/caub/gists{/gist_id}","starred_url":"https://api.github.com/users/caub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caub/subscriptions","organizations_url":"https://api.github.com/users/caub/orgs","repos_url":"https://api.github.com/users/caub/repos","events_url":"https://api.github.com/users/caub/events{/privacy}","received_events_url":"https://api.github.com/users/caub/received_events","type":"User","site_admin":false},"body":"Originally I was looking if the formatting issue came from here, but it doesn't (more in jellobot)\r\n\r\nBut I think it'll be better to reuse index.js in jellobot, and added tests to make sure timeout work as expected\r\n\r\nWhat's fun is the vm.Script timeout doesn\"t work for setTimeout:\r\n\r\n```js\r\nconst run = require('./run');\r\nrun('setTimeout(console.log, 1000, 2); 1;', 'node-cjs', 10).then(console.log, console.error); // 1 2\r\nrun('for (var i=0;i<1e5;i++) crypto.randomBytes(8)', 'node-cjs', 10).then(console.log, console.error) // BOOM\r\n```\r\n\r\nAlso I changed the input format, instead of giving a json, it's only the code (most important thing here), env `JSEVAL_ENV` and timeout `JSEVAL_TIMEOUT` can be passed as environment variable (because more practical with docker)","created_at":"2018-09-29T09:16:18Z","updated_at":"2018-10-03T17:02:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d75bcdc7e2f1eab6849a4b8c2034e8109d9ee39","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/6/commits","review_comments_url":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/6/comments","review_comment_url":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/comments{/number}","comments_url":"https://api.github.com/repos/devsnek/docker-js-eval/issues/6/comments","statuses_url":"https://api.github.com/repos/devsnek/docker-js-eval/statuses/04d3ce126ae9b55f34f97c5a79a96761fb02d726","head":{"label":"caub:fix-timeout","ref":"fix-timeout","sha":"04d3ce126ae9b55f34f97c5a79a96761fb02d726","user":{"login":"caub","id":3134574,"node_id":"MDQ6VXNlcjMxMzQ1NzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3134574?v=4","gravatar_id":"","url":"https://api.github.com/users/caub","html_url":"https://github.com/caub","followers_url":"https://api.github.com/users/caub/followers","following_url":"https://api.github.com/users/caub/following{/other_user}","gists_url":"https://api.github.com/users/caub/gists{/gist_id}","starred_url":"https://api.github.com/users/caub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caub/subscriptions","organizations_url":"https://api.github.com/users/caub/orgs","repos_url":"https://api.github.com/users/caub/repos","events_url":"https://api.github.com/users/caub/events{/privacy}","received_events_url":"https://api.github.com/users/caub/received_events","type":"User","site_admin":false},"repo":{"id":150846882,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA4NDY4ODI=","name":"docker-js-eval","full_name":"caub/docker-js-eval","private":false,"owner":{"login":"caub","id":3134574,"node_id":"MDQ6VXNlcjMxMzQ1NzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3134574?v=4","gravatar_id":"","url":"https://api.github.com/users/caub","html_url":"https://github.com/caub","followers_url":"https://api.github.com/users/caub/followers","following_url":"https://api.github.com/users/caub/following{/other_user}","gists_url":"https://api.github.com/users/caub/gists{/gist_id}","starred_url":"https://api.github.com/users/caub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caub/subscriptions","organizations_url":"https://api.github.com/users/caub/orgs","repos_url":"https://api.github.com/users/caub/repos","events_url":"https://api.github.com/users/caub/events{/privacy}","received_events_url":"https://api.github.com/users/caub/received_events","type":"User","site_admin":false},"html_url":"https://github.com/caub/docker-js-eval","description":null,"fork":true,"url":"https://api.github.com/repos/caub/docker-js-eval","forks_url":"https://api.github.com/repos/caub/docker-js-eval/forks","keys_url":"https://api.github.com/repos/caub/docker-js-eval/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caub/docker-js-eval/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caub/docker-js-eval/teams","hooks_url":"https://api.github.com/repos/caub/docker-js-eval/hooks","issue_events_url":"https://api.github.com/repos/caub/docker-js-eval/issues/events{/number}","events_url":"https://api.github.com/repos/caub/docker-js-eval/events","assignees_url":"https://api.github.com/repos/caub/docker-js-eval/assignees{/user}","branches_url":"https://api.github.com/repos/caub/docker-js-eval/branches{/branch}","tags_url":"https://api.github.com/repos/caub/docker-js-eval/tags","blobs_url":"https://api.github.com/repos/caub/docker-js-eval/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caub/docker-js-eval/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caub/docker-js-eval/git/refs{/sha}","trees_url":"https://api.github.com/repos/caub/docker-js-eval/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caub/docker-js-eval/statuses/{sha}","languages_url":"https://api.github.com/repos/caub/docker-js-eval/languages","stargazers_url":"https://api.github.com/repos/caub/docker-js-eval/stargazers","contributors_url":"https://api.github.com/repos/caub/docker-js-eval/contributors","subscribers_url":"https://api.github.com/repos/caub/docker-js-eval/subscribers","subscription_url":"https://api.github.com/repos/caub/docker-js-eval/subscription","commits_url":"https://api.github.com/repos/caub/docker-js-eval/commits{/sha}","git_commits_url":"https://api.github.com/repos/caub/docker-js-eval/git/commits{/sha}","comments_url":"https://api.github.com/repos/caub/docker-js-eval/comments{/number}","issue_comment_url":"https://api.github.com/repos/caub/docker-js-eval/issues/comments{/number}","contents_url":"https://api.github.com/repos/caub/docker-js-eval/contents/{+path}","compare_url":"https://api.github.com/repos/caub/docker-js-eval/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caub/docker-js-eval/merges","archive_url":"https://api.github.com/repos/caub/docker-js-eval/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caub/docker-js-eval/downloads","issues_url":"https://api.github.com/repos/caub/docker-js-eval/issues{/number}","pulls_url":"https://api.github.com/repos/caub/docker-js-eval/pulls{/number}","milestones_url":"https://api.github.com/repos/caub/docker-js-eval/milestones{/number}","notifications_url":"https://api.github.com/repos/caub/docker-js-eval/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caub/docker-js-eval/labels{/name}","releases_url":"https://api.github.com/repos/caub/docker-js-eval/releases{/id}","deployments_url":"https://api.github.com/repos/caub/docker-js-eval/deployments","created_at":"2018-09-29T09:11:53Z","updated_at":"2018-09-29T09:11:55Z","pushed_at":"2018-10-01T20:26:46Z","git_url":"git://github.com/caub/docker-js-eval.git","ssh_url":"git@github.com:caub/docker-js-eval.git","clone_url":"https://github.com/caub/docker-js-eval.git","svn_url":"https://github.com/caub/docker-js-eval","homepage":null,"size":1572,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"devsnek:master","ref":"master","sha":"087930825dd91a89b8fa7be7d7562494d487729e","user":{"login":"devsnek","id":5952481,"node_id":"MDQ6VXNlcjU5NTI0ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/5952481?v=4","gravatar_id":"","url":"https://api.github.com/users/devsnek","html_url":"https://github.com/devsnek","followers_url":"https://api.github.com/users/devsnek/followers","following_url":"https://api.github.com/users/devsnek/following{/other_user}","gists_url":"https://api.github.com/users/devsnek/gists{/gist_id}","starred_url":"https://api.github.com/users/devsnek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devsnek/subscriptions","organizations_url":"https://api.github.com/users/devsnek/orgs","repos_url":"https://api.github.com/users/devsnek/repos","events_url":"https://api.github.com/users/devsnek/events{/privacy}","received_events_url":"https://api.github.com/users/devsnek/received_events","type":"User","site_admin":false},"repo":{"id":130795233,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA3OTUyMzM=","name":"docker-js-eval","full_name":"devsnek/docker-js-eval","private":false,"owner":{"login":"devsnek","id":5952481,"node_id":"MDQ6VXNlcjU5NTI0ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/5952481?v=4","gravatar_id":"","url":"https://api.github.com/users/devsnek","html_url":"https://github.com/devsnek","followers_url":"https://api.github.com/users/devsnek/followers","following_url":"https://api.github.com/users/devsnek/following{/other_user}","gists_url":"https://api.github.com/users/devsnek/gists{/gist_id}","starred_url":"https://api.github.com/users/devsnek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devsnek/subscriptions","organizations_url":"https://api.github.com/users/devsnek/orgs","repos_url":"https://api.github.com/users/devsnek/repos","events_url":"https://api.github.com/users/devsnek/events{/privacy}","received_events_url":"https://api.github.com/users/devsnek/received_events","type":"User","site_admin":false},"html_url":"https://github.com/devsnek/docker-js-eval","description":null,"fork":true,"url":"https://api.github.com/repos/devsnek/docker-js-eval","forks_url":"https://api.github.com/repos/devsnek/docker-js-eval/forks","keys_url":"https://api.github.com/repos/devsnek/docker-js-eval/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devsnek/docker-js-eval/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devsnek/docker-js-eval/teams","hooks_url":"https://api.github.com/repos/devsnek/docker-js-eval/hooks","issue_events_url":"https://api.github.com/repos/devsnek/docker-js-eval/issues/events{/number}","events_url":"https://api.github.com/repos/devsnek/docker-js-eval/events","assignees_url":"https://api.github.com/repos/devsnek/docker-js-eval/assignees{/user}","branches_url":"https://api.github.com/repos/devsnek/docker-js-eval/branches{/branch}","tags_url":"https://api.github.com/repos/devsnek/docker-js-eval/tags","blobs_url":"https://api.github.com/repos/devsnek/docker-js-eval/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devsnek/docker-js-eval/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devsnek/docker-js-eval/git/refs{/sha}","trees_url":"https://api.github.com/repos/devsnek/docker-js-eval/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devsnek/docker-js-eval/statuses/{sha}","languages_url":"https://api.github.com/repos/devsnek/docker-js-eval/languages","stargazers_url":"https://api.github.com/repos/devsnek/docker-js-eval/stargazers","contributors_url":"https://api.github.com/repos/devsnek/docker-js-eval/contributors","subscribers_url":"https://api.github.com/repos/devsnek/docker-js-eval/subscribers","subscription_url":"https://api.github.com/repos/devsnek/docker-js-eval/subscription","commits_url":"https://api.github.com/repos/devsnek/docker-js-eval/commits{/sha}","git_commits_url":"https://api.github.com/repos/devsnek/docker-js-eval/git/commits{/sha}","comments_url":"https://api.github.com/repos/devsnek/docker-js-eval/comments{/number}","issue_comment_url":"https://api.github.com/repos/devsnek/docker-js-eval/issues/comments{/number}","contents_url":"https://api.github.com/repos/devsnek/docker-js-eval/contents/{+path}","compare_url":"https://api.github.com/repos/devsnek/docker-js-eval/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devsnek/docker-js-eval/merges","archive_url":"https://api.github.com/repos/devsnek/docker-js-eval/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devsnek/docker-js-eval/downloads","issues_url":"https://api.github.com/repos/devsnek/docker-js-eval/issues{/number}","pulls_url":"https://api.github.com/repos/devsnek/docker-js-eval/pulls{/number}","milestones_url":"https://api.github.com/repos/devsnek/docker-js-eval/milestones{/number}","notifications_url":"https://api.github.com/repos/devsnek/docker-js-eval/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devsnek/docker-js-eval/labels{/name}","releases_url":"https://api.github.com/repos/devsnek/docker-js-eval/releases{/id}","deployments_url":"https://api.github.com/repos/devsnek/docker-js-eval/deployments","created_at":"2018-04-24T04:16:24Z","updated_at":"2018-10-01T21:21:25Z","pushed_at":"2018-09-29T10:25:39Z","git_url":"git://github.com/devsnek/docker-js-eval.git","ssh_url":"git@github.com:devsnek/docker-js-eval.git","clone_url":"https://github.com/devsnek/docker-js-eval.git","svn_url":"https://github.com/devsnek/docker-js-eval","homepage":null,"size":1567,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","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":1,"license":null,"forks":1,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/6"},"html":{"href":"https://github.com/devsnek/docker-js-eval/pull/6"},"issue":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/issues/6"},"comments":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/devsnek/docker-js-eval/statuses/04d3ce126ae9b55f34f97c5a79a96761fb02d726"}},"author_association":"NONE"}}
{"actor":{"display_login":"caub"}}