From 61af6384d2a350e1b6ddfdf04e3afb17bb2a08a1 Mon Sep 17 00:00:00 2001 From: Ayumi Hamasaki Date: Wed, 4 Sep 2019 16:34:12 +0100 Subject: [PATCH] Add documentation for testing pull requests (#4577) Credit to @ayumihamsaki & @bennothommo --- .github/CONTRIBUTING.md | 77 +++++++++++++++++++++++++++++++---------- README.md | 4 +++ 2 files changed, 63 insertions(+), 18 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 1a41213f6..021d7417a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,16 +1,21 @@ # Contributing to OctoberCMS -Thank you for your interest in contributing to the OctoberCMS project! +Thank you for your interest in contributing to the OctoberCMS project. We appreciate any assistance that community members and users of OctoberCMS are willing to provide. You can contribute to the project in several different ways: -## Security Vulnerabilities +- [Reporting a Security Vulnerability](#reporting-a-security-vulnerability) +- [Reporting an issue with OctoberCMS](#reporting-an-issue-with-octobercms) + - [Reporting an issue with an OctoberCMS plugin](#reporting-an-issue-with-an-octobercms-plugin) +- [Making a Feature Request](#making-a-feature-request) +- [Making a Pull Request](#making-a-pull-request) +- [Testing Pull Requests](#testing-a-pull-request) + +## Reporting a Security Vulnerability Please review [our security policy](https://github.com/octobercms/october/security/policy) on how to report security vulnerabilities. ## Reporting an issue with OctoberCMS -**Please don't use the main GitHub for reporting issues with plugins.** If you have found a bug in a plugin, the best place to report it is with the [plugin author](https://octobercms.com/plugins). - ->**NOTE**: If you're reporting an issue that you intend to fix yourself, you can skip the Issue step and just submit a Pull Request that fixes the issue (along with a detailed description of the original problem) instead. +>**NOTE:** If your issue is related to an OctoberCMS plugin, please see the [Reporting an issue with an OctoberCMS plugin](#reporting-an-issue-with-an-octobercms-plugin) section below. We work hard to process bugs that are reported, to assist with this please ensure the following details are always included: @@ -22,7 +27,9 @@ We work hard to process bugs that are reported, to assist with this please ensur - **Actual behavior**: What is the actual result on running above steps i.e. the bug behavior - **include any error messages**. ->**NOTE:** Screenshots and GIFs are very helpful in visuallizing what exactly is going wrong +If possible, please provide any screenshots or GIFs of the issue occurring to provide us with additional context to determine the cause of the issue. + +>**NOTE**: If you're reporting an issue that you intend to fix yourself, you can skip the Issue step and just submit a Pull Request that fixes the issue (along with a detailed description of the original problem) instead. #### Here's how to report an issue on GitHub @@ -38,13 +45,21 @@ We work hard to process bugs that are reported, to assist with this please ensur If you find out your bug is actually a duplicate of another bug and only notice that after you created it, please also close your bug with a short reference to the other issue that was there before. -#### Reporting security issues +#### Reporting an issue with an OctoberCMS plugin -If you wish to contact us privately about any security exploits in OctoberCMS you may find, you can find our email on the [OctoberCMS website](https://octobercms.com). +>Please don't use the main GitHub for reporting issues with plugins. -## Feature requests +If you have found a bug in a plugin, the best place to report it is with the [plugin author](https://octobercms.com/plugins). -**Please don't use GitHub issues for suggesting a new feature.** If you have a feature idea, the best place to suggest it is the [OctoberCMS website forum](https://octobercms.com/forum/chan/feature-requests). +If you are unable to contact the plugin author and the issue prevents the plugin from being used correctly, please feel free to email `hello@octobercms.com`, mentioning the plugin name, URL and the issue found. We will then determine if the plugin needs to be delisted. + +#### Escalation process + +We do our best to attend to all reported issues. If you have an important issue that requires attention, consider submitting a bounty using the [OctoberCMS Bounty Program](https://www.bountysource.com/teams/october). + +## Making a Feature Request + +>**NOTE:** Please don't use GitHub issues for suggesting a new feature. If you have a feature idea, the best place to suggest it is the [OctoberCMS website forum](https://octobercms.com/forum/chan/feature-requests). Only use GitHub if you are planning on contributing a new feature and developing it. If you want to discuss your idea first, before "officially" posting it anywhere, you can always join us on [IRC](https://octobercms.com/chat) or [Slack](https://octobercms.slack.com). @@ -54,7 +69,7 @@ Feature Requests submitted as GitHub Issues specifically mean *"I'd like to see It's a great way to launch discussions on the developer side of things because both the core team and the community developer get a chance to talk about the technical side of the feature implementation. It's a great way to exchange ideas about how the logic could work in code. -## Pull Requests +## Making a Pull Request Your contributions to the project are very welcome. If you would like to fix a bug or propose a new feature, you can submit a Pull Request. @@ -69,9 +84,9 @@ Thank you for your contributions! #### Best practices -It is ideal to keep your development branch or fork synchronised with the core October `develop` branch when submitting pull requests, as this minimises the possibility of merge conflicts. +It is ideal to keep your development branch or fork synchronised with the core OctoberCMS `develop` branch when submitting Pull Requests, as this minimises the possibility of merge conflicts. -To keep in sync with October, add the core October repository as a Git remote (ie. `upstream`) and pull changes from the October repository into your local `develop` branch: +To keep in sync with OctoberCMS, add the core OctoberCMS repository as a Git remote (ie. `upstream`) and pull changes from the OctoberCMS repository into your local `develop` branch as often as possible: ``` git remote add upstream git@github.com:octobercms/october.git @@ -80,7 +95,7 @@ git checkout develop git pull upstream develop ``` -This ensures that your local `develop` branch matches October. When developing a pull request, it is best to use your own development branch. For example, creating a fix to improve spelling on a language file could be made into a branch called `lang-en-spelling-fixes`, which can be branched off from the `develop` branch. +This ensures that your local `develop` branch matches OctoberCMS. When developing a pull request, it is best to use your own development branch. For example, creating a fix to improve spelling on a language file could be made into a branch called `lang-en-spelling-fixes`, which can be branched off from the `develop` branch. ``` git checkout -b lang-en-spelling-fixes develop @@ -92,7 +107,17 @@ When you wish to update your development branch with the latest changes from the git merge develop ``` -This will merge all the latest changes from the October `develop` branch into your development branch. If there's a merge conflict, this will probably appear on your local copy now. You will need to resolve these conflicts locally - once done, this should allow your pull request to proceed without issue. +This will merge all the latest changes from the OctoberCMS `develop` branch into your development branch. + +#### Resolving merge conflicts + +Occassionally, you may encounter a merge conflict with your Pull Request. This most commonly occurs if another change made to the OctoberCMS repository was made to a file that your Pull Request has also changed. + +It is the responsibility of the author of the Pull Request to resolve any merge conflicts before their Pull Request is accepted. + +You should ensure that your local copy of OctoberCMS is synchronised with with the `develop` branch in the OctoberCMS repository. Please follow the [steps above](#best-practices) to synchronise the repositories. + +If Git reports that your changes have conflicts, you will need to resolve the changes in a way that includes the changes from the OctoberCMS repository as well as implementing your Pull Request's changes. See GitHub's guide to [resolving a merge conflict](https://help.github.com/en/articles/resolving-a-merge-conflict-using-the-command-line) for tips on resolving conflicts. #### PSR Coding standards @@ -106,8 +131,24 @@ To validate your changes against our coding standards, you may run `./vendor/bin #### Team rules -The October team follows the [developer guidelines](https://octobercms.com/docs/help/developer-guide) as much as possible. +The OctoberCMS team follows the [developer guidelines](https://octobercms.com/docs/help/developer-guide) as much as possible. -#### Escalation process +## Testing a Pull Request -We do our best to attend to all reported issues. If you have an important issue that requires attention, consider submitting a bounty using the [OctoberCMS Bounty Program](https://www.bountysource.com/teams/october). +Although we aim to test all pull requests made to the OctoberCMS repository, the maintainers of OctoberCMS are volunteers and may not be able to promptly attend to all pull requests. + +To help speed things up, any assistance with testing Pull Requests and fixes will be very appreciated. The best Pull Requests to test are those that are tagged as [**Testing Needed**](https://github.com/octobercms/october/pulls?q=is%3Apr+is%3Aopen+label%3A%22Testing+Needed%22) in the repository. + +To test a Pull Request, you can use the steps below in a terminal or command-line interface to create a fresh installation of OctoberCMS with the changes made in the Pull Request, ready to test. In this example, we have a user called `qwerty123` that has created a pull request with an ID of `#4509`. + +1. Check out a copy of the OctoberCMS repository to a folder that you can view in your web browser: `git clone git@github.com:octobercms/october.git`. This will add the files into a subfolder called `october`. + +2. Then, go to the `october` subfolder and check out **@qwerty123**'s changes in a branch in your local repository: `git fetch origin pull/4509/head:pr-4509`. This will pull their changes into a branch called `pr-4509`. You will then need to check out the branch: `git checkout pr-4509`. + +3. Next, get the Composer dependencies: `composer update`. + +4. Next, run `php artisan october:env` to create a `.env` file in your folder. This will contain the configuration values for the database and site. + +5. Finally, once you've populated that file with your database and site details, run `php artisan october:up` to install the necessary database tables. + +At this point, you should have a working copy of the Pull Request ready to test. diff --git a/README.md b/README.md index e84fe7bbf..9f4d1a227 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,10 @@ You may also watch these introductory videos for [beginners](https://vimeo.com/7 Before sending a Pull Request, be sure to review the [Contributing Guidelines](.github/CONTRIBUTING.md) first. +### Help and support this project + +You can also help the project by reviewing and testing open Pull Requests with the "**Status: Testing Needed**" tag, read more [https://github.com/octobercms/october/blob/master/.github/CONTRIBUTING.md#testing-pull-requests](link to contributing) + ## Coding standards Please follow the following guides and code standards: