Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ddev testable command to properly use the tag, fallback on the branch if absent. #4775

Merged
merged 1 commit into from
Oct 15, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,14 @@ def testable(ctx, start_id, agent_version, milestone, dry_run):
echo_info('Branch `{}` will be compared to `master`.'.format(current_release_branch))

echo_waiting('Getting diff... ', nl=False)
diif_command = 'git --no-pager log "--pretty=format:%H %s" {}..master'
diff_command = 'git --no-pager log "--pretty=format:%H %s" {}..master'

with chdir(root):
result = run_command(diif_command.format(current_release_branch), capture=True)
# compare with the local tag first
reftag = '{}{}'.format('refs/tags/', current_release_branch)
result = run_command(diff_command.format(reftag), capture=True)
if result.code:
# if it didn't work, compare with a branch.
origin_release_branch = 'origin/{}'.format(current_release_branch)
echo_failure('failed!')
echo_waiting(
Expand All @@ -297,9 +300,9 @@ def testable(ctx, start_id, agent_version, milestone, dry_run):
nl=False,
)

result = run_command(diif_command.format(origin_release_branch), capture=True)
result = run_command(diff_command.format(origin_release_branch), capture=True)
if result.code:
abort('Unable to get the diif.')
abort('Unable to get the diff.')
else:
echo_success('success!')
else:
Expand Down