summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <mclay@redhat.com>2020-12-03 09:19:03 -0800
committerMatt Clay <matt@mystile.com>2020-12-03 10:12:07 -0800
commit94df5ab8e26b1b8cfea87f2dc6e04d34c07ab713 (patch)
tree295daa66bd1d03b66aad417f038207b286040ce4
parentb279a05efa52d3d95d209f3f519b30875d59da54 (diff)
downloadansible-94df5ab8e26b1b8cfea87f2dc6e04d34c07ab713.tar.gz
[stable-2.8] Fix Azure Pipelines change detection. (#72824)
(cherry picked from commit 08842cd6bb0fd6ce3f53b2547993413a5eb6bf10) Co-authored-by: Matt Clay <mclay@redhat.com>
-rw-r--r--changelogs/fragments/ansible-test-azp-change-detection.yml2
-rw-r--r--test/runner/lib/ci/azp.py8
2 files changed, 6 insertions, 4 deletions
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 0000000000..ae69618fa4
--- /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/runner/lib/ci/azp.py b/test/runner/lib/ci/azp.py
index 07cb16034c..b783d1ccfa 100644
--- a/test/runner/lib/ci/azp.py
+++ b/test/runner/lib/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()
- # <rev1>...<rev2>
- # Include commits that are reachable from <rev2> but exclude those that are reachable from <rev1>.
- # see: https://git-scm.com/docs/gitrevisions
- dot_range = '%s..%s' % (self.base_commit, self.commit)
+ # <commit>...<commit>
+ # This form is to view the changes on the branch containing and up to the second <commit>, starting at a common ancestor of both <commit>.
+ # 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])