From b038b8eea435eac3bb21a8369be3e1c5747b0f3a Mon Sep 17 00:00:00 2001 From: Sarah Mount Date: Thu, 30 May 2024 17:21:06 +0100 Subject: [PATCH] Make the archived repo warning harder to miss --- src/Git/Git.php | 5 ++++- tests/Helpers.php | 14 +++++++++++++- tests/dependencies/installer_test.php | 20 ++++++++++++++++---- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/Git/Git.php b/src/Git/Git.php index 7f7973e..c748248 100644 --- a/src/Git/Git.php +++ b/src/Git/Git.php @@ -88,7 +88,10 @@ public function check_is_archived_github_repository($repository) $json = json_decode($raw_json); curl_close($curl); if (!is_null($json) && property_exists($json, 'archived') && $json->archived) { - echo "WARNING: GitHub repo is archived. This dependency should be replaced before the repo is removed.\n"; + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + echo "!! WARNING: GitHub repo is archived. This dependency !!\n"; + echo "!! should be replaced before the repo is removed. !!\n"; + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; } } diff --git a/tests/Helpers.php b/tests/Helpers.php index f8c64b8..6621250 100644 --- a/tests/Helpers.php +++ b/tests/Helpers.php @@ -31,9 +31,21 @@ private function getWhippetLock(/* string */ $hash, array $dependencyMap) return $whippetLock; } + private function getArchivedWarning() + { + $warning = <<<'EOT' +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! WARNING: GitHub repo is archived. This dependency !! +!! should be replaced before the repo is removed. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +EOT; + return $warning; + } + private function getGit($isRepo, $cloneRepo, $checkout, $isArchived = false) { - $archived_warning = "WARNING: GitHub repo is archived. This dependency should be replaced before the repo is removed.\n"; + $archived_warning = $this->getArchivedWarning(); $git = $this->getMockBuilder('\\Dxw\\Whippet\\Git\\Git') ->disableOriginalConstructor() diff --git a/tests/dependencies/installer_test.php b/tests/dependencies/installer_test.php index b861599..a712e2d 100644 --- a/tests/dependencies/installer_test.php +++ b/tests/dependencies/installer_test.php @@ -205,9 +205,15 @@ public function testInstallArchiveRepo() $this->assertFalse($result->isErr()); $expectedOutput = <<<'EOT' [Adding themes/my-theme] -WARNING: GitHub repo is archived. This dependency should be replaced before the repo is removed. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! WARNING: GitHub repo is archived. This dependency !! +!! should be replaced before the repo is removed. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! git clone output -WARNING: GitHub repo is archived. This dependency should be replaced before the repo is removed. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! WARNING: GitHub repo is archived. This dependency !! +!! should be replaced before the repo is removed. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! git checkout output @@ -563,9 +569,15 @@ public function testInstallSingleAlreadyClonedAndArchived() $output = ob_get_clean(); $expectedOutput = <<<'EOT' [Adding plugins/my-plugin] -WARNING: GitHub repo is archived. This dependency should be replaced before the repo is removed. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! WARNING: GitHub repo is archived. This dependency !! +!! should be replaced before the repo is removed. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! git clone output -WARNING: GitHub repo is archived. This dependency should be replaced before the repo is removed. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! WARNING: GitHub repo is archived. This dependency !! +!! should be replaced before the repo is removed. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! git checkout output