Skip to content

Commit

Permalink
Support using the merge ref instead of the head ref in a pull request
Browse files Browse the repository at this point in the history
Add merge_commit_sha and mergeable properties to GithubPullRequest class
(and PullRequest superclass).

OGR issue packit#584.

Signed-off-by: Ben Crocker <[email protected]>
  • Loading branch information
bcrocker15 committed Jun 14, 2021
1 parent 79d3a39 commit 066044c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ogr/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ def patch(self) -> bytes:
def head_commit(self) -> str:
raise NotImplementedError

@property
def merge_commit_sha(self) -> str:
raise NotImplementedError

@property
def mergeable(self) -> bool:
raise NotImplementedError

@property
def source_project(self) -> "GitProject":
raise NotImplementedError()
Expand Down
8 changes: 8 additions & 0 deletions ogr/services/github/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ def commits_url(self) -> str:
def head_commit(self) -> str:
return self._raw_pr.head.sha

@property
def merge_commit_sha(self) -> str:
return self._raw_pr.merge_commit_sha

@property
def mergeable(self) -> bool:
return self._raw_pr.mergeable

@property
def source_project(self) -> "ogr_github.GithubProject":
if self._source_project is None:
Expand Down

0 comments on commit 066044c

Please sign in to comment.