From 7c2b2ca2298365f28706acd3cc9e3e4a7dd67a2d Mon Sep 17 00:00:00 2001 From: castrojo Date: Tue, 8 Sep 2026 13:49:55 +0000 Subject: [PATCH] fix(repos): repair moved GitHub slugs and preserve partial repository-stat cache - Drop deja-dup/deja-dup and Flavius42/mission-center from fetch-github-repos.js: both projects fully moved development to GNOME GitLab and no longer have a canonical GitHub repository, so the fetch was always 404ing. Also drop the corresponding githubRepo props in projects.mdx so ProjectCard doesn't fall back to a wasted visitor-side GitHub API request for these cards. - Repoint tesk-g/refine to TheEvilSkeleton/Refine (the account was renamed) and update its icon/avatar accordingly. - fetch-github-repos.js now merges freshly fetched results on top of the existing cache instead of overwriting it wholesale, so a transient failure for one repo no longer erases previously cached stats for that repo. Entries for repos no longer tracked are dropped from the merged cache. Signed-off-by: castrojo --- docs/donations/projects.mdx | 8 +++---- scripts/fetch-github-repos.js | 43 +++++++++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/docs/donations/projects.mdx b/docs/donations/projects.mdx index 3c096ae33..f6bc99acc 100644 --- a/docs/donations/projects.mdx +++ b/docs/donations/projects.mdx @@ -221,13 +221,11 @@ These are the [CNCF](https://www.cncf.io/) and [OpenSSF](https://openssf.org/) p description="Simple backup utility for GNOME" sponsorUrl="https://liberapay.com/DejaDup" icon="https://github.com/deja-dup.png" - githubRepo="deja-dup/deja-dup" /> { @@ -148,11 +162,30 @@ async function fetchAllRepos() { }, ); - const repos = Object.fromEntries(resultsMap); + const freshRepos = Object.fromEntries(resultsMap); + // Merge: start from cached entries for repos still tracked (dropping any + // that were removed from GITHUB_REPOS), then overlay this run's + // successes. A repo that failed this run keeps its last-known-good stats + // instead of disappearing entirely. + const repos = {}; + for (const repoPath of GITHUB_REPOS) { + if (existingCache[repoPath]) { + repos[repoPath] = existingCache[repoPath]; + } + } + Object.assign(repos, freshRepos); + + const failedCount = GITHUB_REPOS.length - Object.keys(freshRepos).length; console.log( - `\nSuccessfully fetched ${Object.keys(repos).length}/${GITHUB_REPOS.length} repos`, + `\nSuccessfully fetched ${Object.keys(freshRepos).length}/${GITHUB_REPOS.length} repos`, ); + if (failedCount > 0) { + const recoveredFromCache = Object.keys(repos).length - Object.keys(freshRepos).length; + console.log( + ` ${recoveredFromCache} of the ${failedCount} failures were preserved from the existing cache.`, + ); + } // Don't fail build if no repos fetched - the component will just not show stats if (Object.keys(repos).length === 0) {