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

PHOENIX-6316 : git_jira_fix_version_check.py should identify fixed Jira without any commit #1091

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 10 additions & 0 deletions dev/misc_utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ messages with any of these issues:
3. Jira does not have expected fixVersion
4. Jira has expected fixVersion, but it is not yet resolved

Moreover, this script also finds any resolved Jira with expected
fixVersion but without any corresponding commit present.

This should be useful as part of RC preparation.

git_jira_fix_version_check supports python3 and it required
Expand Down Expand Up @@ -102,6 +105,13 @@ Found first commit hash after which git history is redundant. commit: 02d5935cbb
Exiting successfully
Jira/Git commit message diff completed: ##############################################

Any resolved Jira with fixVersion 4.16.0 but corresponding commit not present
Starting diff: ##############################################
PHOENIX-6259 is marked resolved with fixVersion 4.16.0 but no corresponding commit found
PHOENIX-6258 is marked resolved with fixVersion 4.16.0 but no corresponding commit found
PHOENIX-6255 is marked resolved with fixVersion 4.16.0 but no corresponding commit found
Completed diff: ##############################################


```

Expand Down
20 changes: 18 additions & 2 deletions dev/misc_utils/git_jira_fix_version_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

print('\nJira/Git commit message diff starting: ##############################################')

issue_set_from_commit_msg = set()

for commit in subprocess.check_output(['git', 'log', '--pretty=oneline']).decode(
"utf-8").splitlines():
if commit.startswith(first_exclude_commit_hash):
Expand Down Expand Up @@ -77,12 +79,26 @@
if not expected_fix_version:
print("Jira not present with version: " + fix_version + ". \t Commit: " + commit)
continue
if issue.fields.resolution is None or issue.fields.resolution.name != 'Fixed':
if issue.fields.status is None or issue.fields.status.name not in ('Resolved', 'Closed'):
print("Jira is not resolved yet? \t\t Commit: " + commit)
else:
# This means Jira corresponding to current commit message is resolved with expected
# fixVersion.
# This is no-op by default, if needed, convert to print statement.
pass
issue_set_from_commit_msg.add(project_jira_key + jira_num)

print('Jira/Git commit message diff completed: ##############################################')

print('\nAny resolved Jira with fixVersion ' + fix_version
+ ' but corresponding commit not present')
print('Starting diff: ##############################################')
all_issues_with_fix_version = jira.search_issues(
'project=' + jira_project_name + ' and status in (Resolved,Closed) and fixVersion='
+ fix_version)

for issue in all_issues_with_fix_version:
if issue.key not in issue_set_from_commit_msg:
print(issue.key + ' is marked resolved with fixVersion ' + fix_version
+ ' but no corresponding commit found')

print('Completed diff: ##############################################')