Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project board test issue #5 #271

Open
xtuchyna opened this issue Oct 5, 2022 · 2 comments
Open

project board test issue #5 #271

xtuchyna opened this issue Oct 5, 2022 · 2 comments

Comments

@xtuchyna
Copy link
Member

xtuchyna commented Oct 5, 2022

No description provided.

@xtuchyna
Copy link
Member Author

xtuchyna commented Oct 5, 2022

Desc

Attached projects 2 and 3 by using this Issue interface, attached project 1 by using project interface

Token

Using usual github token with project access enabled

project Full control of projects
read:project Read access of projects

Header setup

Using custom header with PyGithub module

def get_project_details_timeline(issue):
        return github.PaginatedList.PaginatedList(
            github.TimelineEvent.TimelineEvent,
            issue._requester,
            f"{issue.url}/timeline",
            None,
            headers={
                "Accept": "application/vnd.github.starfox-preview+json,application/vnd.github.mockingbird-preview"
            },
        )

@xtuchyna
Copy link
Member Author

xtuchyna commented Oct 5, 2022

Result

>>> import github
>>> from github import Github
>>> GITHUB_ACCESS_TOKEN=<token>
>>> gh = Github(login_or_token=GITHUB_ACCESS_TOKEN)
>>> mi = gh.get_repo("thoth-station/srcops-testing")
>>> def get_project_details_timeline(issue):
...         return github.PaginatedList.PaginatedList(
...             github.TimelineEvent.TimelineEvent,
...             issue._requester,
...             f"{issue.url}/timeline",
...             None,
...             headers={
...                 "Accept": "application/vnd.github.starfox-preview+json,application/vnd.github.mockingbird-preview"
...             },
...         )
... 
>>> issue = mi.get_issue(271)
>>> timeline = get_project_details_timeline(issue)
>>> timeline.totalCount
1
>>> timeline[0].event 
'commented'

Which means no success, as the timeline entity does not contain other events (the project related stuff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant