Skip to content

Commit

Permalink
GL-2582 : Remove schedule pipelines for node projects (#1759)
Browse files Browse the repository at this point in the history
* GL-2582: Updated schedule pipeline to run with drupal projects only.

* GL-2582: Fixed failing mutation test cases.

---------

Co-authored-by: Dane Powell <[email protected]>
  • Loading branch information
akashkska and danepowell authored Jun 26, 2024
1 parent 5a4966d commit 4eb854b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Command/CodeStudio/CodeStudioWizardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
switch ($projectSelected) {
case "Drupal_project":
$this->setGitLabCiCdVariablesForPhpProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $phpVersion);
$this->createScheduledPipeline($project);
break;
case "Node_project":
$parameters = [
Expand All @@ -128,7 +129,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->setGitLabCiCdVariablesForNodeProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $nodeVersion);
break;
}
$this->createScheduledPipeline($project);

$this->io->success([
"Successfully configured the Code Studio project!",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,25 +325,28 @@ public function testCommand(array $mockedGitlabProjects, array $inputs, array $a
];
$projects->update($this->gitLabProjectId, $parameters)->shouldBeCalled();
}
$schedules = $this->prophet->prophesize(Schedules::class);
$schedules->showAll($this->gitLabProjectId)->willReturn([]);
$pipeline = ['id' => 1];
$parameters = [
// Every Thursday at midnight.
'cron' => '0 0 * * 4',
'description' => 'Code Studio Automatic Updates',
'ref' => 'master',
];
$schedules->create($this->gitLabProjectId, $parameters)->willReturn($pipeline);
$schedules->addVariable($this->gitLabProjectId, $pipeline['id'], [
'key' => 'ACQUIA_JOBS_DEPRECATED_UPDATE',
'value' => 'true',
])->shouldBeCalled();
$schedules->addVariable($this->gitLabProjectId, $pipeline['id'], [
'key' => 'ACQUIA_JOBS_COMPOSER_UPDATE',
'value' => 'true',
])->shouldBeCalled();
$gitlabClient->schedules()->willReturn($schedules->reveal());
else {
$schedules = $this->prophet->prophesize(Schedules::class);
$schedules->showAll($this->gitLabProjectId)->willReturn([]);
$pipeline = ['id' => 1];
$parameters = [
// Every Thursday at midnight.
'cron' => '0 0 * * 4',
'description' => 'Code Studio Automatic Updates',
'ref' => 'master',
];
$schedules->create($this->gitLabProjectId, $parameters)->willReturn($pipeline);
$schedules->addVariable($this->gitLabProjectId, $pipeline['id'], [
'key' => 'ACQUIA_JOBS_DEPRECATED_UPDATE',
'value' => 'true',
])->shouldBeCalled();
$schedules->addVariable($this->gitLabProjectId, $pipeline['id'], [
'key' => 'ACQUIA_JOBS_COMPOSER_UPDATE',
'value' => 'true',
])->shouldBeCalled();
$gitlabClient->schedules()->willReturn($schedules->reveal());
}

$gitlabClient->projects()->willReturn($projects);

$this->command->setGitLabClient($gitlabClient->reveal());
Expand Down

0 comments on commit 4eb854b

Please sign in to comment.