From 8f5cd12b65c70a344ed5e452ab01eee792008729 Mon Sep 17 00:00:00 2001
From: Akash Karangale <56954201+akashkska@users.noreply.github.com>
Date: Tue, 25 Jun 2024 02:48:19 +0530
Subject: [PATCH] GL-2639: Initialise project with default branch and readme
file. (#1754)
* GL-2639: Initialize project with dedault branch and readme file.
* GL-2639: Updated testcase for project initialization.
---
src/Command/CodeStudio/CodeStudioCommandTrait.php | 2 ++
.../src/Commands/CodeStudio/CodeStudioWizardCommandTest.php | 4 ++++
2 files changed, 6 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',
];
}
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();