How to test a pull request for ClassicPress

This is an important task that can help to move on new features but also bugfixes, and you can contribute very easily!

Preface

It is required a dev environment, with git, so an online environment is not very good.
Personally I suggest VVV but you can have your docker or other solution.
For VVV I want to remember that there is the support for ClassicPress https://github.com/ClassicPress/classicpress-template-develop

Before asking what is VVV, I suggest checking those links and try it and open a new thread if you have any issue or reach me on Slack.

How to test a pull request

The most simple way is to install hub a tool that extend git natively.
I suggest it because simplify a lot the issue of download a fork, checkout to the branch and keep update it that branch.

Of course you need a ClassicPress instance working with git!
git clone https://github.com/ClassicPress/ClassicPress/

Every pull request is a git branch on a fork but with hub is very simple to download and access as local branch!

cd ClassicPress #Enter the folder where is ClassicPress
git checkout https://github.com/ClassicPress/ClassicPress/pull/428

Automatically you will be in the new branch that have the name of the number of the pull request.
You can update the branch (so the pull request locally) easily with git pull .

This is a quickie guide, for any other improvements let me know and I can add more details if something is not clear.
I just written because of the enthusiasm on Slack about it :slight_smile:

5 Likes

Thanks for writing this.

Setting up a local development environment is a pretty complicated task in itself, and we are happy to answer questions about that too.

Just adding some clarification here, this is not a standard git command. When you install the hub tool correctly, it runs instead of git and intercepts some commands for further processing, like this one.

If you’re not using hub then you need to understand that ClassicPress/ClassicPress is one repository on GitHub, and the repository where the user has submitted the PR is (usually) another one. For example, in the case of @omukiguy’s PR for the login screen:

Here we see that the source repository for the PR is under the bahiirwa user and the custom-login-image branch, so the GitHub repository that contains this branch would be https://github.com/bahiirwa/ClassicPress.

Now that we’ve sorted through that information, here are the raw git commands to do essentially the same thing (set your local development environment to the same code as this PR):

git remote add bahiirwa https://github.com/bahiirwa/ClassicPress
git fetch bahiirwa
git checkout bahiirwa/custom-login-image -B pr/424
5 Likes