How to use GitHub Desktop and XAMPP to review PRs

Review Pr Github Desktop Tutorial

In previous GitHub Desktop tutorials we showed you how to submit a pull request (PR), so you could start contributing to the development of an open-source project such as ClassicPress. Once you are comfortable with this concept, the next stage in contributing is to start testing and reviewing other PRs that have been submitted. An easy way to do this is to set up a local version of Classicpress using a program such as XAMPP on your computer and link it to GitHub Desktop. This tutorial will take you through the required steps.

Set up the local server

There are plenty of online tutorials about using XAMPP (or any of the other web server stack packages) so this won’t be covered in much detail. You will first need to set up a database, but make sure it creates either a MySQL or MariaDB type. XAMPP uses phpMyAdmin so the simplest method is to make a user and select the options to also create a database with the same name, and apply the necessary permissions. Your setup screen will look something like this…

Image1

Once the database is created, go into the XAMPP directory and add a folder for the files; in this example we will create a folder called classicpress-dev in the htdocs folder.

Image2a

Add the ClassicPress files

Now we add in the files for ClassicPress. Open GitHub Desktop and select ‘Clone repository’ from the ‘File’ menu.

Image3

Select your own fork of ClassicPress from the dropdown list, and make sure the local path is entered to the correct XAMPP directory, in this case C:\xampp\htdocs\classicpress-dev\.

Image4a

Hit the ‘Clone’ button when you are ready. You might be shown one more message, but leave it as the default, hit ‘Continue’ and wait while the clone downloads.

Image5

Set up ClassicPress

If you now go to the classicpress-dev folder in XAMPP you should see a lot of files have been added. Note that the actual ClassicPress installation files are in the src folder.

Go to your browser and visit localhost/classicpress-dev/src. You should be able to complete the setup of ClassicPress in the usual way. Of course, you will need the database name, username and password that you entered when you created the database.

To login to your new site, use the address localhost/classicpress-dev/src/wp-login.php. You can start installing plugins and a theme, and upload items to the media library. It is a good idea to create a site for testing that you are familiar with, so you can see if anything looks different or doesn’t work properly.

Add a PR to your localhost version of ClassicPress

Now comes the neat part. To start testing PRs you only need to go into GitHub Desktop and first make sure that the current repository is set as the version you have in XAMPP. Then click on the ‘Current branch’ tab and switch over to see the ‘Pull requests’. You can select any one of these from the list, such as Revise login page link layout (PR #795).

Image8

You may get another warning message but stick with the default to leave any changes on develop, and select ‘Switch branch’.

Image9

Now when you login to your Classicpress-dev site you should have those PR files included. In this example the login screen will show the changes that were made in that PR.

Image10

Start testing and report any issues on GitHub

Now you can start reviewing. The PR on GitHub should have a step-by-step guide on how to test the change so work through this. Keep an eye out for anything that may be glitchy or stop working. Report any problems you find in the comments section of the GitHub PR, and don’t forget to also report if it does work for you with no issues. Positive feedback is a very important part of this process. 

You can also ask for test steps to be provided or request any other relevant details that may help you. Or add in any steps you took to test it yourself, perhaps including before and after screenshots.

There are more details in the contribution guidelines about submitting and reviewing PRs, or ask on the ClassicPress forum if you need any more help.

To change to another PR just go back to GitHub Desktop and select another one from the list.

Avatar for Alan Coggins
About Alan Coggins

Alan builds and maintains websites. He thinks that computing is way too complicated for most people and enjoys finding simple and elegant ways to make things happen. His clients seem to appreciate this approach.

Notable Replies

  1. Avatar for james james says:

    Great post that explains a key step of the contributing workflow well. Thank you for writing it!

    The same setup (cloning a local copy of the ClassicPress git repository, and making this the same directory that is served by your webserver) also works well for coding, testing and publishing your own changes to ClassicPress.

  2. Is it wrong to set the root of XAMPP (or MAMP I’m using) to src?

  3. I didn’t find it necessary, but it may still work. I didn’t test that.

  4. Avatar for james james says:

    It’s fine to set the root to src, but you may not want to, because this might make it harder to use other websites (in different subdirectories) with the same XAMPP install.

Continue the discussion at forums.classicpress.net

Participants

Avatar for ozfiddler Avatar for Simone Avatar for james