From 5b4a5beb623c23654f5b0d90517899352834abee Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 29 Aug 2024 08:00:04 +1000 Subject: [PATCH] [#1380] Added `bugfix/*` as allowed branch for deployments. --- .circleci/config.yml | 3 ++- .github/workflows/scaffold-test-common.yml | 1 + docs/deployment.md | 8 ++++---- tests/phpunit/CircleCiConfigTest.php | 20 ++++++++++++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e902e8905..ed380b98f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -568,11 +568,12 @@ workflows: # - project/description # - deps/* # - feature/description, feature/123-description + # - bugfix/description, bugfix/123-description # - release/123.456.789, release/123.456.789-rc.123 (per https://semver.org/) # - release/2023-04-17, release/2023-04-17.123 (date-based) # - hotfix/123.456.789, hotfix/123.456.789-rc.1213 (per https://semver.org/) # - hotfix/2023-04-17, hotfix/2023-04-17.123 (date-based) - only: /^(production|main|master|develop)$|^project\/[a-zA-z0-9\-\.]+|^feature\/[a-zA-Z0-9\-\.\,_]+$|^ci.*|^deps\/.*|^(release|hotfix)\/[0-9]+(\.[0-9]+){2}(-rc\.[0-9]+)?$|^(release|hotfix)\/[0-9]{4}-[0-9]{2}-[0-9]{2}(\.[0-9]+)?$/ + only: /^(production|main|master|develop)$|^project\/[a-zA-z0-9\-\.]+|^(feature|bugfix)\/[a-zA-Z0-9\-\.\,_]+$|^ci.*|^deps\/.*|^(release|hotfix)\/[0-9]+(\.[0-9]+){2}(-rc\.[0-9]+)?$|^(release|hotfix)\/[0-9]{4}-[0-9]{2}-[0-9]{2}(\.[0-9]+)?$/ tags: ignore: /.*/ - deploy-tags: diff --git a/.github/workflows/scaffold-test-common.yml b/.github/workflows/scaffold-test-common.yml index bfb803a1d..6d6680c34 100644 --- a/.github/workflows/scaffold-test-common.yml +++ b/.github/workflows/scaffold-test-common.yml @@ -9,6 +9,7 @@ on: branches: - develop - 'feature/**' + - 'bugfix/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/docs/deployment.md b/docs/deployment.md index da3d85f97..08e136039 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -60,8 +60,8 @@ below). 3. Creates a deployment artifact (project files to be pushed to Acquia Cloud repository). 4. Pushes created artifact to the Acquia Cloud repository: - - for feature-based branches (i.e. `feature/ABC-123`) the code is pushed to - the branch with exactly the same name. + - for feature-based branches (i.e. `feature/ABC-123` or `bugfix/ABC-123`) + the code is pushed to the branch with exactly the same name. - for release deployments, which are tag-based (i.e. `0.1.4`), the code is pushed to the branch `deployment/[tag]` (i.e. `deployment/0.1.4`). 4. Acquia Cloud picks up recent push to the repository and @@ -96,8 +96,8 @@ followed by all developers: for project Technical Lead and Deployer user. 2. There should be no pushes to Acquia Cloud repository. 3. There may be `main` or `develop` branch in Acquia Cloud repository. -4. Technical Lead is expected to regularly cleanup `feature/*` branches in - Acquia Cloud repository. +4. Technical Lead is expected to regularly cleanup `feature/*` and `bugfix/*` + branches in Acquia Cloud repository. [//]: # (#;> ACQUIA) diff --git a/tests/phpunit/CircleCiConfigTest.php b/tests/phpunit/CircleCiConfigTest.php index 207b87ef4..9047a7813 100644 --- a/tests/phpunit/CircleCiConfigTest.php +++ b/tests/phpunit/CircleCiConfigTest.php @@ -94,6 +94,23 @@ public static function dataProviderDeployBranchRegex(): array { ['feature/0.1.x-description'], ['feature/0.1.2.x-description'], + ['bugfix/description'], + ['bugfix/Description'], + ['bugfix/Description-With-Hyphens'], + ['bugfix/Description-With_Underscores'], + ['bugfix/123-description'], + ['bugfix/123-Description'], + ['bugfix/UNDERSCORES_UNDERSCORES'], + ['bugfix/123-Description-With_UNDERSCORES'], + ['bugfix/1.x'], + ['bugfix/0.x'], + ['bugfix/0.1.x'], + ['bugfix/0.1.2.x'], + ['bugfix/1.x-description'], + ['bugfix/0.x-description'], + ['bugfix/0.1.x-description'], + ['bugfix/0.1.2.x-description'], + ['project/description'], ['project/Description'], ['project/Description-With-Hyphens'], @@ -183,12 +200,15 @@ public static function dataProviderDeployBranchRegex(): array { ['hotfix/123.456.789-rc.123-something', FALSE], ['prefeature/something', FALSE], + ['prefbugfix/something', FALSE], ['prerelease/something', FALSE], ['prehotfix/something', FALSE], ['featurepost/something', FALSE], + ['bugfixpost/something', FALSE], ['releasepost/something', FALSE], ['hotfixpost/something', FALSE], ['prefeaturepost/something', FALSE], + ['prebugfixpost/something', FALSE], ['prereleasepost/something', FALSE], ['prehotfixpost/something', FALSE], ['preproject/something', FALSE],