Files
PyGithub/github/tests/ReplayData/Project.testGetProject.txt
T
Yossarian King faca4ce1c0 Add support for projects (#854)
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/projects
https://developer.github.com/v3/projects/columns
https://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
2018-09-11 13:05:16 +08:00

12 lines
2.8 KiB
Plaintext

https
GET
api.github.com
None
/projects/1682941
{'Accept': 'application/vnd.github.inertia-preview+json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('Server', 'GitHub.com'), ('Date', 'Sat, 11 Aug 2018 05:11:57 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4977'), ('X-RateLimit-Reset', '1533965918'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('ETag', 'W/"27943de4706a46a49435f50612ed14a7"'), ('X-OAuth-Scopes', 'repo'), ('X-Accepted-OAuth-Scopes', 'public_repo, repo'), ('X-GitHub-Media-Type', 'github.inertia-preview; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.073652'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DB5F:5AC5:10682C2:21382ED:5B6E701D')]
{"owner_url":"https://api.github.com/repos/bbi-yggy/PyGithub","url":"https://api.github.com/projects/1682941","html_url":"https://github.com/bbi-yggy/PyGithub/projects/1","columns_url":"https://api.github.com/projects/1682941/columns","id":1682941,"node_id":"MDc6UHJvamVjdDE2ODI5NDE=","name":"TestProject","body":"To be used for testing project access API for PyGithub.","number":1,"state":"open","creator":{"login":"bbi-yggy","id":6392037,"node_id":"MDQ6VXNlcjYzOTIwMzc=","avatar_url":"https://avatars3.githubusercontent.com/u/6392037?v=4","gravatar_id":"","url":"https://api.github.com/users/bbi-yggy","html_url":"https://github.com/bbi-yggy","followers_url":"https://api.github.com/users/bbi-yggy/followers","following_url":"https://api.github.com/users/bbi-yggy/following{/other_user}","gists_url":"https://api.github.com/users/bbi-yggy/gists{/gist_id}","starred_url":"https://api.github.com/users/bbi-yggy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbi-yggy/subscriptions","organizations_url":"https://api.github.com/users/bbi-yggy/orgs","repos_url":"https://api.github.com/users/bbi-yggy/repos","events_url":"https://api.github.com/users/bbi-yggy/events{/privacy}","received_events_url":"https://api.github.com/users/bbi-yggy/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T04:06:57Z","updated_at":"2018-08-03T00:31:17Z"}