From 78c262ab20a6d0c8b42ba05126f2f5281b8cfadf Mon Sep 17 00:00:00 2001 From: Simon Schaufelberger Date: Sun, 17 Mar 2024 23:39:06 +0100 Subject: [PATCH] [TASK] Change default branch to main --- .github/workflows/code_coverage.yaml | 2 +- .github/workflows/php_cs_fixer.yaml | 2 +- .github/workflows/phpstan.yaml | 2 +- .github/workflows/tests.yaml | 2 +- Documentation/Examples/Neos/Index.rst | 2 +- Documentation/Settings.cfg | 2 +- Documentation/SmokeTesting/Index.rst | 2 +- README.md | 10 +++++----- composer.json | 2 +- src/Task/Git/AbstractCheckoutTask.php | 2 +- src/Task/Git/PushTask.php | 2 +- tests/Unit/Task/Git/PushTaskTest.php | 4 ++-- tests/Unit/Task/GitCheckoutTaskTest.php | 10 +++++----- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/code_coverage.yaml b/.github/workflows/code_coverage.yaml index 50844005..16a220f7 100644 --- a/.github/workflows/code_coverage.yaml +++ b/.github/workflows/code_coverage.yaml @@ -4,7 +4,7 @@ on: pull_request: null push: branches: - - master + - main jobs: code_coverage: diff --git a/.github/workflows/php_cs_fixer.yaml b/.github/workflows/php_cs_fixer.yaml index 8895652f..dbeff04f 100644 --- a/.github/workflows/php_cs_fixer.yaml +++ b/.github/workflows/php_cs_fixer.yaml @@ -3,7 +3,7 @@ name: Format (PHP) on: pull_request: branches: - - master + - main - 2.0 jobs: diff --git a/.github/workflows/phpstan.yaml b/.github/workflows/phpstan.yaml index 573f9da4..f947fe7c 100644 --- a/.github/workflows/phpstan.yaml +++ b/.github/workflows/phpstan.yaml @@ -4,7 +4,7 @@ on: pull_request: null push: branches: - - master + - main jobs: phpstan: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 88fb16a3..218df6c9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,7 +3,7 @@ name: Tests on: push: branches: - - master + - main pull_request: jobs: diff --git a/Documentation/Examples/Neos/Index.rst b/Documentation/Examples/Neos/Index.rst index 00fba33b..8b168838 100644 --- a/Documentation/Examples/Neos/Index.rst +++ b/Documentation/Examples/Neos/Index.rst @@ -21,7 +21,7 @@ If you would like to deploy a Neos website a good starting point is to use the N ->setOption('keepReleases', 3) ->setOption('composerCommandPath', 'composer') ->setOption('repositoryUrl', '') - ->setOption('branch', 'master') + ->setOption('branch', 'main') ->setOption('updateMethod', null) ->setOption('baseUrl', 'https://my.node.com') ->setOption('flushCacheList', [ diff --git a/Documentation/Settings.cfg b/Documentation/Settings.cfg index 4040c9f8..e036f4c4 100644 --- a/Documentation/Settings.cfg +++ b/Documentation/Settings.cfg @@ -12,7 +12,7 @@ copyright = since 2011 by the contributors # "Edit on GitHub" button github_repository = TYPO3/Surf -github_branch = master +github_branch = main # Footer links project_home = https://packagist.org/packages/TYPO3/Surf diff --git a/Documentation/SmokeTesting/Index.rst b/Documentation/SmokeTesting/Index.rst index 3ed7a3c0..b84c469e 100644 --- a/Documentation/SmokeTesting/Index.rst +++ b/Documentation/SmokeTesting/Index.rst @@ -73,7 +73,7 @@ AdditionalConfiguration.php:: .htaccess:: - # Add Rewrite rule near https://github.com/typo3/typo3/blob/master/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess#L270 + # Add Rewrite rule near https://github.com/TYPO3/typo3/blob/main/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess#L270 RewriteCond %{HTTP_HOST} ^next\.example\.com$ RewriteRule .? - [E=TYPO3_CONTEXT:Testing] diff --git a/README.md b/README.md index 29d4ee5b..bea1ab80 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ [![Latest Stable Version](https://poser.pugx.org/typo3/surf/v/stable.svg)](https://packagist.org/packages/TYPO3/Surf) [![Total Downloads](https://poser.pugx.org/typo3/surf/downloads.svg)](https://packagist.org/packages/TYPO3/Surf) [![Monthly Downloads](https://poser.pugx.org/typo3/surf/d/monthly)](https://packagist.org/packages/TYPO3/Surf) -![Tests](https://github.com/TYPO3/Surf/workflows/Tests/badge.svg?branch=master&event=push) -[![Coverage Status](https://img.shields.io/coveralls/TYPO3/Surf/master.svg?style=flat-square)](https://coveralls.io/github/TYPO3/Surf?branch=master) +![Tests](https://github.com/TYPO3/Surf/workflows/Tests/badge.svg?branch=main&event=push) +[![Coverage Status](https://img.shields.io/coveralls/TYPO3/Surf/main.svg?style=flat-square)](https://coveralls.io/github/TYPO3/Surf?branch=main) # Surf @@ -20,14 +20,14 @@ Some features of the Surf package: ## Documentation -For further information please read the documentation https://docs.typo3.org/other/typo3/surf/master/en-us/. +For further information please read the documentation https://docs.typo3.org/other/typo3/surf/main/en-us/. ### Contributing to the documentation You can simply edit or add a .rst file in the `Documentation` folder on GitHub and create a pull request. -The online documentation will automatically update after changes to the master branch. -To preview the documentation locally please follow this [guide](https://github.com/t3docs/docker-render-documentation). +The online documentation will automatically update after changes to the main branch. +To preview the documentation locally, please follow this [guide](https://github.com/t3docs/docker-render-documentation). The documentation was set up according to the [TYPO3 documentation guide](https://docs.typo3.org/typo3cms/RenderTYPO3DocumentationGuide/Index.html). diff --git a/composer.json b/composer.json index 12d02583..607acab7 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { diff --git a/src/Task/Git/AbstractCheckoutTask.php b/src/Task/Git/AbstractCheckoutTask.php index 1929f3fc..2bfd16b8 100644 --- a/src/Task/Git/AbstractCheckoutTask.php +++ b/src/Task/Git/AbstractCheckoutTask.php @@ -47,7 +47,7 @@ protected function resolveSha1(Node $node, Deployment $deployment, array $option ); $this->guardAgainstInvalidSha1($sha1, 'Could not retrieve sha1 of git tag "' . $options['tag'] . '"', 1335974915); } else { - $branch = $options['branch'] ?? 'master'; + $branch = $options['branch'] ?? 'main'; $sha1 = $this->shell->execute("git ls-remote {$options['repositoryUrl']} refs/heads/$branch | awk '{print $1 }'", $node, $deployment, true); $this->guardAgainstInvalidSha1($sha1, 'Could not retrieve sha1 of git branch "' . $branch . '"', 1335974926); } diff --git a/src/Task/Git/PushTask.php b/src/Task/Git/PushTask.php index 64d08ebb..48fc9674 100644 --- a/src/Task/Git/PushTask.php +++ b/src/Task/Git/PushTask.php @@ -32,7 +32,7 @@ * $workflow * ->setTaskOptions('TYPO3\Surf\Task\Git\PushTask', [ * 'remote' => 'git@github.com:TYPO3/Surf.git', - * 'refspec' => 'master', + * 'refspec' => 'main', * 'recurseIntoSubmodules' => true * ] * ); diff --git a/tests/Unit/Task/Git/PushTaskTest.php b/tests/Unit/Task/Git/PushTaskTest.php index 8d65e92f..8597d475 100644 --- a/tests/Unit/Task/Git/PushTaskTest.php +++ b/tests/Unit/Task/Git/PushTaskTest.php @@ -50,7 +50,7 @@ public function missingRefSpecOptionThrowsException(): void */ public function executeGitPushSuccessfully(): void { - $options = ['remote' => 'https://github.com/12345/12345', 'refspec' => 'master:refs/heads/qa/master']; + $options = ['remote' => 'https://github.com/12345/12345', 'refspec' => 'master:refs/heads/qa/main']; $this->task->execute($this->node, $this->application, $this->deployment, $options); $this->assertCommandExecuted( sprintf( @@ -68,7 +68,7 @@ public function executeGitPushWithRecurseIntoSubmodulesSuccessfully(): void { $options = [ 'remote' => 'https://github.com/12345/12345', - 'refspec' => 'master:refs/heads/qa/master', + 'refspec' => 'master:refs/heads/qa/main', 'recurseIntoSubmodules' => true ]; $this->task->execute($this->node, $this->application, $this->deployment, $options); diff --git a/tests/Unit/Task/GitCheckoutTaskTest.php b/tests/Unit/Task/GitCheckoutTaskTest.php index 6bdbd841..4aaccbae 100644 --- a/tests/Unit/Task/GitCheckoutTaskTest.php +++ b/tests/Unit/Task/GitCheckoutTaskTest.php @@ -47,7 +47,7 @@ public function executeWithEmptyOptionsAndValidSha1FetchesResetsCopiesAndCleansR 'repositoryUrl' => 'ssh://git.example.com/project/path.git' ]; $this->responses = [ - 'git ls-remote ssh://git.example.com/project/path.git refs/heads/master | awk \'{print $1 }\'' => 'd5b7769852a5faa69574fcd3db0799f4ffbd9eec' + 'git ls-remote ssh://git.example.com/project/path.git refs/heads/main | awk \'{print $1 }\'' => 'd5b7769852a5faa69574fcd3db0799f4ffbd9eec' ]; $this->task->execute($this->node, $this->application, $this->deployment, $options); @@ -124,7 +124,7 @@ public function executeWithDisabledRecursiveSubmodulesOptionDoesNotUpdateSubmodu 'recursiveSubmodules' => false ]; $this->responses = [ - 'git ls-remote ssh://git.example.com/project/path.git refs/heads/master | awk \'{print $1 }\'' => 'd5b7769852a5faa69574fcd3db0799f4ffbd9eec' + 'git ls-remote ssh://git.example.com/project/path.git refs/heads/main | awk \'{print $1 }\'' => 'd5b7769852a5faa69574fcd3db0799f4ffbd9eec' ]; $this->task->execute($this->node, $this->application, $this->deployment, $options); @@ -140,7 +140,7 @@ public function executeWithoutRecursiveSubmodulesOptionUpdatesSubmodulesRecursiv 'repositoryUrl' => 'ssh://git.example.com/project/path.git' ]; $this->responses = [ - 'git ls-remote ssh://git.example.com/project/path.git refs/heads/master | awk \'{print $1 }\'' => 'd5b7769852a5faa69574fcd3db0799f4ffbd9eec' + 'git ls-remote ssh://git.example.com/project/path.git refs/heads/main | awk \'{print $1 }\'' => 'd5b7769852a5faa69574fcd3db0799f4ffbd9eec' ]; $this->task->execute($this->node, $this->application, $this->deployment, $options); @@ -157,7 +157,7 @@ public function executeWithFetchAllTagsOptionExecutesFetchTags(): void 'fetchAllTags' => true ]; $this->responses = [ - 'git ls-remote ssh://git.example.com/project/path.git refs/heads/master | awk \'{print $1 }\'' => 'd5b7769852a5faa69574fcd3db0799f4ffbd9eec' + 'git ls-remote ssh://git.example.com/project/path.git refs/heads/main | awk \'{print $1 }\'' => 'd5b7769852a5faa69574fcd3db0799f4ffbd9eec' ]; $this->task->execute($this->node, $this->application, $this->deployment, $options); @@ -175,7 +175,7 @@ public function executeWithEmptyOptionsAndInvalidSha1ThrowsException(): void 'repositoryUrl' => 'ssh://git.example.com/project/path.git' ]; $this->responses = [ - 'git ls-remote ssh://git.example.com/project/path.git refs/heads/master | awk \'{print $1 }\'' => 'foo-bar d5b7769852a5faa69574fcd3db0799f4ffbd9eec' + 'git ls-remote ssh://git.example.com/project/path.git refs/heads/main | awk \'{print $1 }\'' => 'foo-bar d5b7769852a5faa69574fcd3db0799f4ffbd9eec' ]; try {