diff --git a/docs/donations/projects.mdx b/docs/donations/projects.mdx index 3c096ae3..f6bc99ac 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) {