Skip to content

Commit

Permalink
chore: fix false positive in detecting that yardstick changed (#388)
Browse files Browse the repository at this point in the history
Previously, if "git diff" included the yardstick dependency declaration
in one of the context/unchanged lines, configure.py would request
running the quality gate on every provider. Fix this false positive by
only considering lines with changes in them in the output.

Signed-off-by: Will Murphy <[email protected]>
  • Loading branch information
willmurphyscode authored Nov 7, 2023
1 parent 13a1853 commit 3b3fc2a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/quality/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ def yardstick_version_changed():
# get list of files changed with git diff
changes = subprocess.check_output(["git", "diff", base_ref]).decode("utf-8").splitlines()
for line in changes:
if not line.strip().startswith(("-", "+")):
# this line is in the output of `git diff`, but is just context, not a change
continue

if 'git = "https://github.com/anchore/yardstick"' in line:
return True

Expand Down

0 comments on commit 3b3fc2a

Please sign in to comment.