re: dev.to open source help/discussion thread (v0) VIEW POST

FULL DISCUSSION
 

Hey, I'm looking to start work on

Allow pinning of GitHub organisation projects #243

GitHub Organisation Projects

It would be great if you could pin a GitHub repo from one of your organisations, as well as your personal repositories e.g. I'd like to be able to pin this project on my profile

(on the 13th as I'm still without broadband). Is there anything I need to do outside of the stuff mentioned in getting started? Also, would this make for a decent first issue, as I'm completely new to Ruby on Rails (any good resources would also be cool). Thanks!
 

I wouldn't say this is a particularly simple first Rails issue but since it's yours I think you have the other insight to make it happen.

Basically in the controller we have this defined:

@client = Octokit::Client.
          new(access_token: current_user.identities.where(provider: "github").last.token)

Octokit is the GitHub Ruby wrapper. It's been around a long time and is well-supported.

From here with @client, we currently call an octokit method to look up repos to display in the settings area.

@client.repositories.each do |repo|
...

I imagine to add the org repos, it'll be a matter of finding out what octokit has for that. Maybe they have a flattened way of finding all the repos, but I imagine it could be about sort of traveling up and down the object tree to get them. Hopefully it can be done efficiently.

Good luck, we can help with any bumps!

code of conduct - report abuse