Now that GitHub have moved their documentation from
developer.github.com, we should update our links. I have also tried to
update the call strings to their new format, but since it was done via
regex, some of them may not match exactly.
* Adding attributes "maintain" and "triage" to class "github.Permissions.Permissions"
* Fix for failed test due to extended attribute list
* Adding new simplistic test case for class Permissions
Fixes#1809
Since GitHub has the bad manners to return bare strings for some API
endpoints, one sharp edge has been that JSON decoding errors were masked
since we wrap the string in a dictionary. However, this makes it
difficult to debug malformed JSON in replay data, so re-raise the
exception if the first character is a { or [ (IE, it's an object or
list.)
Both CheckSuite and Commit have a get_check_runs() method that allows
filtering by a string -- the original code did not check for it, and
never added it to the query string since it checked the wrong variable.
Check the right variable and re-record the replay data.
Fixes#1843
The assertions in github.Project.edit looked like the result of a bad
copy-paste operation: they were all making assertions about the `name`
parameter. This commit fixes them so they are checking different parameters.
Authenticating via client_id and client_secret is dangerous, since they
appended to the query string, and can be easily seen from the URL.
client_id/client_secret have been deprecated since May 2020, and ignored
by GitHub since late 2020, so it's high time they were removed.
Since the headers that led to an exception are also useful, firstly pass
them into the constructor, and then export them in a property. Test one
specific use case to make sure of coverage.
Fixes#1814
When a previous commit added support for creating secrets on repository
objects, support was not added to also remove them. Since the GitHub API
does support that, add a method to do so.
requests has a default connections pool of 10. Creating multiple threads
will consume from that same pool, since the underlying implementation of
the requests pool is a singletown.
Let's make the pool_size configurable, so clients can set the proper
number for their use case when running multiple threads.
Signed-off-by: Amador Pahim <apahim@redhat.com>
* Add initial support for Check Suites
* Add API call detail in CheckSuite.rerequest
* Update Accept header with general instead of preview
* Add 'get check runs' endpoint for CheckSuite with stubs
* Add create check suite endpoint with stub
* Update CheckSuite tests with creat check suite endpoint
* Add update check suites preferences endpoint
* Add repository preferences object and stub file
* Add update check suite preferences tests
Needed for #1621
Co-authored-by: Raju Subramanian <coder@mahesh.net>
* Add missing preview features of Deployment and Deployment Statuses API
- Enable support for deployment status states in_progress and queued
- Add arguments production_environment and transient_environment to Repository.create_deployment()
- Add attributes production_environment and transient_environment to Deployment
- Use correct type in assertion for Deployment.payload
- Fix incorrect assertion for description in Deployment.create_status()
- Add arguments environment, environment_url, auto_inactive to Deployment.create_status()
- Add attribute environment_url to DeploymentStatus
* Add CheckRun object and stub file
* Add list of check runs endpoint for Commit
* Add get check run endpoint for Repository
* Add CheckRun test file and replay data files
* Add CheckRunAnnotation object and stub file
* Add create CheckRun API endpoint to Repository
* Update and add new tests for CheckRun endpoint:
There are two get_installation() methods in MainClass, with different
arguments. get_installation(owner, repo) is documented and tested, and
get_installation(id) is neither. Remove it to avoid confusion.
Black is very opinionated, but sometimes those opinions change. Run the
new black version across the codebase, and lock down the version used by
pre-commit so we don't get surprised like this again.
When calculating totalCount for PaginatedList, if the links data does
not contain a last page, we can't know how many elements are contained
in the list. Set it to 0 in that case.
Fixes#1614
It turns out if an argument is optional for an overloaded method, the
type hints require the default argument specified to successfully match
against the correct signature. Furthermore, the second kind of
create_pull() does not support the draft argument at all, so remove it.
Fixes#1634