Enable shallow clones and lightweight checkouts everywhere

This brings us in line with the internal CI

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Change-Id: Iddd1758be9f2b36b4bb79be36942f6fd56faf182
diff --git a/mbed-tls-framework-multibranch.yaml b/mbed-tls-framework-multibranch.yaml
index c074fa6..fd5173d 100644
--- a/mbed-tls-framework-multibranch.yaml
+++ b/mbed-tls-framework-multibranch.yaml
@@ -21,6 +21,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -51,6 +59,9 @@
         property-strategies:
           all-branches:
           - pipeline-branch-durability-override: performance-optimized
+        shallow-clone: true
+        do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-framework-restricted-ci-testing.yaml b/mbed-tls-framework-restricted-ci-testing.yaml
index 5b637b5..2f1400f 100644
--- a/mbed-tls-framework-restricted-ci-testing.yaml
+++ b/mbed-tls-framework-restricted-ci-testing.yaml
@@ -21,6 +21,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -56,6 +64,7 @@
               branch-regex: '^$'
         shallow-clone: true
         do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-framework-restricted-multibranch.yaml b/mbed-tls-framework-restricted-multibranch.yaml
index bd727e8..2a7a122 100644
--- a/mbed-tls-framework-restricted-multibranch.yaml
+++ b/mbed-tls-framework-restricted-multibranch.yaml
@@ -21,6 +21,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -51,6 +59,9 @@
         property-strategies:
           all-branches:
           - pipeline-branch-durability-override: performance-optimized
+        shallow-clone: true
+        do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-nightly-tests.yaml b/mbed-tls-nightly-tests.yaml
index f8c2daa..b27c730 100644
--- a/mbed-tls-nightly-tests.yaml
+++ b/mbed-tls-nightly-tests.yaml
@@ -72,6 +72,9 @@
           - main
           credentials-id: mbedtls-github-ssh
           url: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
+          shallow-clone: true
+          do-not-fetch-tags: true
+          honor-refspec: true
       script-path: vars/mbedtls-release-Jenkinsfile
     project-type: pipeline
     properties:
diff --git a/mbed-tls-pr-head.yaml b/mbed-tls-pr-head.yaml
index 0a493c0..3a09d47 100644
--- a/mbed-tls-pr-head.yaml
+++ b/mbed-tls-pr-head.yaml
@@ -21,6 +21,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -51,6 +59,9 @@
         property-strategies:
           all-branches:
           - pipeline-branch-durability-override: performance-optimized
+        shallow-clone: true
+        do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-pr-merge.yaml b/mbed-tls-pr-merge.yaml
index cb72059..4c3a597 100644
--- a/mbed-tls-pr-merge.yaml
+++ b/mbed-tls-pr-merge.yaml
@@ -21,6 +21,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -51,6 +59,9 @@
         property-strategies:
           all-branches:
           - pipeline-branch-durability-override: performance-optimized
+        shallow-clone: true
+        do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-restricted-pr-ci-testing.yaml b/mbed-tls-restricted-pr-ci-testing.yaml
index 1203b5e..ec48dbe 100644
--- a/mbed-tls-restricted-pr-ci-testing.yaml
+++ b/mbed-tls-restricted-pr-ci-testing.yaml
@@ -18,6 +18,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -50,6 +58,7 @@
               branch-regex: '^$'
         shallow-clone: true
         do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-restricted-pr-test-parametrized.yaml b/mbed-tls-restricted-pr-test-parametrized.yaml
index af89e15..a71945a 100644
--- a/mbed-tls-restricted-pr-test-parametrized.yaml
+++ b/mbed-tls-restricted-pr-test-parametrized.yaml
@@ -73,12 +73,15 @@
         default: main
         trim: true
     pipeline-scm:
-      lightweight-checkout: false
+      lightweight-checkout: true
       scm:
       - git:
           branches:
           - ${TEST_BRANCH}
           credentials-id: mbedtls-github-ssh
+          shallow-clone: true
+          do-not-fetch-tags: true
+          honor-refspec: true
           url: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
       script-path: vars/mbedtls-pr-test-Jenkinsfile
     project-type: pipeline
diff --git a/mbed-tls-restricted-pr.yaml b/mbed-tls-restricted-pr.yaml
index 3e24aff..152b7e1 100644
--- a/mbed-tls-restricted-pr.yaml
+++ b/mbed-tls-restricted-pr.yaml
@@ -20,6 +20,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -50,6 +58,9 @@
         property-strategies:
           all-branches:
           - pipeline-branch-durability-override: performance-optimized
+        shallow-clone: true
+        do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-tf-psa-crypto-multibranch.yaml b/mbed-tls-tf-psa-crypto-multibranch.yaml
index 06fb67e..9ff77f3 100644
--- a/mbed-tls-tf-psa-crypto-multibranch.yaml
+++ b/mbed-tls-tf-psa-crypto-multibranch.yaml
@@ -21,6 +21,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -51,6 +59,9 @@
         property-strategies:
           all-branches:
           - pipeline-branch-durability-override: performance-optimized
+        shallow-clone: true
+        do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-tf-psa-crypto-restricted-ci-testing.yaml b/mbed-tls-tf-psa-crypto-restricted-ci-testing.yaml
index 875996b..ed0cde4 100644
--- a/mbed-tls-tf-psa-crypto-restricted-ci-testing.yaml
+++ b/mbed-tls-tf-psa-crypto-restricted-ci-testing.yaml
@@ -21,6 +21,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -56,6 +64,7 @@
               branch-regex: '^$'
         shallow-clone: true
         do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbed-tls-tf-psa-crypto-restricted-multibranch.yaml b/mbed-tls-tf-psa-crypto-restricted-multibranch.yaml
index 674023f..04c435b 100644
--- a/mbed-tls-tf-psa-crypto-restricted-multibranch.yaml
+++ b/mbed-tls-tf-psa-crypto-restricted-multibranch.yaml
@@ -21,6 +21,14 @@
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
                       <traits>
+                        <jenkins.plugins.git.traits.CloneOptionTrait plugin="git@5.2.1">
+                          <extension class="hudson.plugins.git.extensions.impl.CloneOption">
+                          <shallow>true</shallow>
+                          <noTags>true</noTags>
+                          <reference/>
+                          <honorRefspec>true</honorRefspec>
+                        </extension>
+                        </jenkins.plugins.git.traits.CloneOptionTrait>
                         <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
                           <credentialsId>mbedtls-github-ssh</credentialsId>
                         </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
@@ -51,6 +59,9 @@
         property-strategies:
           all-branches:
           - pipeline-branch-durability-override: performance-optimized
+        shallow-clone: true
+        do-not-fetch-tags: true
+        honor-refspec: true
         submodule:
           disable: true
         ssh-checkout:
diff --git a/mbedtls-gather-timestamps.yaml b/mbedtls-gather-timestamps.yaml
index eb8268c..926d66e 100644
--- a/mbedtls-gather-timestamps.yaml
+++ b/mbedtls-gather-timestamps.yaml
@@ -10,6 +10,9 @@
           branches:
           - main
           credentials-id: mbedtls-github-ssh
+          shallow-clone: true
+          do-not-fetch-tags: true
+          honor-refspec: true
           url: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
       script-path: vars/mbedtls-gather-timestamps-Jenkinsfile
     project-type: pipeline
diff --git a/mbedtls-release-ci-testing.yaml b/mbedtls-release-ci-testing.yaml
index 9a40c75..ebf2418 100644
--- a/mbedtls-release-ci-testing.yaml
+++ b/mbedtls-release-ci-testing.yaml
@@ -82,12 +82,15 @@
         default: ''
         trim: true
     pipeline-scm:
-      lightweight-checkout: false
+      lightweight-checkout: true
       scm:
       - git:
           branches:
           - ${TEST_BRANCH}
           credentials-id: mbedtls-github-ssh
+          shallow-clone: true
+          do-not-fetch-tags: true
+          honor-refspec: true
           url: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
       script-path: vars/mbedtls-release-Jenkinsfile
     project-type: pipeline
diff --git a/mbedtls-restricted-release-new.yaml b/mbedtls-restricted-release-new.yaml
index a9f2e8f..8bba230 100644
--- a/mbedtls-restricted-release-new.yaml
+++ b/mbedtls-restricted-release-new.yaml
@@ -67,6 +67,9 @@
           branches:
           - main
           credentials-id: mbedtls-github-ssh
+          shallow-clone: true
+          do-not-fetch-tags: true
+          honor-refspec: true
           url: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
       script-path: vars/mbedtls-release-Jenkinsfile
     project-type: pipeline