Git Product home page Git Product logo

dexit / vip-go-mu-plugins Goto Github PK

View Code? Open in Web Editor NEW

This project forked from automattic/vip-go-mu-plugins

0.0 1.0 0.0 105.75 MB

The development repo for mu-plugins used on the VIP Go platform.

Home Page: https://docs.wpvip.com/

License: GNU General Public License v2.0

PHP 81.33% Makefile 0.01% CSS 6.25% JavaScript 11.50% Shell 0.11% HTML 0.52% SCSS 0.24% Smarty 0.01% Python 0.01% TypeScript 0.04%

vip-go-mu-plugins's Introduction

VIP Go mu-plugins

This is the development repo for mu-plugins on VIP Go.

Documentation

Enterprise Search

Please, visit our Enterprise Search documentation to learn more.

Development

Local Dev

We recommend using the VIP local development environment for local development: https://docs.wpvip.com/technical-references/vip-local-development-environment/

In order to use mu-plugins code in a "hot-reload" fashion you need to specify the local folder where this repository is cloned to. For example:

vip dev-env create --mu-plugins $(pwd)

You will be prompted to configure other options of the environment. When the environment is created you can start it with:

vip dev-env start

Tests

PHP Lint
npm run phplint
PHPCS

We use eslines to incrementally scan changed code. It will automatically run on pre-push (see .huskyrc.json).

This is also run on Circle CI for all PRs.

If you want to scan the entire codebase:

npm run phpcs
PHPUnit

If you don't have the Lando-based environment running (e.g. in a CI context), we have a script that runs unit tests in a self-contained Docker environment. To run these tests, execute the following from the project root:

./bin/test.sh

You can also filter by test name.

./bin/test.sh --filter test__rate_limit_ep_query_integration__clears_start_correctly

See ./bin/test.sh for more options.

CI

PHP Linting and PHPUnit tests are run by Circle CI as part of PRs and merges. See .circleci/config.yml for more.

Core tests

We run core tests as part of the CI pipeline. There are many failures when running with mu-plugins so we had to ignore several tests. To add another test there check bin/utils.sh.

To investigate failing test locally you can do following (buckle up as this is not so easy:()):

  1. While in your mu-plugins folder do MU_PLUGINS_DIR=$(pwd)

  2. Switch to where you want to checkout core code e.g. cd ~/svn/wp

  3. Checkout the core code (pick the latest version): svn co --quiet --ignore-externals https://develop.svn.wordpress.org/tags/5.5.3 .

  4. Create test config: cp wp-tests-config-sample.php wp-tests-config.php && sed -i 's/youremptytestdbnamehere/wordpress_test/; s/yourusernamehere/root/; s/yourpasswordhere//; s/localhost/127.0.0.1/' wp-tests-config.php

  5. Build core npm ci && npm run build

  6. Export env variable export WP_TESTS_DIR="$(pwd)/tests/phpunit"

  7. Start local DB: docker run -d -p 3306:3306 circleci/mariadb:10.2

  8. Create empty DB mysqladmin create wordpress_test --user="root" --password="" --host="127.0.0.1" --protocol=tcp

  9. Copy over MU-plugins cp -r $MU_PLUGINS_DIR build/wp-content/mu-plugins

  10. Run the test you want (in this case test_allowed_anon_comments) $MU_PLUGINS_DIR/vendor/bin/phpunit --filter test_allowed_anon_comments

Deployment

Release

A new release of the plugin consists of all those pull requests that have been merged since the last release and have been deployed to Staging (i.e. have the [Status] Deployed to staging label. Releases are named after the day they are released plus a minor version:

YYYYMMDD.x

e.g: 20210917.0

Releases are created using GitHub's releases and are effectively a tag in the GitHub repository. Previous releases can be found here.

To create a new release, please use the create-release script. The script requires the GitHub CLI to be installed in the computer. It will create the new release, properly tagged and with the expected description.

cd vip-go-mu-plugins

bin/create-release.sh

Production

For Automattic Use: Instructions are in the FG :)

vip-go-mu-plugins-built

This is a repo primarily meant for local non-development use.

Every commit merged into master is automatically pushed to the public copy at Automattic/vip-go-mu-plugins-built. This is handled via CI by the deploy.sh script script, which builds pushes a copy of this repo and expanded submodules.

vip-go-mu-plugins's People

Contributors

nickdaugherty avatar pauarge avatar mjangda avatar pschoffer avatar sjinks avatar joshbetz avatar simonwheatley avatar ethitter avatar rinatkhaziev avatar hanifn avatar dchymko avatar renovate-bot avatar scottsweb avatar rebeccahum avatar wpprodigy avatar david-binda avatar trepmal avatar sboisvert avatar emrikol avatar chrean avatar jblz avatar brettshumaker avatar saroshaga avatar garyjones avatar gudmdharalds avatar jesse-greathouse avatar shantanu2704 avatar nejclovrencic avatar mikeyarce avatar jessegreathouse avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.