reviewable-enterprise-tools 1.3.6 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/extract_data.js +4 -6
  2. package/package.json +1 -1
package/extract_data.js CHANGED
@@ -220,13 +220,13 @@ async function extractReviews() {
220
220
  await forEachLimit(reviewKeys, 25, async reviewKey => {
221
221
  let review = await db.child('reviews/:reviewKey', {reviewKey}).get();
222
222
  if (review) {
223
- await stripReview(review);
223
+ await stripReview(review, reviewKey);
224
224
  await writeItem(`reviews/${reviewKey}`, review);
225
225
  } else {
226
226
  const archive = await db.child('archivedReviews/:reviewKey', {reviewKey}).get();
227
227
  if (archive) {
228
228
  review = JSON.parse(zlib.gunzipSync(Buffer.from(archive.payload, 'base64')).toString());
229
- const placeholdersPresent = await stripReview(review);
229
+ const placeholdersPresent = await stripReview(review, reviewKey);
230
230
  if (identityUserMap) mapAllUserKeys(review);
231
231
  archive.payload =
232
232
  zlib.gzipSync(JSON.stringify(review), {level: zlib.constants.Z_BEST_COMPRESSION})
@@ -240,7 +240,7 @@ async function extractReviews() {
240
240
  });
241
241
  }
242
242
 
243
- async function stripReview(review) {
243
+ async function stripReview(review, key) {
244
244
  let placeholderAdded = false;
245
245
  review.core = _.omit(review.core, 'lastSweepTimestamp');
246
246
  delete review.lastWebhook;
@@ -258,9 +258,7 @@ async function stripReview(review) {
258
258
  const dest = path.join(args.download, path.dirname(rest.slice(1)));
259
259
  downloadPromises.push(download(url, dest).catch(e => {
260
260
  if (args.logging) log(`File download failed:\n${url}\n${e}`);
261
- const owner = review.core.ownerName ?? review.security.lowerCaseOwnerName;
262
- const repo = review.core.repoName ?? review.security.lowerCaseRepoName;
263
- brokenFiles.push(`${url} (${owner}/${repo} #${review.core.pullRequestId})`);
261
+ brokenFiles.push(`${url} (${reversePullRequests[key]})`);
264
262
  }));
265
263
  }
266
264
  return PLACEHOLDER_URL + rest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reviewable-enterprise-tools",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "type": "module",
5
5
  "description": "Admin tools for Reviewable Enterprise",
6
6
  "bin": {