Skip to content

Commit

Permalink
CLI-1392: Redundant version notifications (#1795)
Browse files Browse the repository at this point in the history
* CLI-1392: Redundant version notifications

* fix release version

* fix tests
  • Loading branch information
danepowell authored Sep 9, 2024
1 parent 97e4559 commit 81703a7
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 140 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
if [[ "$GITHUB_REF_TYPE" == 'tag' ]]; then
echo "ACLI_VERSION=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
else
echo "ACLI_VERSION=$GITHUB_SHA" >> $GITHUB_OUTPUT
echo "ACLI_VERSION=dev-$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
fi
- name: 'Create env file'
run: |
Expand Down
2 changes: 1 addition & 1 deletion bin/acli
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if (in_array($input->getFirstArgument(), ['clear-kernel-cache', 'ckc'])) {

putenv('BUGSNAG_KEY=');
putenv('AMPLITUDE_KEY=');
putenv('ACLI_VERSION=UNKNOWN');
putenv('ACLI_VERSION=dev-unknown');
$dotenv = Dotenv::createUnsafeMutable(__DIR__ . '/..');
$dotenv->safeLoad();

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"acquia/drupal-environment-detector": "^1.2.0",
"bugsnag/bugsnag": "^3.0",
"composer/semver": "^3.3",
"consolidation/self-update": "3.0.0-alpha1 as 2.1.0",
"consolidation/self-update": "3.0.0-alpha2 as 2.1.0",
"dflydev/dot-access-data": "^3",
"grasmash/expander": "^3",
"guzzlehttp/guzzle": "^7.4",
Expand Down
266 changes: 133 additions & 133 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Command/CommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ public function checkForNewVersion(): bool|string
if (AcquiaDrupalEnvironmentDetector::isAhIdeEnv()) {
return false;
}
if ($this->getApplication()->getVersion() === 'UNKNOWN') {
if ($this->getApplication()->getVersion() === 'dev-unknown') {
return false;
}
try {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/src/Application/KernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testRun(): void
private function getStart(): string
{
return <<<EOD
Acquia CLI
Acquia CLI dev-unknown
Usage:
command [options] [arguments]
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/src/ApplicationTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function setUp(): void
protected function runApp(): string
{
putenv("ACLI_REPO_ROOT=" . $this->projectDir);
putenv("ACLI_VERSION=" . 'UNKNOWN');
putenv("ACLI_VERSION=" . 'dev-unknown');
$input = $this->kernel->getContainer()->get(InputInterface::class);
$output = $this->kernel->getContainer()->get(OutputInterface::class);
/** @var Application $application */
Expand Down
4 changes: 3 additions & 1 deletion tests/phpunit/src/TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ protected function setUp(): void
$this->consoleOutput = new ConsoleOutput();
$this->setClientProphecies();
$this->setIo();
$this->selfUpdateManager = $this->prophet->prophesize(SelfUpdateManager::class)->reveal();
$selfUpdateManagerProphecy = $this->prophet->prophesize(SelfUpdateManager::class);
$selfUpdateManagerProphecy->isUpToDate()->willReturn(true);
$this->selfUpdateManager = $selfUpdateManagerProphecy->reveal();

$this->vfsRoot = vfsStream::setup();
$this->projectDir = vfsStream::newDirectory('project')
Expand Down

0 comments on commit 81703a7

Please sign in to comment.