From 08842cd6bb0fd6ce3f53b2547993413a5eb6bf10 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 3 Dec 2020 09:19:03 -0800 Subject: [PATCH] Fix Azure Pipelines change detection. (#72824) --- .../fragments/ansible-test-azp-change-detection.yml | 2 ++ test/lib/ansible_test/_internal/ci/azp.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/ansible-test-azp-change-detection.yml diff --git a/changelogs/fragments/ansible-test-azp-change-detection.yml b/changelogs/fragments/ansible-test-azp-change-detection.yml new file mode 100644 index 00000000000..ae69618fa43 --- /dev/null +++ b/changelogs/fragments/ansible-test-azp-change-detection.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test - Correctly detect changes in a GitHub pull request when running on Azure Pipelines. diff --git a/test/lib/ansible_test/_internal/ci/azp.py b/test/lib/ansible_test/_internal/ci/azp.py index 962e838e7c5..f2a9d206cc7 100644 --- a/test/lib/ansible_test/_internal/ci/azp.py +++ b/test/lib/ansible_test/_internal/ci/azp.py @@ -208,10 +208,10 @@ class AzurePipelinesChanges: if self.base_commit: self.base_commit = self.git.run_git(['rev-parse', self.base_commit]).strip() - # ... - # Include commits that are reachable from but exclude those that are reachable from . - # see: https://git-scm.com/docs/gitrevisions - dot_range = '%s..%s' % (self.base_commit, self.commit) + # ... + # This form is to view the changes on the branch containing and up to the second , starting at a common ancestor of both . + # see: https://git-scm.com/docs/git-diff + dot_range = '%s...%s' % (self.base_commit, self.commit) self.paths = sorted(self.git.get_diff_names([dot_range])) self.diff = self.git.get_diff([dot_range])