github3.py
github3.py copied to clipboard
Feature request: expose `mergeable` attribute on ShortPullRequest
Today if you dir a ShortPullRequest object you get:
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_api', '_boolean', '_build_url', '_delete', '_get', '_github_url', '_instance_or_null', '_iter', '_json', '_json_data', '_patch', '_post', '_put', '_ratelimit_resource', '_refresh_to', '_remove_none', '_repr', '_request', '_strptime', '_uniq', '_update_attributes', '_uri', '_uri_parse', 'as_dict', 'as_json', 'assignee', 'assignees', 'base', 'body', 'body_html', 'body_text', 'class_name', 'close', 'closed_at', 'comments_url', 'commits', 'commits_url', 'create_comment', 'create_review', 'create_review_comment', 'create_review_requests', 'created_at', 'delete_review_requests', 'diff', 'diff_url', 'etag', 'files', 'from_dict', 'from_json', 'head', 'html_url', 'id', 'is_merged', 'issue', 'issue_comments', 'issue_url', 'last_modified', 'links', 'merge', 'merge_commit_sha', 'merged_at', 'new_session', 'number', 'patch', 'patch_url', 'ratelimit_remaining', 'refresh', 'reopen', 'repository', 'requested_reviewers', 'requested_teams', 'review_comment_urlt', 'review_comments', 'review_comments_url', 'review_requests', 'reviews', 'session', 'state', 'statuses_url', 'title', 'update', 'updated_at', 'url', 'user']
99% certain the mergeable attribute from the API response is marked as being deprecated and unreliable, so I'd rather not
@sigmavirus24 I don´t think so. In fact, in recent documentation is a recommended check before merging:
https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls#get-a-pull-request https://developer.github.com/v3/git/#checking-mergeability-of-pull-requests
Ah I was confusing mergeable with merge_commit_sha. Feel free to send a PR adding this. It should be pretty easy to complete, review, and merge.
@sigmavirus24 I think that is it.. from what I saw in the API, the attribute is really mergeable.