gitpositive icon indicating copy to clipboard operation
gitpositive copied to clipboard

Move to GitHub OAuth from bare GitHub username entry

Open ersascape opened this issue 4 years ago • 13 comments

  • As of now, we only enter the GitHub username to ping the GitHub API and that sends back a basic JSON response that we parse to provide a small and simple profile.
  • But for different usecases like viewing repositories and the names of followers GitHub only sends back the first 30 results, which is not useful.
  • Authenticate via GitHub OAuth since that is required for production apps.

ersascape avatar Oct 01 '21 12:10 ersascape

Hey @gaganmalvi 👋🏼 I was looking into this issue and I understood that GitHub API sends only 30 responses at a time

I checked the GitHub API Docs and found that while fetching repositories data we can set per_page as a query parameter in the URL, which can be set upto 100 results at a time, so we will be getting 100 repos or followers at a time

V9vek avatar Oct 05 '21 05:10 V9vek

But you said to integrate GitHub OAuth for this issue? Is there any particular reason to use oauth?

I guess we can use Paging to fetch data in chunks/pages to solve this issue

Any thoughts or corrections?

V9vek avatar Oct 05 '21 06:10 V9vek

Hey, @V9vek the reason for the auth was we were also planning some post stuff but for now, we will stick to the basic read-only app so yeah u can go ahead with that per_page thing so that users can fetch all repos on screen. If you are interested in taking up this issue, we can assign you

rishuyadav avatar Oct 05 '21 10:10 rishuyadav

@rishuyadav you got me somewhere wrong, as I was saying as of now we can fetch 30 repositories at a time, but with per_page as a query parameter in the URL, which can be set up to 100 results at a time I mean now we can fetch 100 repositories BUT, if someone has more than 100 repositories, those can't be shown

We still can't fetch all repos on screen, but first 100 repos only

Do let me know if you want that upgrade, I will open a pull request so you can check and review it

V9vek avatar Oct 05 '21 11:10 V9vek

@rishuyadav you got me somewhere wrong, as I was saying as of now we can fetch 30 repositories at a time, but with per_page as a query parameter in the URL, which can be set up to 100 results at a time I mean now we can fetch 100 repositories BUT, if someone has more than 100 repositories, those can't be shown

We still can't fetch all repos on screen, but first 100 repos only

Do let me know if you want that upgrade, I will open a pull request so you can check and review it

Yes i got ur point I went through the API documentation also, for now we can move ahead with 100, no probs

rishuyadav avatar Oct 05 '21 11:10 rishuyadav

Hey @V9vek are you working on this issue, we have to fetch 100(max allowed) for each type of data being displayed in app 👍

rishuyadav avatar Oct 06 '21 07:10 rishuyadav

I can write the code for fetching the first 100, but NOT Pagination in which we fetch data in pages/chunks I mean as of now we are seeing only 30 repositories/followers(some data), but afterward we will see 100, but never beyond 100

If you guys want that, I can open a PR regarding the same, do let me know

V9vek avatar Oct 06 '21 10:10 V9vek

Yep sure go ahead, and please do it for the Followers & Following section also 👍

rishuyadav avatar Oct 06 '21 11:10 rishuyadav

Opened a PR #60 Do check it out and run on your devices too But I think Pagination is a better solution for this issue Using Pagination, we can fetch 100 results per page and further beyond 100 in chunks/pages and user can see all its repo/followers/following

Keep this issue open, maybe someone would apply Pagination to it Thanks 🙏🏼 🚀

V9vek avatar Oct 06 '21 11:10 V9vek

Merged the pr, thanks for contributing

rishuyadav avatar Oct 06 '21 11:10 rishuyadav

Do we still need oauth or are we done now? If oauth is to be added then what scope is needed for the future plans of gitpositive(currently it is read only)?

garvsgit avatar Oct 10 '21 22:10 garvsgit

Hi, @rishuyadav, I can contribute to implement pagination in the app. Can you please assign a me this/new issue for the same?

Devendra34 avatar Oct 24 '21 05:10 Devendra34

Thanks @rishuyadav for assigning it to me. I found that pagination was already implemented but not in a standard way. I have opened #76 by updating the implementation using Jetpack's paging library and also fixed the progress bar issue(I found that progess bar was not shown before initial load).

Devendra34 avatar Oct 25 '21 21:10 Devendra34