Skip to content

Commit 30e82e8

Browse files
authored
chore(dev): rename component:update:gencode to component:update (#8918)
1 parent a04ce72 commit 30e82e8

7 files changed

Lines changed: 28 additions & 28 deletions

File tree

dev/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Available commands:
1414
component:add-version Add a new version to an existing Component
1515
component:info [info] list info of a component or the whole library
1616
component:new Add a new Component
17+
component:update Update one or all components using Owlbot
1718
component:update:deps update a dependency across all components
18-
component:update:gencode Update one or all components using Owlbot
1919
component:update:readme-sample Add a sample to a component
2020
release
2121
release:info list information for a google-cloud-php release

dev/google-cloud

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use Google\Cloud\Dev\Command\ComponentAddVersionCommand;
2626
use Google\Cloud\Dev\Command\ComponentExecuteCommand;
2727
use Google\Cloud\Dev\Command\ComponentInfoCommand;
2828
use Google\Cloud\Dev\Command\ComponentNewCommand;
29-
use Google\Cloud\Dev\Command\ComponentUpdateGencodeCommand;
29+
use Google\Cloud\Dev\Command\ComponentUpdateCommand;
3030
use Google\Cloud\Dev\Command\ComponentUpdateReadmeSampleCommand;
3131
use Google\Cloud\Dev\Command\ComponentUpdateDepsCommand;
3232
use Google\Cloud\Dev\Command\DocFxCommand;
@@ -51,7 +51,7 @@ $app->add(new ComponentInfoCommand());
5151
$app->add(new ComponentAddVersionCommand($rootDirectory));
5252
$app->add(new ComponentExecuteCommand());
5353
$app->add(new ComponentNewCommand($rootDirectory));
54-
$app->add(new ComponentUpdateGencodeCommand($rootDirectory));
54+
$app->add(new ComponentUpdateCommand($rootDirectory));
5555
$app->add(new ComponentUpdateReadmeSampleCommand($rootDirectory));
5656
$app->add(new ComponentUpdateDepsCommand());
5757
$app->add(new DocFxCommand());

dev/src/Command/ComponentAddVersionCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
105105
'component' => $componentName,
106106
'--timeout' => $input->getOption('timeout'),
107107
];
108-
if (!$this->getApplication()->has('component:update:gencode')) {
108+
if (!$this->getApplication()->has('component:update')) {
109109
throw new \RuntimeException(
110-
'Application does not have an component:update:gencode command. '
110+
'Application does not have an component:update command. '
111111
. 'Run with --no-update to skip this.'
112112
);
113113
}
114-
$updateCommand = $this->getApplication()->find('component:update:gencode');
114+
$updateCommand = $this->getApplication()->find('component:update');
115115
$returnCode = $updateCommand->run(new ArrayInput($args), $output);
116116
if ($returnCode !== Command::SUCCESS) {
117117
return $returnCode;

dev/src/Command/ComponentNewCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function configure()
8282
'no-update',
8383
null,
8484
InputOption::VALUE_NONE,
85-
'Do not run the component:update:gencode command after adding the component skeleton'
85+
'Do not run the component:update command after adding the component skeleton'
8686
)
8787
->addOption(
8888
'timeout',
@@ -236,13 +236,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
236236
'component' => $new->componentName,
237237
'--timeout' => $timeout,
238238
];
239-
if (!$this->getApplication()->has('component:update:gencode')) {
239+
if (!$this->getApplication()->has('component:update')) {
240240
throw new \RuntimeException(
241-
'Application does not have an component:update:gencode command. '
241+
'Application does not have an component:update command. '
242242
. 'Run with --no-update to skip this.'
243243
);
244244
}
245-
$updateCommand = $this->getApplication()->find('component:update:gencode');
245+
$updateCommand = $this->getApplication()->find('component:update');
246246
$returnCode = $updateCommand->run(new ArrayInput($args), $output);
247247
if ($returnCode !== Command::SUCCESS) {
248248
return $returnCode;

dev/src/Command/ComponentUpdateGencodeCommand.php renamed to dev/src/Command/ComponentUpdateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* @internal
3838
*/
39-
class ComponentUpdateGencodeCommand extends Command
39+
class ComponentUpdateCommand extends Command
4040
{
4141
private const OWLBOT_CLI_IMAGE = 'gcr.io/cloud-devrel-public-resources/owlbot-cli:latest';
4242

@@ -57,7 +57,7 @@ public function __construct($rootPath, ?RunProcess $runProcess = null)
5757

5858
protected function configure()
5959
{
60-
$this->setName('component:update:gencode')
60+
$this->setName('component:update')
6161
->setDescription('Update one or all components using Owlbot')
6262
->addArgument(
6363
'component',

dev/tests/Unit/Command/ComponentNewCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ public function testNewComponentWithUpdateComponent()
174174
$application = new Application();
175175
$application->add(new ComponentNewCommand(self::$tmpDir));
176176

177-
// Add dummy command for component:update:gencode and component:update:readme-sample to ensure they're called
178-
$dummyCommand->getName()->willReturn('component:update:gencode');
177+
// Add dummy command for component:update and component:update:readme-sample to ensure they're called
178+
$dummyCommand->getName()->willReturn('component:update');
179179
$application->add($dummyCommand->reveal());
180180
$dummyCommand->getName()->willReturn('component:update:readme-sample');
181181
$application->add($dummyCommand->reveal());

dev/tests/Unit/Command/ComponentUpdateGencodeCommandTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace Google\Cloud\Dev\Tests\Unit\Command;
1919

20-
use Google\Cloud\Dev\Command\ComponentUpdateGencodeCommand;
20+
use Google\Cloud\Dev\Command\ComponentUpdateCommand;
2121
use Google\Cloud\Dev\RunProcess;
2222
use PHPUnit\Framework\TestCase;
2323
use Prophecy\PhpUnit\ProphecyTrait;
@@ -28,7 +28,7 @@
2828
/**
2929
* @group dev
3030
*/
31-
class ComponentUpdateGencodeCommandTest extends TestCase
31+
class ComponentUpdateCommandTest extends TestCase
3232
{
3333
use ProphecyTrait;
3434

@@ -55,8 +55,8 @@ public static function setUpBeforeClass(): void
5555
],
5656
]));
5757
$application = new Application();
58-
$application->add(new ComponentUpdateGencodeCommand(self::$tmpDir));
59-
self::$commandTester = new CommandTester($application->get('component:update:gencode'));
58+
$application->add(new ComponentUpdateCommand(self::$tmpDir));
59+
self::$commandTester = new CommandTester($application->get('component:update'));
6060
}
6161

6262
public static function tearDownAfterClass(): void
@@ -76,8 +76,8 @@ public function testUpdateFailsWithInvalidGoogleapisDir()
7676

7777
$googleapisGenPath = '/path/to/googleapis-gen';
7878
$application = new Application();
79-
$application->add(new ComponentUpdateGencodeCommand(self::$tmpDir));
80-
$commandTester = new CommandTester($application->get('component:update:gencode'));
79+
$application->add(new ComponentUpdateCommand(self::$tmpDir));
80+
$commandTester = new CommandTester($application->get('component:update'));
8181

8282
$commandTester->execute([
8383
'component' => self::COMPONENT_NAME,
@@ -96,8 +96,8 @@ public function testUpdateFailsWithNoDocker()
9696
->willReturn('');
9797

9898
$application = new Application();
99-
$application->add(new ComponentUpdateGencodeCommand(self::$tmpDir, $runProcess->reveal()));
100-
$commandTester = new CommandTester($application->get('component:update:gencode'));
99+
$application->add(new ComponentUpdateCommand(self::$tmpDir, $runProcess->reveal()));
100+
$commandTester = new CommandTester($application->get('component:update'));
101101

102102
$commandTester->execute([
103103
'component' => self::COMPONENT_NAME,
@@ -116,8 +116,8 @@ public function testUpdateFailsWithInvalidComponentName()
116116
->willReturn('/path/to/docker');
117117

118118
$application = new Application();
119-
$application->add(new ComponentUpdateGencodeCommand(self::$tmpDir, $runProcess->reveal()));
120-
$commandTester = new CommandTester($application->get('component:update:gencode'));
119+
$application->add(new ComponentUpdateCommand(self::$tmpDir, $runProcess->reveal()));
120+
$commandTester = new CommandTester($application->get('component:update'));
121121

122122
$commandTester->execute([
123123
'component' => 'NonExistantComponent',
@@ -185,9 +185,9 @@ public function testUpdateComponentSucceeds()
185185
->willReturn('');
186186

187187
$application = new Application();
188-
$application->add(new ComponentUpdateGencodeCommand(self::$tmpDir, $runProcess->reveal()));
188+
$application->add(new ComponentUpdateCommand(self::$tmpDir, $runProcess->reveal()));
189189

190-
$commandTester = new CommandTester($application->get('component:update:gencode'));
190+
$commandTester = new CommandTester($application->get('component:update'));
191191

192192
$commandTester->execute([
193193
'component' => self::COMPONENT_NAME,
@@ -206,9 +206,9 @@ public function testUpdateComponentErrorsWithNonNumericTimeout()
206206
$this->expectExceptionMessage('Error: The timeout option must be a positive integer');
207207

208208
$application = new Application();
209-
$application->add(new ComponentUpdateGencodeCommand(self::$tmpDir));
209+
$application->add(new ComponentUpdateCommand(self::$tmpDir));
210210

211-
$commandTester = new CommandTester($application->get('component:update:gencode'));
211+
$commandTester = new CommandTester($application->get('component:update'));
212212
$commandTester->setInputs([
213213
'Y' // Does this information look correct? [Y/n]
214214
]);

0 commit comments

Comments
 (0)