* devops: Name officially changed to "WPGraphQL for WooCommerce" * devops: GA workflow environment updated * devops: GA workflow environment updated * devops: composer-git-hooks downgraded to "2.8.5" * devops: Unstable session manager tests skipped * chore: cleanup applied * devops: Docker configurations updated * devops: Docker configurations updated * devops: Docker configurations updated * devops: Docker configurations updated * devops: Docker configurations updated
4.2 KiB
Contribute to WPGraphQL for WooCommerce
WPGraphQL for WooCommerce (WooGraphQL) welcomes community contributions, bug reports and other constructive feedback.
When contributing please ensure you follow the guidelines below so that we can keep on top of things.
Getting Started
- Do not report potential security vulnerabilities here. Email them privately to our security team at support@axistaylor.com
- Before submitting a ticket, please be sure to replicate the behavior with no other plugins active and on a base theme like Twenty Seventeen.
- Submit a ticket for your issue, assuming one does not already exist.
- Raise it on our Issue Tracker
- Clearly describe the issue including steps to reproduce the bug.
- Make sure you fill in the earliest version that you know has the issue as well as the version of WordPress you're using.
Making Changes
- Fork the repository on GitHub
- Make the changes to your forked repository
- Ensure you stick to the WordPress Coding Standards
- When committing, reference your issue (if present) and include a note about the fix
- If possible, and if applicable, please also add/update unit tests for your changes
- Push the changes to your fork and submit a pull request to the 'develop' branch of this repository
Setting up an environment to run the WPUnit tests
-
Create a
.envfile from the provided.env.testingand update the following section.# WordPress database configurations DB_NAME=wordpress DB_HOST=app_db DB_PORT=3306 DB_USER=wordpress DB_PASSWORD=password ROOT_PASSWORD=password WP_TABLE_PREFIX=wp_ SKIP_DB_CREATE=true SKIP_WP_SETUP=trueThe variable should be point to a local instance of MySQL and
SKIP_DB_CREATEandSKIP_WP_SETUPshould be set tofalse. -
Run
composer installTestEnvfrom the terminal in the plugin root directory. This will run the setup script and install all the required dependencies. -
Run the tests by running
vendor/bin/codecept run wpunitfrom the root directory. To learn about the libraries used to write the tests see Codeception, WPBrowser, and WPGraphQL TestCase
Setting up a Docker environment to run the E2E tests
- Run
composer installTestEnvfrom the terminal in the plugin root directory to install all the required dependencies. - Next run
composer dRunApp. This will build and start the docker network at http://localhost:8080 based off the configuration found in thedocker-compose.ymlin the project root. - Last run the test by running
composer dRunTest. This runs the test suite by utilizing thedocker execcommand to runvendor/bin/codecept runfrom the project root within the docker container for wordpress site. You can pass further parameter to this comment by using theFILTERenvironment variable like soFILTER="acceptance NewCustomerCheckingOutCept --debug" composer dRunTest.
NOTE: If you have no interest in the generated docker environment outside of automated test you can simply the process by just running the
dRunTestStandalonecommand after theinstallTestEnvcommand combining steps 2 & 3,composer dRunTestStandalone. The command also reads theFILTERvariables as well to so filter is possibleFILTER="acceptance NewCustomerCheckingOutCept --debug" composer dRunTestStandalone.
Code Documentation
- We strive for full doc coverage and follow the standards set by phpDoc
- Please make sure that every function is documented so that when we update our API Documentation things don't go awry!
- If you're adding/editing a function in a class, make sure to add
@access {private|public|protected}
- If you're adding/editing a function in a class, make sure to add
- Finally, please use tabs and not spaces.
At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
NOTE: This CONTRIBUTING.md file was forked from WPGraphQL