{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/normandy-addon/pulls/comments/74280708","id":74280708,"diff_hunk":"@@ -0,0 +1,77 @@\n+const {Cu} = require('chrome');\n+Cu.importGlobalProperties(['crypto', 'TextEncoder']);\n+\n+const {Log} = require('./Log.js');\n+\n+/**\n+ * Map from the range [0, 1] to [0, max(sha256)].\n+ * @param  {number} frac A float from 0.0 to 1.0.\n+ * @return {string} A string in the sha256 hash space. Will be zero padded to 64\n+ *   characters.\n+ */\n+function fractionToKey(frac) {\n+    // SHA 256 hashes are 64-digit hexadecimal numbers. The largest possible SHA\n+    // 256 hash is 2^256 - 1.","path":"lib/stableSample.js","position":14,"original_position":14,"commit_id":"0ee00b456c85e1b2cb1111e068c298dbf7eed88a","original_commit_id":"0ee00b456c85e1b2cb1111e068c298dbf7eed88a","user":{"login":"mythmon","id":305049,"avatar_url":"https://avatars.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false},"body":"I realize now this was copy/pasted from the one in self-repair. Sorry about that. We should fix it in both places.","created_at":"2016-08-10T16:35:36Z","updated_at":"2016-08-10T16:35:36Z","html_url":"https://github.com/mozilla/normandy-addon/pull/10#discussion_r74280708","pull_request_url":"https://api.github.com/repos/mozilla/normandy-addon/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/mozilla/normandy-addon/pulls/comments/74280708"},"html":{"href":"https://github.com/mozilla/normandy-addon/pull/10#discussion_r74280708"},"pull_request":{"href":"https://api.github.com/repos/mozilla/normandy-addon/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/normandy-addon/pulls/10","id":80791418,"html_url":"https://github.com/mozilla/normandy-addon/pull/10","diff_url":"https://github.com/mozilla/normandy-addon/pull/10.diff","patch_url":"https://github.com/mozilla/normandy-addon/pull/10.patch","issue_url":"https://api.github.com/repos/mozilla/normandy-addon/issues/10","number":10,"state":"open","locked":false,"title":"Add stable sampling to jexl filtering","user":{"login":"brittanystoroz","id":856935,"avatar_url":"https://avatars.githubusercontent.com/u/856935?v=3","gravatar_id":"","url":"https://api.github.com/users/brittanystoroz","html_url":"https://github.com/brittanystoroz","followers_url":"https://api.github.com/users/brittanystoroz/followers","following_url":"https://api.github.com/users/brittanystoroz/following{/other_user}","gists_url":"https://api.github.com/users/brittanystoroz/gists{/gist_id}","starred_url":"https://api.github.com/users/brittanystoroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brittanystoroz/subscriptions","organizations_url":"https://api.github.com/users/brittanystoroz/orgs","repos_url":"https://api.github.com/users/brittanystoroz/repos","events_url":"https://api.github.com/users/brittanystoroz/events{/privacy}","received_events_url":"https://api.github.com/users/brittanystoroz/received_events","type":"User","site_admin":false},"body":"Just having trouble with the dependencies here. Using `sha.js`, I initially had problems where the addon couldn't find the `inherits` module that it required. I whitelisted the `inherits` module in `.jpmignore` which solved that problem. \r\n\r\nBut then I got an error about not being able to find the `util` dependency that was required in `inherits`. It didn't get installed automatically with `npm install`, so I tried doing an `npm install --save util` and whitelisting it in `.jpmignore` but that didn't work.\r\n\r\nI (temporarily and hackily) worked around needing `util` by editing `sha.js/sha256.js` to require `inherits/inherits_browser` instead, which got me a little further.\r\n\r\nMy next error was `Buffer is not defined`, when trying to check the filter expression. Buffer is a required dependency of `sha.js`. I also tried whitelisting this dependency in `.jpmignore` but with no success.","created_at":"2016-08-10T13:13:16Z","updated_at":"2016-08-10T16:35:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdb06926a6415ef069421106f7a6951c10288406","assignee":{"login":"mythmon","id":305049,"avatar_url":"https://avatars.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false},"assignees":[{"login":"mythmon","id":305049,"avatar_url":"https://avatars.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/normandy-addon/pulls/10/commits","review_comments_url":"https://api.github.com/repos/mozilla/normandy-addon/pulls/10/comments","review_comment_url":"https://api.github.com/repos/mozilla/normandy-addon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/normandy-addon/issues/10/comments","statuses_url":"https://api.github.com/repos/mozilla/normandy-addon/statuses/0ee00b456c85e1b2cb1111e068c298dbf7eed88a","head":{"label":"brittanystoroz:stable-sampling","ref":"stable-sampling","sha":"0ee00b456c85e1b2cb1111e068c298dbf7eed88a","user":{"login":"brittanystoroz","id":856935,"avatar_url":"https://avatars.githubusercontent.com/u/856935?v=3","gravatar_id":"","url":"https://api.github.com/users/brittanystoroz","html_url":"https://github.com/brittanystoroz","followers_url":"https://api.github.com/users/brittanystoroz/followers","following_url":"https://api.github.com/users/brittanystoroz/following{/other_user}","gists_url":"https://api.github.com/users/brittanystoroz/gists{/gist_id}","starred_url":"https://api.github.com/users/brittanystoroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brittanystoroz/subscriptions","organizations_url":"https://api.github.com/users/brittanystoroz/orgs","repos_url":"https://api.github.com/users/brittanystoroz/repos","events_url":"https://api.github.com/users/brittanystoroz/events{/privacy}","received_events_url":"https://api.github.com/users/brittanystoroz/received_events","type":"User","site_admin":false},"repo":{"id":65383219,"name":"normandy-addon","full_name":"brittanystoroz/normandy-addon","owner":{"login":"brittanystoroz","id":856935,"avatar_url":"https://avatars.githubusercontent.com/u/856935?v=3","gravatar_id":"","url":"https://api.github.com/users/brittanystoroz","html_url":"https://github.com/brittanystoroz","followers_url":"https://api.github.com/users/brittanystoroz/followers","following_url":"https://api.github.com/users/brittanystoroz/following{/other_user}","gists_url":"https://api.github.com/users/brittanystoroz/gists{/gist_id}","starred_url":"https://api.github.com/users/brittanystoroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brittanystoroz/subscriptions","organizations_url":"https://api.github.com/users/brittanystoroz/orgs","repos_url":"https://api.github.com/users/brittanystoroz/repos","events_url":"https://api.github.com/users/brittanystoroz/events{/privacy}","received_events_url":"https://api.github.com/users/brittanystoroz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brittanystoroz/normandy-addon","description":"Firefox addon to communicate with Normandy server","fork":true,"url":"https://api.github.com/repos/brittanystoroz/normandy-addon","forks_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/forks","keys_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/teams","hooks_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/hooks","issue_events_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/issues/events{/number}","events_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/events","assignees_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/assignees{/user}","branches_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/branches{/branch}","tags_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/tags","blobs_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/git/refs{/sha}","trees_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/statuses/{sha}","languages_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/languages","stargazers_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/stargazers","contributors_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/contributors","subscribers_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/subscribers","subscription_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/subscription","commits_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/commits{/sha}","git_commits_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/git/commits{/sha}","comments_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/comments{/number}","issue_comment_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/issues/comments{/number}","contents_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/contents/{+path}","compare_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/merges","archive_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/downloads","issues_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/issues{/number}","pulls_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/pulls{/number}","milestones_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/milestones{/number}","notifications_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/labels{/name}","releases_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/releases{/id}","deployments_url":"https://api.github.com/repos/brittanystoroz/normandy-addon/deployments","created_at":"2016-08-10T13:06:09Z","updated_at":"2016-08-10T13:06:10Z","pushed_at":"2016-08-10T15:46:28Z","git_url":"git://github.com/brittanystoroz/normandy-addon.git","ssh_url":"git@github.com:brittanystoroz/normandy-addon.git","clone_url":"https://github.com/brittanystoroz/normandy-addon.git","svn_url":"https://github.com/brittanystoroz/normandy-addon","homepage":"","size":117,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"ce1c8ea150462a7147487bc85ffe212ebf509f33","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":49679971,"name":"normandy-addon","full_name":"mozilla/normandy-addon","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/normandy-addon","description":"Firefox addon to communicate with Normandy server","fork":false,"url":"https://api.github.com/repos/mozilla/normandy-addon","forks_url":"https://api.github.com/repos/mozilla/normandy-addon/forks","keys_url":"https://api.github.com/repos/mozilla/normandy-addon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/normandy-addon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/normandy-addon/teams","hooks_url":"https://api.github.com/repos/mozilla/normandy-addon/hooks","issue_events_url":"https://api.github.com/repos/mozilla/normandy-addon/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/normandy-addon/events","assignees_url":"https://api.github.com/repos/mozilla/normandy-addon/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/normandy-addon/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/normandy-addon/tags","blobs_url":"https://api.github.com/repos/mozilla/normandy-addon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/normandy-addon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/normandy-addon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/normandy-addon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/normandy-addon/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/normandy-addon/languages","stargazers_url":"https://api.github.com/repos/mozilla/normandy-addon/stargazers","contributors_url":"https://api.github.com/repos/mozilla/normandy-addon/contributors","subscribers_url":"https://api.github.com/repos/mozilla/normandy-addon/subscribers","subscription_url":"https://api.github.com/repos/mozilla/normandy-addon/subscription","commits_url":"https://api.github.com/repos/mozilla/normandy-addon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/normandy-addon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/normandy-addon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/normandy-addon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/normandy-addon/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/normandy-addon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/normandy-addon/merges","archive_url":"https://api.github.com/repos/mozilla/normandy-addon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/normandy-addon/downloads","issues_url":"https://api.github.com/repos/mozilla/normandy-addon/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/normandy-addon/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/normandy-addon/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/normandy-addon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/normandy-addon/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/normandy-addon/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/normandy-addon/deployments","created_at":"2016-01-14T22:39:05Z","updated_at":"2016-02-16T22:53:29Z","pushed_at":"2016-08-10T15:46:28Z","git_url":"git://github.com/mozilla/normandy-addon.git","ssh_url":"git@github.com:mozilla/normandy-addon.git","clone_url":"https://github.com/mozilla/normandy-addon.git","svn_url":"https://github.com/mozilla/normandy-addon","homepage":"","size":118,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/normandy-addon/pulls/10"},"html":{"href":"https://github.com/mozilla/normandy-addon/pull/10"},"issue":{"href":"https://api.github.com/repos/mozilla/normandy-addon/issues/10"},"comments":{"href":"https://api.github.com/repos/mozilla/normandy-addon/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/normandy-addon/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/normandy-addon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/normandy-addon/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/normandy-addon/statuses/0ee00b456c85e1b2cb1111e068c298dbf7eed88a"}}}}
{"actor":{"display_login":"mythmon"}}