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

add first WIP for allowing to get stats about created releases #314

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions did/plugins/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
url = https://api.github.com/
token = <authentication-token>
login = <username>
project = <project1, project2>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
project = <project1, project2>
project = <project1>, <project2>

Let's make it a bit more clear that comma is a project separator here.


The authentication token is optional. However, unauthenticated
queries are limited. For more details see `GitHub API`__ docs.
Expand Down Expand Up @@ -217,6 +218,16 @@ def fetch(self):
self.stats = [
Issue(issue) for issue in self.parent.github.search(query)]

class ReleasesCreated(Stats):
""" Releases created """

def fetch(self):
for project in self.user.projects:
log.info("Searching for releases created by {0} in {1}".format(self.user, project))
query = "repos/{0}/releases?q=author:{1}+created:{2}..{3}".format(
project, self.user.login, self.options.since, self.options.until)
self.stats = [
Releases(release) for release in self.parent.github.search(query)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is seems that you need to define the Release class as well. It could be similar to the Issue class above.


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Stats Group
Expand Down