Watch on YouTubePlayPlays from YouTube. Google's privacy policy (opens in a new tab) applies.
Adam fixes his CLAUDE.local.md so pushes and PRs go to his fork, pushes through the team's pre-push hook, then has Claude open his first PR. On GitHub he walks through the CI checks and what a good PR should show.
What you'll learn
- In this course, PRs go to your fork; check that
CLAUDE.local.mdsays so. - A pre-push hook runs lint and type checks before the push goes through.
- Forks have GitHub Actions off until you enable them; Actions minutes have a monthly limit (a generous one).
- CI (continuous integration) on a PR installs dependencies, lints, type-checks and builds the app; merge only when every check is green.
npm run buildbuilds the whole app (heavy);npm run devcompiles only the pages you open.- If a check fails, ask Claude to look up the PR, investigate and fix it.
- A good PR shows what changes: screenshots or a short before/after video.
Chapters
- 00:00Pointing PRs at your fork
- 02:48Pushing through the pre-push hook
- 04:49Enabling Actions, opening the PR
- 06:21CI checks on the pull request
- 07:46Why the build runs in CI
- 09:53What a good PR shows
- 00:00Okay. Well, with the change being ready and hopefully tested thoroughly, locally, we are now ready to push the changes and raised our first PR so that we can see
- 00:12some of these automated tests and checks that we talked about in the previous in one of the previous videos.
- 00:19Before we before we make the push, however, let's take care of one thing that is related to this unique setup of this video course.
- 00:30So before because we have forked this GitHub repository and we made a clone of that forked GitHub repo, one thing that I want to take care of before I
- 00:42ask Claude to make the first push is I want to go back to my local CLAUDE.md file.
- 00:51And over here, I'm noticing I'm noticing that in one of the previous videos when I ask Claude to set up this file, it has wrongly assumed that whenever we
- 01:05push anything or whatever we raise a PR, this PR is not going to go to this forked version of our repository and instead it's going to go to this
- 01:15original version that's hosted on our organization.
- 01:18This is not something we want.
- 01:20This is you know, one of it might be a common way of working with work repos that you raise PRs to that original one.
- 01:30But over here, for the purposes of this course, we want to change that.
- 01:33We want to keep all of our PRs and pushes and branches locally on our forked version of the repo.
- 01:39So I'm going to I'm going to head over here to the view source button so that I can actually edit this local CLAUDE.md file.
- 01:49And I'm going to find a line in which it says region is my fork, upstream is the team repo.
- 01:56And I'm going to change that last sentence saying PRs go to um PRs go to my uh fork uh and never to the uh apps uh to the team
- 02:14repo tonic. Um PRs and pushes uh okay.
- 02:22So that is just to make sure Claude is never confused with that.
- 02:26If you skim through your local CLAUDE.md file and find a similar line, make sure to correct it.
- 02:32You can alternatively just spin up a really quick session with Sonnet and ask it whether it understands that whenever whenever whenever we are about to make a push um
- 02:42or raise a PR, this PR is going to be targeting our forked version of the repository.
- 02:47[snorts] Um okay, with that I'm going to close this and I 'm going to ask Claude to make the first um to make the first push um push the
- 02:57changes uh for now.
- 03:00And um as this is as Claude is going to be pushing the changes, uh we are going to witness that first check.
- 03:07So um we talked about these pre-push checks which are configured on this codebase and the configuration can be found over here in this Husky folder.
- 03:17We have that pre-push pre-push check.
- 03:20And so what is going to happen is we're going to see npm run lint and npm type check running uh in the background um and which is going to
- 03:30be essentially make it uh a little bit slower that like making that first push.
- 03:34But this is you know something that we want to make sure uh you know that our code is valid at this stage.
- 03:41So let's give it a second.
- 03:43Okay, this took a while because of my internet connection which basically which also um conveniently gave me an opportunity to clarify one thing in my uh ask for to
- 03:53Claude. And I just wanted to clarify that I would like for it to uh push the changes to my forked version of the repo just to be extra extra
- 04:01clear. Um the pre-push hook runs lint and type check before the push goes through.
- 04:06And um, basically um, yep.
- 04:12Okay, and we are good to go.
- 04:14So the change has been pushed.
- 04:16Um, I'm going to open up the Git graph.
- 04:19Uh, and I'm going to hit enter.
- 04:21And I can see it is indeed now like this commit lives both on my local version of this branch as well as the origin like or the remote version
- 04:30of this branch. So if I now go over here and refresh, I can see both the branches here as well as my first commit.
- 04:39Um, if this is here, it means that like there were no lint or type check errors, which is our first little success.
- 04:47Um, with this uh, what what follows usually is raising a PR.
- 04:53Now, another thing that we need to set up because of you know, this video course is in our fork version of the repository, we'll want to go into the
- 05:04actions tab and we'll want to enable workflows.
- 05:08So over here, we have just one simple workflow on GitHub that is going to perform, you know, very simple checks.
- 05:13Whenever GitHub is testing our PRs, it's also happening on virtual machines out there and we have a limit of of the on the number of minutes each month for
- 05:26which these checks or these virtual machines can run.
- 05:29It is very generous though and the the the the tests that we are about to see in a minute are going to be very very lightweight.
- 05:36So I'm going to just hit the I add or send my workflows, go ahead and enable them button.
- 05:42And with the GitHub actions enabled and also configured on this repository already, I'm going to go back to Claude and I'm going to ask it to open PR on
- 05:53fork. Um, and I'm going to hit enter.
- 05:57And because there are no other things to push, this should be fairly fairly quick.
- 06:04Now, I haven't said anything to Claude about like the the PR description because earlier on, we asked Claude to like review the history of commits and PRs in this
- 06:16repository and try to respect the conventions in this particular codebase and repository.
- 06:25So, let's see. The PR is open up.
- 06:29I'm going to go into the pull request tab here on GitHub.
- 06:33And this is the thing that I had in mind previously when we talked about enabling GitHub GitHub actions.
- 06:42So, the first type of automatic checks is you know that pre-push hook which is configured on this repository.
- 06:49But another type of checks that you are often times going to encounter are the checks or tests that are running on your PR directly on GitHub through things like
- 07:00GitHub actions. So, what is happening over here is GitHub is using a virtual machine to first of all install all of the dependencies.
- 07:10So, it's running that npm install command and it's going to also do the lint check, the ESLint check, the type check, and also it's going to build the application.
- 07:20And that last that last part is important because you really want to make sure when you merge the PR that it's going to have code for a working application
- 07:32that can be built.
- 07:33Otherwise, you are looking at a potential you know at a potential broken deployment or broken build and you really wouldn't want that.
- 07:42So, now that we have confirmed that this application is you know we can actually build this application, this PR is safe to be merged.
- 07:51Now, I could have checked that myself locally if I wanted to.
- 07:55I could open up I could open up a terminal and in that terminal what I can do is I could type in the npm run build command.
- 08:07Very similar to the npm run dev which opens up working version of the application locally, but the the difference between the npm run dev and npm run build is
- 08:19is with the npm run dev our computer basically compiles only the pages in the application that we happen to go into.
- 08:28Whereas when you go through the npm run build it's a much heavier process that's going to build all of the the entire application, all of the views.
- 08:36And when you work on you know like more heavy application this process can sometimes take a couple of minutes and depending on how strong your local computer is it
- 08:48can also drain a lot of the resources, which is why you typically don't really you know build applications locally and you instead offload some of this to these to
- 09:01this you know CI checks so called CI standing for continuous integration in here.
- 09:07So once over here we have just one simple check it's very common that you'll see a couple of rows with different types of checks depending on the the text
- 09:17setup or the text stack of your application.
- 09:20So it can sometimes take a couple of minutes for all of the texts to go green as they say, meaning you all you see are these grand green check
- 09:29marks and then and only then your PR is safe to be merged.
- 09:33Now if this check was ever to go red you would see at this red cross over here.
- 09:40You can go back to Claude and Claude you know can look up your PR and can offer a way to fix like can offer a way to investigate why
- 09:51the tests are failing and can offer a way to fix them.
- 09:55So that is how you would typically want to go about this.
- 09:59Let's also talk about the PR description.
- 10:02So over here it is pretty simple.
- 10:04Notice how how how much simpler it is from the PRs our Claude has been raising back when we were working on that first uh local only version of the
- 10:15um of the of the parking application.
- 10:18This is because again a couple of videos ago we asked Claude to see if there is any pattern for PR messages over here.
- 10:25It hasn't actually found anything.
- 10:27So it concluded that perhaps it's best to keep things simple.
- 10:31Usually you want your PR messages to be a bit more elaborate and when you onboard to an already existing repository chances are there's going to be plenty of better
- 10:40PR description examples that your Claude is going to um is going to use.
- 10:46One really important thing about raising a PR is making sure that everyone can preview what exactly or see what exactly is changing and how the application should look like
- 10:57with your changes merged.
- 10:59And sure you could ask them like the reviewer another engineer to just um fetch this like your branch um like like pull the changes from your branch locally and
- 11:11set up the application and run it.
- 11:14But a much more common example of or a much more common way to do it is just grabbing screenshots of like sometimes the before and after sometimes just the
- 11:24after changes. What I tend to do personally is recording really quick uh short uh Loom or Super Cut videos in which I'm showing the before and after and how
- 11:35the application should uh look after merging this PR.
- 11:39Uh so that is something you might be expected to do uh when you raise a PR uh in a team uh of other engineers.
- 11:47So yeah with that uh in the next video we're going to talk about how a process of code review can be different when working with other engineers.
- 11:56So I'll see you there.