Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/azure-pipelines/build-apache-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -170,6 +171,7 @@ stages:
pool:
vmImage: 'ubuntu-24.04'
steps:
- template: checkout-single-branch.yml
- task: GoTool@0
inputs:
version: '1.18.1'
Expand Down
26 changes: 26 additions & 0 deletions tools/azure-pipelines/checkout-single-branch.yml
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions tools/azure-pipelines/e2e-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tools/azure-pipelines/jobs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down