Git Product home page Git Product logo

Comments (3)

AloisMahdal avatar AloisMahdal commented on July 16, 2024

I have looked into this a bit, and unfortunately it's more complicated than I expected so had to give up for now. However, what I've found out about events in GitHub API:

  • https://github.com/AloisMahdal/events seems to be the right endpoint.
  • The endpoint does not support date range querying, so returned data would have to be filtered in the plugin. (Dates returned by GitHub API are ISO 8601 in UTC zero, eg. 2016-05-24T12:32:59Z.)
  • The list is limited to last 90 days/300 events, so they are not suitable for longer, eg. yearly reports.
  • There are currently 25 types of events; however, I believe 2-5 should suffice (Issue comment, Commit comment, PR Review comment, maybe fork and/or create...)

from did.

mfrodl avatar mfrodl commented on July 16, 2024

There is a way to find a user's events even beyond these limits. However, we must know (1) what kind of events we are looking for, and (2) where exactly to look for them.

For instance, this request will fetch all comments on issues (including pull requests) in the psss/did repository:

Pagination is fully supported (unlike with events), so one can e.g. find issue comments no. 101 by 200 (sorted by creation time):

Similarly, commit comments can be fetched by:

This should be pull request review comments (although it is empty for this particular repository):

I have not found a way to limit the search to a specific user. That entails transferring possibly much larger data volumes, especially in the case of big repositories with many active contributors. Whether this might lead to significant performance regressions, I dare not say.

In order to make the above work, did must know which repositories to look into. This could be defined in the config file, e.g.

[github]
type = github
url = https://api.github.com/
token = <token>
repos = psss/did, sosreport/sos, scikit-learn/scikit-learn

Such a solution would happen to resolve issue #86 too.

Any thoughts on this?

from did.

AloisMahdal avatar AloisMahdal commented on July 16, 2024

Nice work!

Adding the repos = seems to me as way to go, even I kinda missed the filtering.

Regarding the performance, this is hard to say. Certainly some repos could have loads and loads of comments so the hit could be significant.

On the other hand issue/review comments are relevant (no less than eg. Bugzilla comments), and since to make this work user would have to set the repos= key, at least it won't take them by surprise and they have way to control it. Plus, there could be also another key to limit event types so that people could further optimize settings to their needs.

Seems worth trying.

from did.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.