- Podcasts
- viewSource
- Getting started with GitHub pull requests and review
Getting started with GitHub pull requests and review
viewSource
- May 15, 2023
- 37 min
- Season 1, episode 16
About this episodeBrian and Aurooba walk through the process of submitting a pull request in GitHub, reviewing it, and merging it into a repository…
Brian and Aurooba walk through the process of submitting a pull request in GitHub, reviewing it, and merging it into a repository – discussing best practices and perspectives to take as the reviewer and the reviewee in an ongoing pull request. In this case, the open source project was wphelpers.dev and Brian was adding a fantastic new helper: a searchable guide to the WordPress Icon library (@wordpress/icons), which they also take a look at.
A full transcript of the episode is available on the website. Watch the video podcast on YouTube and subscribe to our channel and newsletter to hear about episodes (and more) first!
- The searchable icon library – https://wphelpers.dev/icons
- The Post Status slack comment that prompted the creation of wphelpers.dev – https://poststatus.slack.com/archives/C0413TGQZ/p1645727796428859
- @wordpress/icons repo – https://github.com/WordPress/gutenberg/blob/3f5da7aa3b3b2f37301a498f401c7623d989bb9d/packages/icons/README.md
- @wordpress/icons visual reference – https://wordpress.github.io/gutenberg/?path=/docs/icons-icon--library
- Netlify deploy previews – https://docs.netlify.com/site-deploys/deploy-previews/
- Netlify collaborative drawer – https://www.netlify.com/products/deploy-previews/
- Brian's viral tweet thread about the searchable icon library – https://www.briancoords.com/building-the-wordpress-icon-library/
- Brian's website – https://www.briancoords.com
- Aurooba's website – https://aurooba.com
- (00:00) - Introduction
- (00:13) - A tangent on wearing a uniform everyday
- (02:05) - Recapping v1 of this episode we had already recorded
- (02:42) - Getting into the topic: collaborating on GitHub
- (03:46) - Introducing wphelpers.dev and how it came to be
- (05:04) - How the searchable icon library guide came to be
- (06:12) - The portability of Gutenberg packages
- (07:20) - Walking through the searchable Icon Library
- (09:23) - How wp-scripts interacts with @wordpress/icons
- (09:51) - Our favourite uses for the searchable icon library
- (11:02) - Diving into the pull request
- (11:41) - Creating work-in-progress PRs
- (12:56) - Collaborating with the deploy preview feature in Netlify
- (13:14) - Getting feedback early on in the process
- (14:16) - The netlify collaboration drawer
- (15:07) - The ideal opening comment on a PR
- (16:27) - Requesting a review in GitHub
- (16:49) - Determing the right time to request a review
- (17:47) - The features of an official review in GitHub
- (20:53) - Making new issues from incoming feedback
- (21:27) - Creating trackable history in GitHub
- (25:13) - Requesting changes through reviews in GitHub
- (26:13) - The code view in PRs and its features
- (27:40) - GitHub reviews allow you to post your comments holistically
- (30:23) - Automatic deployment with Netlify
- (31:35) - Using the right tool for the situation
- (33:21) - Discovering the existing icon library visual reference
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Getting started with GitHub pull requests and review
**Brian Coords:** You know, a lot of people in tech, I think they think of like Steve Jobs and he wears the same outfit every day, but I think of like nineties Nickelodeon cartoons and like how they would wear this. Like Bart Simpson wore the same clothes every day, and I remember an episode of, I think it was Doug on Nickelodeon and he opened his closet and it was just the same outfit, like over and over.
**Aurooba Ahmed:** I mean, I have a uniform too. It's just not restricted to color. It's, I wear a tunic and I wear like a pair of jeans or a pair of tights and that's what I wear, you know? Um, I also don't really think about what I wear. I just pick whatever is clean and in hung up in my closet, cuz they're all the same type of outfit for the most part.
**Brian Coords:** To be fair, this, this black hoodie is a little snug and my wife will not let me wear it out in public because it's, it's a little tight on me and I think it shrunk. I don't think it has anything to do with me. I'm a hundred percent it's, it's definitely the hoodie, but I've been bugging her to just order me like two more.
**Brian Coords:** But I, I think it was a good thing. Yeah, because we, when we first recorded this episode, and we're gonna talk all about collaborating on GitHub, collaborating in the open, making a pull request in somebody else's project. Um, we recorded this before I had finished the pull request and you reviewed it for me, and we did that in real time on the call and we talked about some of the feedback.
**Aurooba Ahmed:** Totally, and maybe a more complete perspective because now you can go and see, not only is it like how was it reviewed, but then after the review, because GitHub is like so good at showing the activity, we can see what happened afterwards and how that turned into the final like piece of the project that we can also show now.
**Aurooba Ahmed:** So wphelpers.dev actually used to be called latestwp.is, which came out of a conversation in the post status slack last year where a lot of people were sharing these one pager websites that tell you the version of something or tell you what the day of the week is, and someone was like, wouldn't it be cool if you could go to a site and it would tell you what the latest WordPress version is?
Because I mean, it's not that hard to find, but there is not one single URL that you could just go to. And so I decided to experiment a little bit with Netlify and Next.JS at the time, and create a serverless function that accesses the wordpress.org api, pulls out what that single you know, version number is and pops it on this big page.
Then later I ended up adding one more little piece of functionality to it. And decided to rename the whole thing, WP Helpers, because I had this vision that it could be a collection or library of tools and interesting, helpful things for other WordPress developers or builders. But then I didn't have time to actually do anything about it.
**Brian Coords:** Yeah, so. I was using, I've been doing a lot of custom block development and a lot of Gutenberg stuff, and when you're in Gutenberg, you don't really use the dashicons quite as much. You use the new Icon library, it's really great. It's a package. It's in Gutenberg, you can use it anywhere you want. Um, but they just don't have that classic, like when you.
Every Icon library has like a good landing page where you can see all the icons, you can search, you can filter, you can click on them, you can click to copy them. Like it's just the normal like landing page for an icon library that like sells it. And it's kind of that classic Gutenberg thing of like, we built a really cool thing and we're just gonna try really hard to make sure no one ever finds it.
**Brian Coords:** Yeah. Cuz sometimes I'll get those like single page ideas, like, oh, it'd be cool to do this. And then I'm like, I'm not gonna, I'm not gonna sit here and do this. But it, it worked out really well because all the Gutenberg packages, like they're all kind of basically like react, like. You know, it's a @wordpress/element, but it's essentially they're just kind of, you could use with React anywhere and your site was built on React and next.js.
So like once you said that and it was like I could build a single page, I could load the com, the package, the normal way, it's meant to be loaded and like looped through it like it was actually. It was honestly like easier than if I had like sat down and thought, how would I do this now? Like it all, just, the pieces fit together like so perfectly.
**Brian Coords:** yeah, cause I saw somebody had a pull request for, um, I think it was like the details block that there may be potentially can do. So then in their pull request they had a new icon for the block. Like it's kind of cool you get to see them add to it, let's, what should we search for?
**Aurooba Ahmed:** So these are all the icons for posts and a lot of these, I mean, they're all in use I think right now, and you can just see all of them. But what's really awesome is like the area at the top that you have, which lets you copy all the relevant pieces of code or the name or the import or the icon component with the name already filled in.
**Aurooba Ahmed:** It just knows. Yeah. And what's really awesome about this, which is like one of my favorite parts is you can copy the SVG and post, like paste it in any vector program like Figma or XD or Sketch, and it'll just create the icon because all of those are SVG slash you know, vector-based programs. So this actually works not just for developers, but it also works for anyone who's wants to use these icons in their mockups and designs.
**Brian Coords:** Yeah, which is awesome, because I like, I'm a huge fan of, I think we even talked about this in our last episode about the, the tag processor where we were modifying SVGs. Like, I love, I'm gonna, I'm always just gonna throw that SVG in the page. Like if I can, if I'm building, like if I'm building in JavaScript, I can definitely use these components and stuff.
The first thing that I did was create a pull request very early in the process, I created a branch. I threw up the idea of like bare bones, what it would look like, and I added this very first comment here with, let's be honest, like not the most like verbose, good comment. But like, we had been chatting about it, so you kind of already knew it was coming.
**Aurooba Ahmed:** And at the time you titled it WIP searchable Gutenberg Icon Library, because you noted that it was a work in progress. In GitHub, if you have a paid organization or if it's a open source personal repository, you also actually also have the ability to create. Work in, like work in progress, draft pull requests, which is a really nice way to let other people know when you're contributing to their project or to anything that, hey, this thing is coming, but it's not ready.
**Brian Coords:** Yeah, and like the minute you do that, Netlify jumps in because you're hosting this netlify, it's auto deploying and everything. They actually like create, they take my branch, they make a preview URL of it that you can click on and you can visit and we can immediately be looking at the same thing. You don't even have to pull it, you don't have to do anything.
**Brian Coords:** And we can just both have like something in front of us to talk about to, uh, start collaborating on and like have that discussion way earlier in the process so that I didn't go so far down a, a weird path that I did something weird. Um, for example, I think you very early on were like, You should model this after the dashicons, like landing, like the old classic dashicons where the icons on one side and you click to copy up here and everything's in a grid.
**Aurooba Ahmed:** Yeah. And that way you're not wasting your time or doubling your work by creating it in one way and then having to redo it because this other person wants it done or has feedback or ideas on it as well. And what I really liked as when I was reviewing it and giving you feedback was if you click on that deploy preview,
**Aurooba Ahmed:** Yeah, and then, you know, comment on things from there. So it gives you like a really nice way to be on the project, like be on the deploy preview, and also be adding feedback inside the pull request. So that's something I also really appreciate about how Netlify works. It's really cool.
**Brian Coords:** One, uh, final thing I will say is if I didn't know you and wasn't already talking to you about this, I would much, much more, uh, have filled this out, put some screenshots, put some like objectives of what it's trying to accomplish. Um, you know, if your pull request, you're making a pull request on something that's like more public and, you know, maybe more formal.
**Aurooba Ahmed:** Definitely. Yeah. In this case, because we already were talking on Slack, and I think part of this conversation even happened on a Zoom right after recording a podcast episode. I think, uh, it was okay. But yeah, if you're contributing to a project or if you're working with a team and it's a client project and you're just working internally, even.
You wanna add a really good initial comment so that not only are your teammates who are currently in the middle of this project with you able to understand what's going on, but your future self and other people in the future can come back to it and understand what was the initial goal of this? What were we trying to accomplish?
**Brian Coords:** And then I requested a review from you probably a little too early, like for an actual review. But I mean, that depends on your process. Like do you want reviews early? Do you wanna review it at the very end? I don't know that I really like requesting a review to me feels like, look at the code and make sure it's all good.
**Aurooba Ahmed:** mean, I think it depends, right? Because you and I both are very iterative in our process of creating things, and so you and I are constantly saying to each other, Hey, can you take a look at this? Hey, can you review this? And then. Adding more to it and both of us understanding that this doesn't mean it's a final thing, you know, this doesn't mean that it's perfectly done, it's in the process of it.
**Brian Coords:** And the nice thing is, so like if we go down, um, there's things like general comments, conversations that we had. So you had some ideas about different features to add. I had some ideas and some links of like, things I was trying to reference and you know, you even like include like notes from a call of like, okay, now that we've talked about it, what do we think?
**Aurooba Ahmed:** Yes. I think that that's really important. Sometimes when you have those very specific code related conversations, you, someone creates it and they were thinking something, and then someone comes into it with a piece of feedback and it's really, I think the important thing, important perspective to keep here is everyone is trying to achieve the best possible outcome.
So it's more about, Understanding everyone's side of it so that you can come to a conclusion that we all think is the right move. Right? So in this case, I was able to convince you and make a good case for it, and you ended up agreeing with me. But it could have easily gone the other way where you had completely different solution that I hadn't thought of that would've meant that we could kept, have kept the five columns perhaps, and have it still be really readable and.
Like, it could have gone in so many different ways, depending on what that code situation is. So as long as in a review process, both the reviewer and the reviewee are always remembering that we are all on the same side. We're all trying to achieve the same goal, then everything's gonna be okay. You know, it's not a punitive thing.
**Brian Coords:** And then sometimes just you win and I lose, and that's just the way it is. I'm just kidding. No, it's true. And. The, another good example kind of along those lines is this one here, um, it's not showing the code cuz the code, I think we ended up deleting and moving stuff around. So fun
**Brian Coords:** okay. Okay. So. You had an idea, you commented it here, and then I was, I used the little dropdown where you basically make a new issue and that issue will always have a link back here to remind you of where the issue came from. Yeah. I was like, you, you were like, we need actually a real header for the site now that it has multiple pages, but we'll do that in a new issue.
**Aurooba Ahmed:** Totally. And you know, in a project where you and I are not the only ones who are contributing, for example, and let's say that we weren't talking on Slack. Even better would have been, we created an issue first where we talked about what we're trying to achieve and then we linked that to a pull request.
**Aurooba Ahmed:** Because having that thread of history to follow back later for other people, especially in something that might be open source, is so key and it's so vital for other people to understand how you work and what you expect and what you want or would want, you know, when they're trying to contribute too, so.
In this case it's really perfect. So now you've created this issue and you know we have other issues in there too as we've been like documenting ideas for what we wanna add here and then you can come back to it. Or if someone else were to come in and say, oh, I can help with that, now they know the context of where this came from and can probably like have a pretty like guess pretty well what that component might look like even without having to talk to us.
**Brian Coords:** And one thing I get tripped up on because yeah, normally in most projects we would've opened an issue with the idea and then maybe assigned it and said, okay, I'll assign this to myself cuz I want to make the pull request for it first. And so that is, yeah. One thing that's kind of unusual about this, but then I do get tripped up sometimes where you have an issue for a topic.
And you have a pull request for that same thing, and the conversation sort of starts to split because on the issue you're talking about the problem and maybe some potential solutions. But on the pull request, you're really talking about this particular approach and solution and this code like, like the issue becomes this sort of general idea.
And the pull request really specific, but sometimes. You, you kind of forget, oh, where did we talk about that? Was that on the issue? Was that on here? Wasn't there a link to that? So that is one tricky thing, um, that you do have to keep in mind that if you are looking at a pull request, if it says at the top closes issue number, whatever, or if it says in the sidebar, um, over here, uh, usually there'll be like, related issues under this development tab.
**Aurooba Ahmed:** Yeah, I mean, you're right. Sometimes you have to jump around into multiple places in order to get context, and let's say you're looking at a much larger project. For example, the Gutenberg repo for WordPress. You might sometimes, in order to follow the thread of a conversation, I have to go through like eight or nine links because you might have a pull request that was linked to an issue, which might be part of a larger tracking issue, which might be part of a larger tracking issue that was actually stemming from a different, smaller issue, and there might be multiple comments to go through.
**Brian Coords:** Yeah, I mean, Overcommunicating is always better than not having enough information. But I like the other day you sent me a thing of like, look in Gutenberg, they're doing this thing about patterns. And then it was like 10 issue links and I was like, am I gonna read all these? It's gonna take me a day just to parse through.
**Brian Coords:** I needed to send that to like chatGPT, read all of these issues, summarize what are they trying to accomplish here. But it's true like that there's so much on a thing like Gutenberg like. It's, it's, it's big. It's complicated. There's one issue, I think that one was about patterns, right? But that affects everybody.
That affects people who use different types of themes. It affects people who are editing. It affects whether you're in the site editor or like, so it becomes a part of all these different threads that they have to tie together. And it is nice that at least the links are there. You can follow it. I mean, it's, it's better than if it was just in Slack, you know, or in
**Brian Coords:** Yeah, I knew, I knew it wasn't, so you can see kind of all the little like pieces, you can track. Bringing back documents, all these sorts of things. And then another review, which you get with this kind of green check mark, that lets you know like this was approved, it was reviewed.
**Aurooba Ahmed:** Yeah, you can go into the code view, the file changes view, which I think you and I live in a lot when we're reviewing pull requests anyway, because on the side where you can see in this new code view that GitHub introduced this year. You can see easily with the icons when something is a new file or if something has been a modified file.
So it's a green plus icon when it's a brand new file. And if something was modified, it's sort of like a orangey brown dot, right? And I find that really hand really handy because I wanna know, oh, okay, what are the new things that were added? But then, okay, where did you change something that was in my existing code base that I might need to take a closer look at?
**Aurooba Ahmed:** And the one thing to really remember about review is even if you're adding those separate comments and everything until you submit your review, the other person will not see it. So you can actually leave it open for a while and come back to it and. That's something that's not as easy if you were doing it without the review process, because then they'll see those cha uh, uh, comments coming in on a rolling basis.
And that can sometimes be frustrating when you're getting reviewed because you may not have the whole context for what, how something was getting reviewed. So when it's in a proper GitHub review, everything goes out together in one little section with an overall general comment, which is a really important place for you to not only.
You know, what is it called? A compliment sandwich. So always, yes, you are asking for changes. You're asking for updates, but also let's acknowledge the awesome work and the hard work that another person did, whether that's your teammate on a client project, or that's someone who's contributing to your project.
**Brian Coords:** You know, I, cuz I've learned that one the hard way where I asked a developer like, how come you haven't addressed these comments? And I said it like that. I said, what's your problem? Address these comments. You know, I was really rude about it. I'm just kidding. Um, but I, I said like, oh, did you get my comments?
And they didn't, and I didn't understand that you. You have to actually like submit it. And I thought that was really, I didn't really get it, but that actually makes a lot of sense. Like if I, if you're getting that one comment at a time, it's like when you're at a restaurant and like, you're like, can I get a soda?
And then they come back and then you're like, oh, can I get uh, some more ranch? And then they come back and then you're like, oh, and I forgot I dropped my fork. And you're like running the waitress, like back and forth. It's so annoying. And you just, so like the fact that it submits the whole batch, um, super handy.
**Aurooba Ahmed:** Definitely. Yeah. So it's a, it's, it's well thought out and it definitely makes collaboration a little smoother and a little less with crossed wires. I think when you use these features that are available to you in GitHub, and if you're using Netlify, you know, having that collaboration drawer with the deployment previews, now no one can say, oh, it's not working on my environment , no, we're all looking at the same deploy preview.
**Aurooba Ahmed:** Yep. Yeah, and then it was live. And because it's netlify, it automatically deploys anything to production that gets pushed into main and within, I think a couple minutes, it was live for the whole world to see, and then you did this amazing tweet thread on it, which got so much attention. It was so fantastic.
**Brian Coords:** so much better. Uh, you know, the. This, this was the, this honestly on a personal level like this, this one turned me on like next and that stuff, cuz for specific situations like this where you're like, I just wanna make one cool interactive-y thing, uh, with like minimal effort, um, it, it really, like, it couldn't have been easier, I don't think.
**Aurooba Ahmed:** Totally. And you know, I think this is that really important note of use the right tool for the right situation and project and use case. In this sit situation, WordPress actually didn't make sense, but in another situation where there's a lot of content heavy stuff happening or whatever, WordPress would make sense.
**Brian Coords:** Ooh, that's a good idea. Like a, a walkthrough, just like. It's like one of those things where I was like, that just sounds too confusing. I don't even know what it's for. Um, and then you, I think you hear about it a lot in the context of like headless WordPress where, you know, if this was like headless WordPress, that's a whole separate thing.
**Aurooba Ahmed:** Yeah, we will. This was a really awesome, pull request and I'm so excited that you made it. It's so cool. And it's so fun to see people, you know, going to it and we can tell when someone copies an element, uh, like an icon or something. So there's definitely people clicking and copying and using it already, so that's really cool to see.
**Brian Coords:** And I think what was one last thing that came out that was really cool was in the middle of this, one of 'em was one of the icons wasn't loading and it just looks broken. And you found the bug in Gutenberg submitted a pull request in Gutenberg to fix their broken icon, and then a contributor actually pointed out that, oh, good, I checked it on storybook, which is their visual
**Brian Coords:** This is the icon package that we based it on, right? So, you know, this is what we're essentially doing, but nowhere in here is there any link to anything that tells you that you can actually look at all the icons, like nowhere here do you get a, an idea of what they look like visually.
