This is an automated email from the ASF dual-hosted git repository.

snuyanzin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 895b2c5394d [FLINK-40720][ci] Checkout only current branch in Azure
895b2c5394d is described below

commit 895b2c5394dd073fcf9a2f66cfb8fbe9e4138d05
Author: Sergey Nuyanzin <[email protected]>
AuthorDate: Mon Sep 21 21:55:53 2026 +0200

    [FLINK-40720][ci] Checkout only current branch in Azure
---
 tools/azure-pipelines/build-apache-repo.yml      |  2 ++
 tools/azure-pipelines/checkout-single-branch.yml | 26 ++++++++++++++++++++++++
 tools/azure-pipelines/e2e-template.yml           |  1 +
 tools/azure-pipelines/jobs-template.yml          |  3 +++
 4 files changed, 32 insertions(+)

diff --git a/tools/azure-pipelines/build-apache-repo.yml 
b/tools/azure-pipelines/build-apache-repo.yml
index a1b57a2a241..d3339d1de2f 100644
--- a/tools/azure-pipelines/build-apache-repo.yml
+++ b/tools/azure-pipelines/build-apache-repo.yml
@@ -81,6 +81,7 @@ stages:
           vmImage: 'ubuntu-24.04'
         steps:
           # Skip docs check if this is a pull request that doesn't contain a 
documentation change
+          - template: checkout-single-branch.yml
           - task: GoTool@0
             inputs:
               version: '1.18.1'
@@ -170,6 +171,7 @@ stages:
         pool:
           vmImage: 'ubuntu-24.04'
         steps:
+          - template: checkout-single-branch.yml
           - task: GoTool@0
             inputs:
               version: '1.18.1'
diff --git a/tools/azure-pipelines/checkout-single-branch.yml 
b/tools/azure-pipelines/checkout-single-branch.yml
new file mode 100644
index 00000000000..3c8c1828da9
--- /dev/null
+++ b/tools/azure-pipelines/checkout-single-branch.yml
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Fetch only the built ref at full depth: no all-branch/tag sync, but HEAD~N 
diffs still resolve.
+steps:
+  - checkout: none
+  - bash: |
+      set -euo pipefail
+      git init .
+      git config --global --add safe.directory "$PWD"
+      git remote add origin "$(Build.Repository.Uri)"
+      git fetch --no-tags origin "$(Build.SourceBranch)"
+      git checkout --force "$(Build.SourceVersion)"
+    displayName: Checkout single branch (full history)
diff --git a/tools/azure-pipelines/e2e-template.yml 
b/tools/azure-pipelines/e2e-template.yml
index 9db92fbfb42..766ff15671e 100644
--- a/tools/azure-pipelines/e2e-template.yml
+++ b/tools/azure-pipelines/e2e-template.yml
@@ -44,6 +44,7 @@ jobs:
       .gitattributes
       .github/**
   steps:
+    - template: checkout-single-branch.yml
     # Skip e2e test execution if this is a documentation only pull request 
(master / release builds will still be checked regularly)
     - bash: |
         source ./tools/azure-pipelines/build_properties.sh
diff --git a/tools/azure-pipelines/jobs-template.yml 
b/tools/azure-pipelines/jobs-template.yml
index 16f6864838d..ef581724da6 100644
--- a/tools/azure-pipelines/jobs-template.yml
+++ b/tools/azure-pipelines/jobs-template.yml
@@ -36,6 +36,7 @@ jobs:
     # See also 
https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#workspace
 
   steps:
+  - template: checkout-single-branch.yml
   # if on Azure, free up disk space
   - script: ./tools/ci/free_disk_space.sh
     target: host
@@ -90,6 +91,7 @@ jobs:
   workspace:
     clean: all
   steps:
+  - template: checkout-single-branch.yml
   # if on Azure, free up disk space
   - script: ./tools/ci/free_disk_space.sh
     target: host
@@ -135,6 +137,7 @@ jobs:
       misc:
         module: misc
   steps:
+  - template: checkout-single-branch.yml
   # if on Azure, free up disk space
   - script: ./tools/ci/free_disk_space.sh
     target: host

Reply via email to