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

Add featured pull requests to team profile cards with GitHub REST API #28

Open
jwflory opened this issue Oct 19, 2021 · 11 comments
Open
Labels
C: design thinking Planning and creative thinking about design elements in new features or improvements T: new change Adds new capabilities or functionality

Comments

@jwflory
Copy link
Member

jwflory commented Oct 19, 2021

Summary

Provide a list of GitHub Pull Request URLs in team profile front matter, and add metadata about the Pull Requests to the team profile (by way of GitHub REST API)

Background

Is the improvement related to a problem? Describe the problem: Sometimes there are noteworthy Pull Requests we want to highlight by a specific Innovation Fund start-up. This can happen when a start-up implements a major feature as part of their roadmaps, or if they make an upstream contribution to another Open Source project. This is related to the design of team profiles (#13).

What does the improvement look like to you?: Previous wireframe designs suggested something like this for the summarized "card" view and the full team profile:

Profile card with summarized/condensed information

Full team profile with expanded information for a pull request(s)

Describe any alternatives considered: This information could be manually embedded on each team profile, but this becomes difficult to maintain very quickly.

Details

This improvement is blocked by the initial implementation of team profiles as defined in #13.

The GitHub REST API should be used to gather metadata about a Pull Request and embed the relevant metadata into the team profile card and full profile. The featured Pull Requests should be defined in the front matter of a specific team profile.

For the content writer, all they should have to do to "feature" a Pull Request is specify it in the team profile's front matter, like below:

pulls:
  - https://github.com/example/pull1
  - https://github.com/example/pull2
  - https://github.com/example/pull3

Behind the scenes, the template should use GitHub's REST API to send a GET request for the relevant metadata from the Pull Requests and embed this in the template for the team profile card and the full profile page. The team profiles should render correctly even if zero, one, or many Pull Requests are provided for a specific team.

The API token for GitHub Pages (a.k.a. production deployments) can be stored safely in the Circle CI pipeline, but there should be a way to use a GitHub API token for local development too.

Outcome

Innovation Fund start-ups that complete exceptional work in GitHub Pull Requests can have their work and/or contributions highlighted in their team profile

@jwflory jwflory added T: improvement Improves on something that already exists ?: blocked Progress blocked by another task or issue C: design thinking Planning and creative thinking about design elements in new features or improvements labels Oct 19, 2021
@bl-aire
Copy link

bl-aire commented Mar 29, 2022

Can I work on this? I don't understand it totally yet but I'm willing to research and learn as I work.

@jwflory jwflory removed the ?: blocked Progress blocked by another task or issue label Mar 30, 2022
@jwflory
Copy link
Member Author

jwflory commented Mar 30, 2022

@bl-aire This issue is complex and will take time to implement. But there are some nice new Hugo features that make it easier.

I think a good first step for this issue would be to try to hit the GitHub API from a test Hugo layout and see if you can grab different data from the GitHub API. I think data we will want about any Pull Request is the title, description, merge status, number of comments, and a link to the Pull Request. Depending how we specify the front-matter in a post, this could be filled into the layout based on what data we could pull from the GitHub API.

But for proof-of-concept, we could start with embedding any GitHub API data about Pull Requests into a page in Hugo.

@bl-aire What do you think? Does this make sense? Is it something you'd like to work on?

@bl-aire
Copy link

bl-aire commented Mar 30, 2022

It makes sense. I have always been curious about how API's work but I've never had the opportunity to build or work with one. This would be an amazing learning experience for me so I am willing to start researching while I work on #69.
So when I am done I will attempt it.

But while learning, if I come across any problems, I will reach out for help.

@jwflory
Copy link
Member Author

jwflory commented Mar 30, 2022

@bl-aire Sounds good – I'll keep this issue open, and let's assign you #69.

@bl-aire
Copy link

bl-aire commented Apr 5, 2022

@jwflory hello,

My goal at the beginning of the week was to learn and understand how GitHub's API works and how I can achieve the goal for this issue. To try out ideas I had, I created a basic Hugo app and used Hugo's shortcodes feature to connect to GitHub's API and make a Get request.

I was able to get data about the unicef/inventory repository and reference it in my app's template...(a picture is available below).

My goal now is to make targeted Get requests for the:
-title
-description
-merge status
-number of comments
-link
....of Pull requests.

Team profiles are available in the inventory repository but this current issue is in the inventory-Hugo-theme repository.
Please how do I work on this issue? Would I have to create new team profiles on inventory-hugo-theme?
image

@Neha9849
Copy link
Member

Neha9849 commented Apr 5, 2022

I think we should add the layout of team profiles in this repo. Currently we have this layouts in the inventory site but this makes it difficult to make changes as we have to make changes in the inventory repository .
By adding this layouts in this repo also benefits other downstreams which may want to use this profiles.
I am also facing this issue while working on PR #76.
@jwflory what are your thoughts?
Should i open an issue to make this changes so that it benefits both of us?

@bl-aire
Copy link

bl-aire commented Apr 5, 2022

Hi @Neha9849,

I have had this on my mind for a while now. This approach was the first thought I had too.

I'm super relieved I can talk to someone that understands my current problem. Hoping we get a solution to it soon

@jwflory
Copy link
Member Author

jwflory commented Apr 6, 2022

@bl-aire wrote…
My goal at the beginning of the week was to learn and understand how GitHub's API works and how I can achieve the goal for this issue. To try out ideas I had, I created a basic Hugo app and used Hugo's shortcodes feature to connect to GitHub's API and make a Get request.

Nice work 👍🏻

@bl-aire wrote…
My goal now is to make targeted Get requests for the: -title -description -merge status -number of comments -link ....of Pull requests.

Makes sense. Note that the Pull Requests in question would be specified with a URL in the front-matter somewhere.

@bl-aire wrote…
Team profiles are available in the inventory repository but this current issue is in the inventory-Hugo-theme repository. Please how do I work on this issue? Would I have to create new team profiles on inventory-hugo-theme?

@Neha9849 wrote…
I think we should add the layout of team profiles in this repo. Currently we have this layouts in the inventory site but this makes it difficult to make changes as we have to make changes in the inventory repository . By adding this layouts in this repo also benefits other downstreams which may want to use this profiles. I am also facing this issue while working on PR #76. @jwflory what are your thoughts? Should i open an issue to make this changes so that it benefits both of us?

This is a good observation. This is tied into #35. The goal is to bring the team profiles within the scope of the theme and not the Open Source Inventory site. It is probably best to hold off on this issue until the team profiles are absorbed into the theme. Then, grabbing those specific fields from the GitHub API and embedding them into the layout will become easier.

Does this make sense? The work in #35 will make this more straightforward too. It was opened here because ideally this work would live in this repo in the long-term.

@Neha9849
Copy link
Member

Neha9849 commented Apr 6, 2022

Thanks @jwflory, i didn't see #35. I will be working on the UI part of rpg-report card from the inventory repo until this issue gets solved :)

@bl-aire
Copy link

bl-aire commented Apr 6, 2022

@jwflory, noted.

Thank you

@Yavnikaa
Copy link
Contributor

Yavnikaa commented Apr 8, 2022

Since I am working on the Team Profiles layout, can I help with this as well?

@jwflory jwflory added T: new change Adds new capabilities or functionality and removed T: improvement Improves on something that already exists labels Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: design thinking Planning and creative thinking about design elements in new features or improvements T: new change Adds new capabilities or functionality
Projects
Status: Backlog
Development

No branches or pull requests

4 participants