Closed mittal-parth closed 1 month ago
Hey I would like to work on this.
Please assign this to me.
Hi @Shivam164! Thanks for your interest. Can you provide a workflow of how you would be proceeding with this? Thanks!
@mittal-parth first of all I willl have to see how github api works and then I will fetch data related to your open source contribution. Then I will have to make the data dynamic.
Hmm ok, go ahead!
@Shivam164 any updates?
/prbot how
Hello @mittal-parth, I'm studying some ways to implement this feature, and so far I came with some thoughts that I'd like to discuss here.
To fetch my own pull requests for example, we could make the following request
GET https://api.github.com/search/issues?q=is:pr+author:mateusabelli
Here is an example response received back, you may need to create an access token because search queries could be a bit more expensive on GH servers so they can have more limited request rates.
From this data we can have some code that extracts what we need for the frontend. However some data might require a multi-pass stage, like the lines added and removed, for that we can access the diff_url
. Here is an example response from it.
+ Made with 💙 by Parth Mittal & the Open Source Community +
+The major thing that I see here for us to consider, is the data fetching and extraction. The latter seems easier to grasp but the first is tricky. Due to GH rate limits we cannot do the requests inside a React component, it would require some sort of caching.
At the moment I can only think of two options that could solve this without a dedicated backend, using a framework that generates static content at build time or finding a way to implement static generation in Vite. Please let me know what you think.
Hey @mateusabelli, thanks so much for the efforts!
As you mentioned, the GitHub API rate limits at 5,000 requests per hour if we use an access token. For unauthenticated search requests, its limited at 60 requests per hour.
I think 5,000 requests per hour would be sufficient, considering the traffic received on my website 😛
I do not think we require caching as we can just fetch the data once on page load by wrapping it inside the useEffect
hook.
Each user who decides to deploy this for their own website will have to enter their token. Since 5,000 requests are per-user requests, it should suffice.
Hey @mittal-parth I agree with you, depending on the traffic the authenticated rate limits would be enough. I'm sorry I tend to overthink when it comes to data fetching, thank you for the feedback.
I think this is a nice feature and I'd like to work on it, could you assign it to me?
That's ok, always open for discussions! 😄 Assigned!
@mateusabelli would be un-assigning this for someone else to work on. Thanks for all your efforts! :)
@mittal-parth I can try implementing this. I just have some doubts. In your portfolio I noticed that you are showing PRs from two diff repos(zulip, publicLab). Do you want something like that where we show few latest PRs from that repo made from your acc?
hi @A-4-Atom!
Good question.
Yes, I think that can be done. You can set a parameter in the constants file that lets the user define the limit they want from each repo.
Also, keep in mind that this should include all the PRs and issues opened by the person in all repos except the ones owned by him or that are part of his organisation(s).
And maybe, issues can be skipped. I leave it to you. You can either make that also as a parameter.
Thanks!
@mittal-parth I'll start working on it, it might take me some time, as i also have exams goin on.
Currently, the open source contributions have to be manually typed into the
/src/constants/index.js
file.It would be better if we could fetch them automatically using the GitHub API. This should include all the PRs and issues opened by the person in all repos except the ones owned by him or that are part of his organisation(s).
It will need some discussion before proceeding, so feel free to discuss it here!