GithubHelp home page GithubHelp logo

isabella232 / wp-github-pull-request-travis-ci-trac-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xwp/wp-github-pull-request-travis-ci-trac-sync

0.0 0.0 0.0 26 KB

Sync from GitHub Pull Requests to WordPress Trac via Travis CI (see Trac #34694)

Shell 68.70% PHP 31.30%

wp-github-pull-request-travis-ci-trac-sync's Introduction

Sync from GitHub Pull Requests to WordPress Trac via Travis CI

This script facilitates contributing to WordPress Core via GitHub Pull Requests. See WordPress Trac #34694.

Caveat: This is intended for users in trusted contributor teams as it requires the user to open open an internal (intra-repo) pull request from feature branch to master. It will not work when opening a pull request from a fork due to Travis CI's security restrictions on environment variables. So any pull requests from external contributors will need to be manually applied to a feature branch by a repo contributor and then open an intra-repo pull request (while closing the original inter-repo pull request).

Installation

  1. Clone the develop.git.wordpress.org repo onto GitHub and enable Travis CI for it. See instructions in Contributing to WordPress Core via GitHub.
  2. Create a bot user on WordPress.org (e.g. xwp-bot) and request that the XML_RPC privilege be granted for that user.
  3. Ensure the patch from Trac #34694 is applied to WordPress Core; if not already upstreamed, make it the first commit to each feature branch.
  4. Edit the Travis CI settings for your WordPress GitHub clone to add the following environment variables:

For more information, see Streamlining Contributions to WordPress Core via GitHub.

Usage

Once configured, a developer with write access to the GitHub repo can contribute to WordPress Core as follows:

  1. Ensure that a Trac ticket exists.
  2. Push commits to a feature branch on GitHub named after the Trac ticket (e.g. trac-12345).
  3. Open pull request to master; this must be an internal (intra-repo) pull request, not from a fork (inter-repo).
  4. Watch Travis CI run its tests, and when completed look at Trac to see the patch uploaded.

As a bonus, the changes in the pull request will also have the following checks run:

  • Modified PHP files will be checked for syntax errors.
  • PHP changes will be checked with PHP_CodeSniffer against the WordPress-Core and WordPress-Docs standards.
  • JS changes will be checked with JSCS against the wordpress preset.

Note that if there are no PHP files modified in a pull request, the PHPUnit tests will be skipped altogether, drastically speeding up the build time.

Background

For the initial post that describes the approach, as linked above, see Streamlining Contributions to WordPress Core via GitHub.

For a prior post describing the manual workflow that is being streamlined here, also as linked above, see Contributing to WordPress Core via GitHub.

See also the WordPress Trac #34694: Facilitate automated testing in context of pull requests and diffs.

Credits

Written by Weston Ruter (westonruter), XWP.

The functionality incorporates logic from trac-attach.sh by Andrew Nacin (nacin) and Michael Adams (mdawaffe).

License GPLv2.

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.