From b926068382b775fb107cea64005ea9531fde6d69 Mon Sep 17 00:00:00 2001 From: W0rma Date: Sat, 14 Nov 2026 11:41:10 +0100 Subject: [PATCH 1/2] Do not publish incomplete changelog on GitHub API failures Failed release fetches were silently skipped, so a transient API error produced a changelog with most repositories missing, which got published and restored by the next hourly run. Retry failed fetches and abort if they keep failing, so nothing is written or committed. --- RoboFile.php | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index bca066714..df8d77359 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -555,16 +555,11 @@ public function processChangelog() if ($repository['disabled'] || $repository['archived']) { continue; } - try { - $releases = $client->repo()->releases()->all('codeception', $repositoryName); - foreach ($releases as $k=> $release) { - $releases[$k]['repo'] = $repositoryName; - } - $allReleases = array_merge($allReleases, $releases); - } catch (\Exception $err) { -// $this->say("Repository not available " . $repository['name']); -// $this->say($err->getMessage()); + $releases = $this->fetchReleases($client, $repositoryName); + foreach ($releases as $k=> $release) { + $releases[$k]['repo'] = $repositoryName; } + $allReleases = array_merge($allReleases, $releases); } usort($allReleases, function($r1, $r2) { @@ -603,6 +598,25 @@ public function processChangelog() return $changelog; } + /** + * Retries transient GitHub API failures. Gives up by throwing, so that + * an incomplete changelog is never written and published. + */ + private function fetchReleases(\Github\Client $client, string $repositoryName, int $attempts = 3): array + { + for ($attempt = 1; ; $attempt++) { + try { + return $client->repo()->releases()->all('codeception', $repositoryName); + } catch (\Exception $err) { + $this->say("Fetching releases of $repositoryName failed (attempt $attempt/$attempts): " . $err->getMessage()); + if ($attempt >= $attempts) { + throw new \RuntimeException("Could not fetch releases of $repositoryName", 0, $err); + } + sleep(5 * $attempt); + } + } + } + public function updateBuildsPage() { $sortByVersion = function (\SplFileInfo $a, \SplFileInfo $b) { From 628093349fb5735a45d80619d506f4143cd411db Mon Sep 17 00:00:00 2001 From: W0rma Date: Sat, 14 Nov 2026 11:41:10 +0100 Subject: [PATCH 2/2] Stop generating the changelog in build:docs The publish workflow runs robo changelog as a separate, authenticated step which overwrites the result. The run in build:docs is unauthenticated and only consumes API rate limit. --- RoboFile.php | 1 - 1 file changed, 1 deletion(-) diff --git a/RoboFile.php b/RoboFile.php index df8d77359..a4ba21f93 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -57,7 +57,6 @@ public function buildDocs() $this->buildDocsStub(); $this->buildDocsApi(); $this->buildDocsExtensions(); - $this->changelog(); } public function buildDocsModules()