{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/platform-status/pulls/comments/58567643","id":58567643,"diff_hunk":"@@ -0,0 +1,298 @@\n+import redis from '../engine/redis-helper.js';\n+import webPush from 'web-push';\n+\n+const ttl = 2419200;\n+\n+if (!process.env.GCM_API_KEY) {\n+  console.warn('Set the GCM_API_KEY environment variable to support GCM');\n+}\n+webPush.setGCMAPIKey(process.env.GCM_API_KEY);\n+\n+// there is only one client (useful especially while testing)\n+let client;\n+function setClient(dbNumber) {\n+  if (client) {\n+    return Promise.resolve(client);\n+  }\n+  return redis.getClient(dbNumber)\n+  .then(redisClient => {\n+    client = redisClient;\n+    return client;\n+  });\n+}\n+\n+// eported only for test as we will not need to kill database\n+function quitClient(dbNumber) {\n+  return setClient(dbNumber)\n+  .then(() => {\n+    const p = redis.quit(client);\n+    client = null;\n+    return p;\n+  });\n+}\n+\n+// check if such device exists in database, reject if not\n+function checkDeviceId(deviceId, dbNumber) {\n+  return setClient(dbNumber)\n+  .then(() => redis.hgetall(client, `device-${deviceId}`))\n+  .then(device => {\n+    if (!device || !device.endpoint) {\n+      throw new Error('Not Found');\n+    }\n+  });\n+}\n+\n+// get all registrations for a deviceId\n+function getRegisteredFeatures(deviceId, dbNumber) {\n+  return checkDeviceId(deviceId, dbNumber)\n+  .then(() => redis.smembers(client, `${deviceId}-notifications`));\n+}\n+\n+/*\n+ * send confirmation even if deviceId is already deleted\n+ */\n+function sendConfirmation(endpoint, key, deviceId, features, dbNumber) {\n+  let payload = { title: 'Registration changed' };\n+  payload.body = 'You\\'re not registered to any feature';\n+  if (features && features.length > 0) {\n+    const numberOfFeatures = features.length;\n+    const message = 'Registered to';\n+    if (features.indexOf('all') >= 0) {\n+      payload.body = `${message} all features`;\n+    } else if (numberOfFeatures === 1) {\n+      if (features.indexOf('new') === 0) {\n+        payload.body = `${message} new features only`;\n+      } else {\n+        payload.body = `${message} one feature`;\n+      }\n+    } else {\n+      payload.body = `${message} ${numberOfFeatures} features`;\n+    }\n+  }\n+  payload = JSON.stringify(payload);\n+  return setClient(dbNumber)\n+  .then(() => {\n+    if (endpoint.indexOf('https://android.googleapis.com/gcm/send') === 0) {\n+      return redis.set(client, `${deviceId}-payload`, payload)\n+      .then(webPush.sendNotification(endpoint, ttl));\n+    }\n+    return webPush.sendNotification(endpoint, ttl, key, payload);\n+  });\n+}\n+\n+/*\n+ * send confirmation after user changed registration\n+ * deviceId might be an endpoint\n+ */\n+function sendConfirmationToDevice(deviceId, dbNumber) {\n+  return setClient(dbNumber)\n+  .then(() => checkDeviceId(deviceId, dbNumber))\n+  .then(() => redis.hgetall(client, `device-${deviceId}`))\n+  .then(device =>\n+    getRegisteredFeatures(deviceId, dbNumber)\n+    .then(features => sendConfirmation(device.endpoint, device.key, deviceId, features, dbNumber))\n+  );\n+}\n+\n+function unregisterDevice(deviceId) {\n+  return redis.del(client, `device-${deviceId}`)\n+  .then(() => redis.smembers(client, `${deviceId}-notifications`))\n+  .then(deviceFeatures => Promise.all(\n+        deviceFeatures.map(slug => redis.srem(client, `${slug}-notifications`, deviceId))\n+  ))\n+  .then(() => redis.del(client, `${deviceId}-notifications`));\n+}\n+\n+// unregisters from receiving notifications\n+// required:\n+// * deviceId\n+// optional\n+// * features\n+// if no features provided unregister from all features and delete\n+// endpoint entry\n+function unregister(deviceId, features, dbNumber, doNotConfirm) {\n+  let endpoint;\n+  let key;\n+  return checkDeviceId(deviceId, dbNumber)\n+  .then(() => redis.hgetall(client, `device-${deviceId}`))\n+  .then(device => {\n+    endpoint = device.endpoint;\n+    key = device.key;\n+  })\n+  .then(() => {\n+    if (!features) {\n+      return unregisterDevice(deviceId);\n+    }\n+    return redis.sismember(client, `${deviceId}-notifications`, 'all')\n+    .then(registeredToAll => {\n+      if (!registeredToAll) {\n+        return Promise.all(features.map(slug => [\n+          redis.srem(client, `${slug}-notifications`, deviceId),\n+          redis.srem(client, `${deviceId}-notifications`, slug)])\n+        );\n+      }\n+      // user decided to unregister from `all`\n+      if (features.indexOf('all') >= 0) {\n+        return redis.srem(client, 'all-notifications', deviceId)\n+        .then(() => redis.srem(client, `${deviceId}-notifications`, 'all'));\n+      }\n+      // unregister from `all` and register to negative of `features`\n+      return redis.srem(client, 'all-notifications', deviceId)\n+      .then(() => redis.srem(client, `${deviceId}-notifications`, 'all'))\n+      // register to everything except of features\n+      .then(() => redis.get(client, 'status'))\n+      .then(status => {\n+        let allFeatures = ['new'];\n+        allFeatures = allFeatures.concat(Object.keys(JSON.parse(status)));\n+        return Promise.all(allFeatures.map(slug => {\n+          if (features.indexOf(slug) >= 0) {\n+            return Promise.resolve();\n+          }\n+          return redis.sadd(client, `${deviceId}-notifications`, slug)\n+          .then(() => redis.sadd(client, `${slug}-notifications`, deviceId));\n+        }));\n+      });\n+    });\n+  })\n+  .then(() => getRegisteredFeatures(deviceId, dbNumber))\n+  .catch(err => {\n+    if (err.message !== 'Not Found') {\n+      throw err;\n+    }\n+    return [];\n+  })\n+  .then(regFeatures => {\n+    if (!doNotConfirm && endpoint) {\n+      return sendConfirmation(endpoint, key, deviceId, regFeatures, dbNumber)\n+      .then(() => regFeatures);\n+    }\n+    return regFeatures;\n+  });\n+}\n+\n+// Registers to all notifications including new ones\n+// Removes registrations to individual features\n+function registerToAll(deviceId, dbNumber) {\n+  return getRegisteredFeatures(deviceId, dbNumber)\n+  .then(features => unregister(deviceId, features, dbNumber, true))\n+  .then(() => Promise.all([\n+    redis.sadd(client, 'all-notifications', deviceId),\n+    redis.sadd(client, `${deviceId}-notifications`, 'all')]));\n+}\n+\n+// registers to receive notifications\n+// required info:\n+// * deviceId\n+// * list of feature slugs to register to\n+//   special features are `new` and `all`\n+//   * new - do notify about new features\n+//   * all - all features including new, registering to all will remove\n+//     all individual registrations\n+// * endpoint [optional]\n+// one can register to a feature without providing an endpoint\n+// if it was already saved:\n+// * key\n+// * dbNumber\n+function register(deviceId, features, endpoint, key, dbNumber) {\n+  if (!features || features.length === 0) {\n+    return Promise.reject(new Error('No features provided'));\n+  }\n+\n+  return setClient(dbNumber)\n+  .then(() => {\n+    if (endpoint) {\n+      const device = {\n+        id: deviceId,\n+        endpoint,\n+        key: key || '',\n+      };\n+      redis.hmset(client, `device-${deviceId}`, device);\n+      return device;\n+    }\n+    return redis.hgetall(client, `device-${deviceId}`);\n+  })\n+  .then(device => {\n+    if (!device || !device.endpoint) {\n+      throw new Error('No endpoint provided');\n+    }\n+  })\n+  .then(() => {\n+    if (features.indexOf('all') >= 0) {\n+      return registerToAll(deviceId, dbNumber);\n+    }\n+    return Promise.all(\n+      features.map(slug => [\n+        redis.sadd(client, `${slug}-notifications`, deviceId),\n+        redis.sadd(client, `${deviceId}-notifications`, slug)]));\n+  })\n+  .then(() => sendConfirmationToDevice(deviceId, dbNumber))\n+  .then(() => getRegisteredFeatures(deviceId, dbNumber));\n+}\n+\n+// update endpoint for the device\n+// required:\n+// * machineId\n+// * endpoint\n+function updateEndpoint(deviceId, endpoint, key, dbNumber) {\n+  if (!endpoint) {\n+    return Promise.reject(new Error('No endpoint provided'));\n+  }\n+  return checkDeviceId(deviceId, dbNumber)\n+  .then(() => redis.hmset(client, `device-${deviceId}`, 'endpoint', endpoint, 'key', key));\n+}\n+\n+function sendNotifications(feature, payload, isNew, dbNumber) {\n+  // make payload a string\n+  if (payload && Object.keys(payload).length > 0) {\n+    payload = JSON.stringify(payload);\n+  }\n+  return setClient(dbNumber)\n+  .then(() => redis.smembers(client, `${feature}-notifications`))\n+  .then(devices => redis.smembers(client, 'all-notifications')\n+    .then(all => devices.concat(all)))\n+  .then(devices => {\n+    if (isNew) {\n+      return redis.smembers(client, 'new-notifications')\n+      .then(fresh => devices.concat(fresh));\n+    }\n+    return devices;\n+  })\n+  .then(devices => Promise.all(\n+        devices.map(deviceId => redis.hgetall(client, `device-${deviceId}`))))\n+  .then(devices => Promise.all(\n+      devices.map(device => {\n+        if (device.endpoint.indexOf('https://android.googleapis.com/gcm/send') === 0) {","path":"engine/notifications.js","position":264,"original_position":264,"commit_id":"36b2bb417a2c49c7d899f1bd6609cb45c6c1d199","original_commit_id":"36b2bb417a2c49c7d899f1bd6609cb45c6c1d199","user":{"login":"marco-c","id":1616846,"avatar_url":"https://avatars.githubusercontent.com/u/1616846?v=3","gravatar_id":"","url":"https://api.github.com/users/marco-c","html_url":"https://github.com/marco-c","followers_url":"https://api.github.com/users/marco-c/followers","following_url":"https://api.github.com/users/marco-c/following{/other_user}","gists_url":"https://api.github.com/users/marco-c/gists{/gist_id}","starred_url":"https://api.github.com/users/marco-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marco-c/subscriptions","organizations_url":"https://api.github.com/users/marco-c/orgs","repos_url":"https://api.github.com/users/marco-c/repos","events_url":"https://api.github.com/users/marco-c/events{/privacy}","received_events_url":"https://api.github.com/users/marco-c/received_events","type":"User","site_admin":false},"body":"Here the same as https://github.com/mozilla/platform-status/pull/317/files#r58556703.","created_at":"2016-04-05T16:13:25Z","updated_at":"2016-04-05T16:13:25Z","html_url":"https://github.com/mozilla/platform-status/pull/317#discussion_r58567643","pull_request_url":"https://api.github.com/repos/mozilla/platform-status/pulls/317","_links":{"self":{"href":"https://api.github.com/repos/mozilla/platform-status/pulls/comments/58567643"},"html":{"href":"https://github.com/mozilla/platform-status/pull/317#discussion_r58567643"},"pull_request":{"href":"https://api.github.com/repos/mozilla/platform-status/pulls/317"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/platform-status/pulls/317","id":59057144,"html_url":"https://github.com/mozilla/platform-status/pull/317","diff_url":"https://github.com/mozilla/platform-status/pull/317.diff","patch_url":"https://github.com/mozilla/platform-status/pull/317.patch","issue_url":"https://api.github.com/repos/mozilla/platform-status/issues/317","number":317,"state":"open","locked":false,"title":"Notifications - first stage","user":{"login":"zalun","id":97885,"avatar_url":"https://avatars.githubusercontent.com/u/97885?v=3","gravatar_id":"","url":"https://api.github.com/users/zalun","html_url":"https://github.com/zalun","followers_url":"https://api.github.com/users/zalun/followers","following_url":"https://api.github.com/users/zalun/following{/other_user}","gists_url":"https://api.github.com/users/zalun/gists{/gist_id}","starred_url":"https://api.github.com/users/zalun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalun/subscriptions","organizations_url":"https://api.github.com/users/zalun/orgs","repos_url":"https://api.github.com/users/zalun/repos","events_url":"https://api.github.com/users/zalun/events{/privacy}","received_events_url":"https://api.github.com/users/zalun/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-11T16:35:58Z","updated_at":"2016-04-05T16:13:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6790971b115f579ff7797c7f556cc3ffaf60c9e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/platform-status/pulls/317/commits","review_comments_url":"https://api.github.com/repos/mozilla/platform-status/pulls/317/comments","review_comment_url":"https://api.github.com/repos/mozilla/platform-status/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/platform-status/issues/317/comments","statuses_url":"https://api.github.com/repos/mozilla/platform-status/statuses/36b2bb417a2c49c7d899f1bd6609cb45c6c1d199","head":{"label":"zalun:notifications","ref":"notifications","sha":"36b2bb417a2c49c7d899f1bd6609cb45c6c1d199","user":{"login":"zalun","id":97885,"avatar_url":"https://avatars.githubusercontent.com/u/97885?v=3","gravatar_id":"","url":"https://api.github.com/users/zalun","html_url":"https://github.com/zalun","followers_url":"https://api.github.com/users/zalun/followers","following_url":"https://api.github.com/users/zalun/following{/other_user}","gists_url":"https://api.github.com/users/zalun/gists{/gist_id}","starred_url":"https://api.github.com/users/zalun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalun/subscriptions","organizations_url":"https://api.github.com/users/zalun/orgs","repos_url":"https://api.github.com/users/zalun/repos","events_url":"https://api.github.com/users/zalun/events{/privacy}","received_events_url":"https://api.github.com/users/zalun/received_events","type":"User","site_admin":false},"repo":{"id":44379964,"name":"platatus","full_name":"zalun/platatus","owner":{"login":"zalun","id":97885,"avatar_url":"https://avatars.githubusercontent.com/u/97885?v=3","gravatar_id":"","url":"https://api.github.com/users/zalun","html_url":"https://github.com/zalun","followers_url":"https://api.github.com/users/zalun/followers","following_url":"https://api.github.com/users/zalun/following{/other_user}","gists_url":"https://api.github.com/users/zalun/gists{/gist_id}","starred_url":"https://api.github.com/users/zalun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalun/subscriptions","organizations_url":"https://api.github.com/users/zalun/orgs","repos_url":"https://api.github.com/users/zalun/repos","events_url":"https://api.github.com/users/zalun/events{/privacy}","received_events_url":"https://api.github.com/users/zalun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zalun/platatus","description":"Project Platform Status","fork":true,"url":"https://api.github.com/repos/zalun/platatus","forks_url":"https://api.github.com/repos/zalun/platatus/forks","keys_url":"https://api.github.com/repos/zalun/platatus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalun/platatus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalun/platatus/teams","hooks_url":"https://api.github.com/repos/zalun/platatus/hooks","issue_events_url":"https://api.github.com/repos/zalun/platatus/issues/events{/number}","events_url":"https://api.github.com/repos/zalun/platatus/events","assignees_url":"https://api.github.com/repos/zalun/platatus/assignees{/user}","branches_url":"https://api.github.com/repos/zalun/platatus/branches{/branch}","tags_url":"https://api.github.com/repos/zalun/platatus/tags","blobs_url":"https://api.github.com/repos/zalun/platatus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalun/platatus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalun/platatus/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalun/platatus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalun/platatus/statuses/{sha}","languages_url":"https://api.github.com/repos/zalun/platatus/languages","stargazers_url":"https://api.github.com/repos/zalun/platatus/stargazers","contributors_url":"https://api.github.com/repos/zalun/platatus/contributors","subscribers_url":"https://api.github.com/repos/zalun/platatus/subscribers","subscription_url":"https://api.github.com/repos/zalun/platatus/subscription","commits_url":"https://api.github.com/repos/zalun/platatus/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalun/platatus/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalun/platatus/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalun/platatus/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalun/platatus/contents/{+path}","compare_url":"https://api.github.com/repos/zalun/platatus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalun/platatus/merges","archive_url":"https://api.github.com/repos/zalun/platatus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalun/platatus/downloads","issues_url":"https://api.github.com/repos/zalun/platatus/issues{/number}","pulls_url":"https://api.github.com/repos/zalun/platatus/pulls{/number}","milestones_url":"https://api.github.com/repos/zalun/platatus/milestones{/number}","notifications_url":"https://api.github.com/repos/zalun/platatus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalun/platatus/labels{/name}","releases_url":"https://api.github.com/repos/zalun/platatus/releases{/id}","deployments_url":"https://api.github.com/repos/zalun/platatus/deployments","created_at":"2015-10-16T11:07:19Z","updated_at":"2016-02-03T17:13:26Z","pushed_at":"2016-04-05T13:11:26Z","git_url":"git://github.com/zalun/platatus.git","ssh_url":"git@github.com:zalun/platatus.git","clone_url":"https://github.com/zalun/platatus.git","svn_url":"https://github.com/zalun/platatus","homepage":"https://mozilla.github.io/platatus/","size":1627,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"46ca62f6d749ad8383dac741c72ebdba8085d312","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":43447626,"name":"platform-status","full_name":"mozilla/platform-status","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/platform-status","description":"Project Platform Status","fork":false,"url":"https://api.github.com/repos/mozilla/platform-status","forks_url":"https://api.github.com/repos/mozilla/platform-status/forks","keys_url":"https://api.github.com/repos/mozilla/platform-status/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/platform-status/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/platform-status/teams","hooks_url":"https://api.github.com/repos/mozilla/platform-status/hooks","issue_events_url":"https://api.github.com/repos/mozilla/platform-status/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/platform-status/events","assignees_url":"https://api.github.com/repos/mozilla/platform-status/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/platform-status/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/platform-status/tags","blobs_url":"https://api.github.com/repos/mozilla/platform-status/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/platform-status/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/platform-status/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/platform-status/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/platform-status/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/platform-status/languages","stargazers_url":"https://api.github.com/repos/mozilla/platform-status/stargazers","contributors_url":"https://api.github.com/repos/mozilla/platform-status/contributors","subscribers_url":"https://api.github.com/repos/mozilla/platform-status/subscribers","subscription_url":"https://api.github.com/repos/mozilla/platform-status/subscription","commits_url":"https://api.github.com/repos/mozilla/platform-status/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/platform-status/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/platform-status/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/platform-status/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/platform-status/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/platform-status/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/platform-status/merges","archive_url":"https://api.github.com/repos/mozilla/platform-status/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/platform-status/downloads","issues_url":"https://api.github.com/repos/mozilla/platform-status/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/platform-status/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/platform-status/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/platform-status/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/platform-status/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/platform-status/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/platform-status/deployments","created_at":"2015-09-30T17:25:18Z","updated_at":"2016-04-04T13:14:10Z","pushed_at":"2016-04-05T14:01:44Z","git_url":"git://github.com/mozilla/platform-status.git","ssh_url":"git@github.com:mozilla/platform-status.git","clone_url":"https://github.com/mozilla/platform-status.git","svn_url":"https://github.com/mozilla/platform-status","homepage":"https://platform-status.mozilla.org/","size":1661,"stargazers_count":90,"watchers_count":90,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":34,"forks":23,"open_issues":34,"watchers":90,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/platform-status/pulls/317"},"html":{"href":"https://github.com/mozilla/platform-status/pull/317"},"issue":{"href":"https://api.github.com/repos/mozilla/platform-status/issues/317"},"comments":{"href":"https://api.github.com/repos/mozilla/platform-status/issues/317/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/platform-status/pulls/317/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/platform-status/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/platform-status/pulls/317/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/platform-status/statuses/36b2bb417a2c49c7d899f1bd6609cb45c6c1d199"}}}}