From 650dee6f436761fb7a6ba011279cdbfc5f14ee6d Mon Sep 17 00:00:00 2001 From: Akash Karangale Date: Fri, 21 Jun 2024 12:08:17 +0530 Subject: [PATCH 1/2] GL-2639: Initialize project with dedault branch and readme file. --- src/Command/CodeStudio/CodeStudioCommandTrait.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Command/CodeStudio/CodeStudioCommandTrait.php b/src/Command/CodeStudio/CodeStudioCommandTrait.php index cc9aefa3e..b137a147e 100644 --- a/src/Command/CodeStudio/CodeStudioCommandTrait.php +++ b/src/Command/CodeStudio/CodeStudioCommandTrait.php @@ -236,7 +236,9 @@ private function setGitLabProjectDescription(mixed $cloudApplicationUuid): void private function getGitLabProjectDefaults(): array { return [ 'container_registry_access_level' => 'disabled', + 'default_branch' => 'main', 'description' => $this->gitLabProjectDescription, + 'initialize_with_readme' => TRUE, 'topics' => 'Acquia Cloud Application', ]; } From 41328b6f1579e78faeee7cf85b292674c79e6529 Mon Sep 17 00:00:00 2001 From: Akash Karangale Date: Mon, 24 Jun 2024 13:54:44 +0530 Subject: [PATCH 2/2] GL-2639: Updated testcase for project initialization. --- .../src/Commands/CodeStudio/CodeStudioWizardCommandTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php b/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php index e431dcf12..3fce2b9b5 100644 --- a/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php +++ b/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php @@ -297,7 +297,9 @@ public function testCommand(array $mockedGitlabProjects, array $inputs, array $a $projects = $this->mockGetGitLabProjects($this::$applicationUuid, $this->gitLabProjectId, $mockedGitlabProjects); $parameters = [ 'container_registry_access_level' => 'disabled', + 'default_branch' => 'main', 'description' => 'Source repository for Acquia Cloud Platform application a47ac10b-58cc-4372-a567-0e02b2c3d470', + 'initialize_with_readme' => TRUE, 'namespace_id' => 47, 'topics' => 'Acquia Cloud Application', ]; @@ -305,7 +307,9 @@ public function testCommand(array $mockedGitlabProjects, array $inputs, array $a $this->mockGitLabProjectsTokens($projects); $parameters = [ 'container_registry_access_level' => 'disabled', + 'default_branch' => 'main', 'description' => 'Source repository for Acquia Cloud Platform application a47ac10b-58cc-4372-a567-0e02b2c3d470', + 'initialize_with_readme' => TRUE, 'topics' => 'Acquia Cloud Application', ]; $projects->update($this->gitLabProjectId, $parameters)->shouldBeCalled();