From c24da4c8d998e0a4846ba9e8a59721d38ca7388c Mon Sep 17 00:00:00 2001 From: "Russell R. Rutledge" Date: Wed, 29 Mar 2023 09:27:17 -0500 Subject: [PATCH 1/2] Fix user tile bug * For some reason, some user objects in the graph API are missing a user URL. * Users without a URL don't get a link to their GitHub profile. * Fix is to explicitly ensure that we don't overwrite a good user URL with an empty one. --- scripts/get_contributors.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/get_contributors.js b/scripts/get_contributors.js index 2fe2dae5..165dacc7 100644 --- a/scripts/get_contributors.js +++ b/scripts/get_contributors.js @@ -92,7 +92,10 @@ module.exports = async function (filepath) { return Object.values( [...authors, ...reviewers].reduce((accumulator, user) => { // Dedupe users - accumulator[user.name] = user + const newUser = accumulator[user.name] || user + newUser.url = newUser.url || user.url + accumulator[user.name] = newUser + return accumulator }, {}) ) From 75bcd2c11fd973180775b1997780142787d6de74 Mon Sep 17 00:00:00 2001 From: rrrutledge Date: Tue, 4 Apr 2023 11:06:52 -0500 Subject: [PATCH 2/2] Update get_contributors.js --- scripts/get_contributors.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/get_contributors.js b/scripts/get_contributors.js index 165dacc7..ff9f1e4a 100644 --- a/scripts/get_contributors.js +++ b/scripts/get_contributors.js @@ -92,6 +92,8 @@ module.exports = async function (filepath) { return Object.values( [...authors, ...reviewers].reduce((accumulator, user) => { // Dedupe users + // Some user objects do not have a URL (can't figure out why). + // In that case, copy over a good URL instead. const newUser = accumulator[user.name] || user newUser.url = newUser.url || user.url accumulator[user.name] = newUser