You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/14 01:18:58 UTC

[GitHub] [airflow] jhtimmins commented on a change in pull request #9270: Add airflow GitHub script

jhtimmins commented on a change in pull request #9270:
URL: https://github.com/apache/airflow/pull/9270#discussion_r439782259



##########
File path: dev/airflow-github
##########
@@ -93,6 +93,32 @@ def get_issue_type(issue):
     return issue_type
 
 
+def get_commit_in_master_associated_with_pr(repo: git.Repo, issue: Issue) -> Optional[str]:
+    """For a PR Get find the associated merged commit & return is SHA"""
+    if issue.pull_request:
+        commit = repo.git.log(f"--grep=#{issue.number}", "origin/master", "--format=%H")
+        if commit:
+            return commit
+        else:
+            pr: PullRequest = issue.as_pull_request()

Review comment:
       this is great. really like this optimization.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org