The function create_git_tag_and_release had no docstring, so it didn't
appear anywhere in our docs. Add a short one linking to the two methods
it calls.
Fixes#1402
Add a new class, Deployment to describe a deployment performed utilising
GitHub. Add three methods onto Repository to list them and create them.
Fixes#1117
Repository.create_git_tag_and_release() is a convience function that
creates a git tag and then a release. It was not passing the SHA1 of the
commit to the release function, resulting in incorrect releases.
Fixes#1336
The POST parameters passed to the create_project API call did not
consider the body optional, and always included it. Fix up a formatting
error in the docstring for good measure.
Fixes#1357
* Support for create_fork
http://developer.github.com/v3/repos/forks
* Add test case for create_fork
* Add param doc and fix extra line
* Specify the organization to increase line coverage
* Update test data
* Add type assert for organization param
Repository.get_contents() and Repository.get_dir_contents() call the
same endpoint, with slightly different error handling, and with the
difference that get_dir_contents() throws an odd exception if you call
it with a file. get_contents() already even handles being called for a
directory anyway, so deprecate get_dir_contents(), and refactor the code
so the tests pass.
Fixes#1283
If a byte object (for Python 3) was passed into either create_file or
update_file, it was attempted to be co-erced into a bytearray, which
failed. Check for encoded content before we encode it into bytes and
then base64 encode it.
Fixes#1266
* Jump from notifications to related PRs/issues.
* Add test case for jumping to related PRs/issues.
Also another method to get notifications scoped to a repository,
otherwise it's hard to keep out sensitive information from the test
cases.
* Add functions about automated security fixes and vulnerability alerts
* Refine methods and add unit test
* Add record
* Update record file - change user name
* Add get vulnerability alert function
* Fix typo
* Create file for testCreateFile
* Add tests
* Add unit test
* Simplify assert statement
Since the only part of the Legacy submodule that is used and tested is
the transform issue function, refactor it into a Repository method and
delete it.
Clean up a few errors I missed, ignore another, and configure flake8 using
a config file to ignore certain errors. The next step would be to remove
the F* ignores.
With the Python 2.7 deadline fast approaching, modernize the codebase
making use of the modernize module to switch to using six, as well as
other upcoming features, such as absolute imports . Stop using 2to3
for Travis, yay!
The path requested in Repository.get_contents() is appended to the URL,
so the root path should be requested with the empty string. If path is
'/', set it to the empty string. Copy the replay data from the original
test, since it is identical.
Drive-by renaming the test to include the missing 's'.
Closes#1059
Added support for the traffic endpoints found at https://developer.github.com/v3/repos/traffic/.
We added four functions to the Repository class (one for each of the endpoints) with corresponding unit tests.
Fixes#926
## Changes
- Add `affiliation` parameter to `get_collaborators()` and use it to filter collaborators through the API
- Resolves#937
PS: Would have loved to add a simple test for this but there seems to be a problem on my end using OAuth as I'm just not able to authenticate to the API during tests.
Wraps the parts of the notification API that allows the user to mark notifications as read.
New methods are :
- Notification.mark_as_read : marks a single notification thread as read
- Repository.mark_notifications_as_read : marks all the notifications for a given repository as read
- AuthenticatedUser.mark_notifications_as_read : marks all the notifications as read
Aims to fix : https://github.com/PyGithub/PyGithub/issues/571 and simply uses the APIs described on this page : https://developer.github.com/enterprise/11.10.340/v3/activity/notifications/
A weird thing I noticed doing this is that Repository.notifications_url doesn't seem to be usable directly. I used Repository.url + "/notifications" instead.
* Add a trailing slash to URL when updating or deleting a file.
* Update test files to match new create/update/delete_file Repo methods
* Add trailing slash to get_contents() method
* update tests
* add missing slash in get_dir_contents
* add example usage
* remove dup slashes in tests
* clarify example comments
Initial solution for [PyGithub support for projects](https://github.com/PyGithub/PyGithub/issues/606) (#606). Adds comprehensive project querying API.
Currently does not support for modifying projects, columns or cards. (I only need this interface for reporting purposes. Of course once I'm done others are more than welcome to add additional features!)
API that was integrated:
https://developer.github.com/v3/projectshttps://developer.github.com/v3/projects/columnshttps://developer.github.com/v3/projects/cards
Note that the Github project API is in preview mode - it requires a special header in order for requests to be processed, and the API is subject to change without notice.
## Summary
- new classes: Project, ProjectColumn, ProjectCard
- add Organization.get_projects method
- add Repository.get_projects method
- add MainClass.get_project method
- add test cases to exercise all new classes and methods and verify attributes are as expected; replay data is included, recorded (mostly) from my fork of PyGithub
- updated add_attribute script to:
- use makeXXXAttribute API
- be able to add to the end of the current set of properties
- handle both Completable and NonCompletable class types correctly
## Checklist
Not to be merged until these are done:
- [x] remaining Project properties
- [x] remaining ProjectColumn properties
- [x] remaining ProjectCard properties
- [x] support for archived_state parameter when getting cards: all,archived, or not_archived
- [x] get issue from card, not just pull request ("get_content" method?)
- [x] centralize header management for "preview" access to projects API
- [x] add test for retrieving organization projects
- [x] add test for getting issue / pull request content from card
Add a method to Repository, collaborator_permission that allows users
with push access to repositories to query the permission level of
collaborators.
Fixes#722
See Issue #855
The class [IssueEvent](https://github.com/PyGithub/PyGithub/blob/master/github/IssueEvent.py) is missing a large number of attributes documented in the [API](https://developer.github.com/v3/issues/events/).
This is also commented about in #653 to a degree
27 of the tests 27 known event types have tests.
**Currently Tested using Issue #30**
- [x] subscribed
- [x] assigned
- [x] referenced
- [x] closed
- [x] labeled
**Currently Tested using Issue/PR #538**
- [x] merged
- [x] mentioned
- [x] review_requested
**Currently Tested using Issue/PR #857**
- [x] reopened
- [x] unassigned
- [x] unlabeled
- [x] renamed
- [x] base_ref_changed
- [x] head_ref_deleted
- [x] head_ref_restored
- [x] milestoned
- [x] demilestoned
- [x] locked
- [x] unlocked
- [x] review_dismissed
- [x] review_request_removed
- [x] marked_as_duplicate
- [x] unmarked_as_duplicate
- [x] added_to_project
- [x] moved_columns_in_project
- [x] removed_from_project
- [x] converted_note_to_issue - Note: this event is tied into Issue #866
This PR is now ready to be merged
With both the custom Accept header and the new code that supports the
new Branch Protection API, Repository.get_protected_branch() is no
longer required, and it also was never tested, so remove it.
The Branch protection API has been radically changed by GitHub, add new
methods to Branch reflecting it. Branch protection methods are now
called on the Branch object itself, rather than awkwardly hanging off
the Repository object and requiring branch names to be passed in.
This adds an over-arching methods to get, edit and remove protection
entirely, as well as fine-grained methods for getting, setting and
dropping certain aspects of branch protection, as well as three new
objects to encompass querying those aspects.
This also destroys Repository.protect_branch(), the endpoint has been
removed. The old-style protection attributes on Branch have also been
removed to force users onto the new API, since they are still sent, but
no longer populated.
Fixes#586