]> source.dussan.org Git - sonarqube.git/commitdiff
[NO-JIRA] make scm QAs conditional on branch or code change (#8684)
authorSteve Marion <steve.marion@sonarsource.com>
Fri, 23 Jun 2023 12:39:04 +0000 (14:39 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 23 Jun 2023 20:03:17 +0000 (20:03 +0000)
Add condition for gitlab, bitbucket, and azure QA to not run on PR without related code modifications, extend github condition to provisioning code.

.cirrus.yml

index 6ef8e1eb17486fe6a91ddd78fe110bab79e8409d..4612e97123e227b633f95fb6d6851727877d593a 100644 (file)
@@ -34,9 +34,6 @@ cache_dependencies_dependant_task_template: &CACHE_DEPENDENCIES_DEPENDANT_TASK_T
 build_dependant_task_template: &BUILD_DEPENDANT_TASK_TEMPLATE
   depends_on: build
 
-nightly_task_template: &NIGHTLY_TASK_TEMPLATE
-  only_if: $CIRRUS_BRANCH == $BRANCH_NIGHTLY
-
 master_and_nightly_task_template: &MASTER_AND_NIGHTLY_TASK_TEMPLATE
   only_if: $CIRRUS_BRANCH == $BRANCH_NIGHTLY || $CIRRUS_BRANCH == $BRANCH_MAIN
 
@@ -64,7 +61,30 @@ ldap_task_template: &LDAP_TASK_TEMPLATE
 github_task_template: &GITHUB_TASK_TEMPLATE
   only_if: >-
     $CIRRUS_BRANCH == $BRANCH_MAIN || $CIRRUS_BRANCH =~ $BRANCH_PATTERN_MAINTENANCE || $CIRRUS_BRANCH == $BRANCH_NIGHTLY ||
-    changesInclude('private/core-extension-developer-server/src/main/java/com/sonarsource/branch/pr/github/*.java', 'private/it-branch/it-tests/src/test/java/com/sonarsource/branch/it/suite/pr/github/*.java')
+    changesInclude('private/core-extension-developer-server/src/main/java/com/sonarsource/branch/pr/github/**/*.java',
+    'private/core-extension-developer-server/src/main/java/com/sonarsource/github/**/*.java',
+    'private/it-branch/it-tests/src/test/java/com/sonarsource/branch/it/suite/pr/github/**/*.java')
+
+gitlab_task_template: &GITLAB_TASK_TEMPLATE
+  only_if: >-
+    $CIRRUS_BRANCH == $BRANCH_MAIN || $CIRRUS_BRANCH =~ $BRANCH_PATTERN_MAINTENANCE || $CIRRUS_BRANCH == $BRANCH_NIGHTLY ||
+    changesInclude('private/core-extension-developer-server/src/main/java/com/sonarsource/branch/pr/gitlab/**/*.java', 'private/it-branch/it-tests/src/test/java/com/sonarsource/branch/it/suite/pr/gitlab/**/*.java')
+
+azure_task_template: &AZURE_TASK_TEMPLATE
+  only_if: >-
+    $CIRRUS_BRANCH == $BRANCH_MAIN || $CIRRUS_BRANCH =~ $BRANCH_PATTERN_MAINTENANCE || $CIRRUS_BRANCH == $BRANCH_NIGHTLY ||
+    changesInclude('private/core-extension-developer-server/src/main/java/com/sonarsource/branch/pr/azuredevops/**/*.java', 'private/it-branch/it-tests/src/test/java/com/sonarsource/branch/it/suite/pr/azure/**/*.java')
+
+bitbucket_server_task_template: &BITBUCKET_SERVER_TASK_TEMPLATE
+  only_if: >-
+    $CIRRUS_BRANCH == $BRANCH_MAIN || $CIRRUS_BRANCH =~ $BRANCH_PATTERN_MAINTENANCE || $CIRRUS_BRANCH == $BRANCH_NIGHTLY ||
+    changesInclude('private/core-extension-developer-server/src/main/java/com/sonarsource/branch/pr/bitbucketserver/**/*.java', 'private/it-branch/it-tests/src/test/java/com/sonarsource/branch/it/suite/pr/bitbucketserver/**/*.java')
+
+bitbucket_cloud_task_template: &BITBUCKET_CLOUD_TASK_TEMPLATE
+  only_if: >-
+    $CIRRUS_BRANCH == $BRANCH_MAIN || $CIRRUS_BRANCH =~ $BRANCH_PATTERN_MAINTENANCE || $CIRRUS_BRANCH == $BRANCH_NIGHTLY ||
+    changesInclude('private/core-extension-developer-server/src/main/java/com/sonarsource/branch/pr/bitbucket/**/*.java', 'private/it-branch/it-tests/src/test/java/com/sonarsource/branch/it/suite/pr/bitbucketcloud/**/*.java')
+
 
 docker_build_container_template: &CONTAINER_TEMPLATE
   region: eu-central-1
@@ -356,6 +376,7 @@ task: #bitbucket
   <<: *BUILD_DEPENDANT_TASK_TEMPLATE
   <<: *JAR_CACHE_TEMPLATE
   <<: *GRADLE_CACHE_TEMPLATE
+  <<: *BITBUCKET_SERVER_TASK_TEMPLATE
   eks_container:
     <<: *CONTAINER_TEMPLATE
     cpu: 3
@@ -381,6 +402,7 @@ qa_bb_cloud_task:
   <<: *BUILD_DEPENDANT_TASK_TEMPLATE
   <<: *JAR_CACHE_TEMPLATE
   <<: *GRADLE_CACHE_TEMPLATE
+  <<: *BITBUCKET_CLOUD_TASK_TEMPLATE
   eks_container:
     <<: *CONTAINER_TEMPLATE
     cpu: 2.4
@@ -437,6 +459,7 @@ qa_gitlab_task:
   <<: *BUILD_DEPENDANT_TASK_TEMPLATE
   <<: *JAR_CACHE_TEMPLATE
   <<: *GRADLE_CACHE_TEMPLATE
+  <<: *GITLAB_TASK_TEMPLATE
   depends_on:
     - build
   env:
@@ -487,6 +510,7 @@ qa_gitlab_cloud_task:
   <<: *BUILD_DEPENDANT_TASK_TEMPLATE
   <<: *JAR_CACHE_TEMPLATE
   <<: *GRADLE_CACHE_TEMPLATE
+  <<: *GITLAB_TASK_TEMPLATE
   eks_container:
     <<: *CONTAINER_TEMPLATE
     cpu: 2.4
@@ -508,6 +532,7 @@ qa_azure_task:
   <<: *BUILD_DEPENDANT_TASK_TEMPLATE
   <<: *JAR_CACHE_TEMPLATE
   <<: *GRADLE_CACHE_TEMPLATE
+  <<: *AZURE_TASK_TEMPLATE
   eks_container:
     <<: *CONTAINER_TEMPLATE
     cpu: 2.4