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

Allow to report created github releases #310

Open
szaimen opened this issue Jul 21, 2023 · 7 comments · May be fixed by #314
Open

Allow to report created github releases #310

szaimen opened this issue Jul 21, 2023 · 7 comments · May be fixed by #314

Comments

@szaimen
Copy link

szaimen commented Jul 21, 2023

Hello,

this is a great tool, thank you for creating it! :)

it would be great if it would be possible to track and report github releases that have been created by my account.

Thank you for consideration! :)

@psss
Copy link
Owner

psss commented Aug 9, 2023

Thanks for the feedback, glad that did is helpful! Implementing releases should not be difficult although it seems that the API does not provide much filtering options:

However, all important information (such as uploader or published_at timestamp) seems to be there, for example here's the output for all tmt releases:

Feel free to file a pull request with the new release stats! :)

@psss
Copy link
Owner

psss commented Aug 9, 2023

Other github plugin stats can serve as an inspiration:

did/did/plugins/github.py

Lines 133 to 142 in 101d208

class IssuesCreated(Stats):
""" Issues created """
def fetch(self):
log.info("Searching for issues created by {0}".format(self.user))
query = "search/issues?q=author:{0}+created:{1}..{2}".format(
self.user.login, self.options.since, self.options.until)
query += "+type:issue"
self.stats = [
Issue(issue) for issue in self.parent.github.search(query)]

@szaimen
Copy link
Author

szaimen commented Aug 10, 2023

I see, thanks for the pointers!

Am I right that I would need to recursively query all repositories that the user has access to in order to retreive if they created a new release? How can I do this? Or is there another, better way?

@psss
Copy link
Owner

psss commented Aug 10, 2023

Unfortunately it looks like that. Unless there is another API call which would allow searching across projects. I haven't found one in the list. One way could be to provide a list of active projects in the config. It could look like this:

[github]
type = github
login = psss
url = https://api.github.com/
projects = psss/did, teemtee/fmf, teemtee/tmt

Then we would check only these relevant ones.

@szaimen
Copy link
Author

szaimen commented Aug 10, 2023

One way could be to provide a list of active projects in the config. It could look like this:

[github]
type = github
login = psss
url = https://api.github.com/
projects = psss/did, teemtee/fmf, teemtee/tmt

Then we would check only these relevant ones.

Makes sense 👍

Since I only want to add releaeses logging and not modify existing logic, maybe projects should be named releaseProjects or something so that it is clear that this is only meant for the releases stats or WDYT?

@psss psss changed the title allow to report created github releases Allow to report created github releases Aug 10, 2023
@psss
Copy link
Owner

psss commented Aug 10, 2023

I'd vote for something short, and projects could be possibly useful for other stats as well in the future.

@szaimen
Copy link
Author

szaimen commented Aug 10, 2023

I'd vote for something short, and projects could be possibly useful for other stats as well in the future.

All right

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

Successfully merging a pull request may close this issue.

2 participants