diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000000000000000000000000000000000000..be7884db491e7c27502aa7bad7befae1e1b40e0e --- /dev/null +++ b/TODO.md @@ -0,0 +1,17 @@ +# TODO + +## Documentation structure + +* Where should we store deprecated documentation? Should we include it at all? +* Should we rename `develop.md` (`core/develop.md` vs `extension/develop.md`?) + +## Tasks + +* Finish importing [GitHub for CiviCRM](https://wiki.civicrm.org/confluence/display/CRMDOC43/GitHub+for+CiviCRM) to `develop.md` and `develop-deprecated.md`. + +## Extension questions + +* How do I include Composer libraries in my CiviCRM extension? +* Should I add the `vendor/` directory to Git? +* How do I release my extension? +* How do I provide downloadable .zip files from Github (which are working builds)? diff --git a/docs/develop-deprecated.md b/docs/develop-deprecated.md new file mode 100644 index 0000000000000000000000000000000000000000..081885c0002da12f2045bd505d335b0cac52bf9d --- /dev/null +++ b/docs/develop-deprecated.md @@ -0,0 +1,31 @@ +# Deprecated developer instructions + +These instructions are for historical reference only, but may be of use if the newer processes don't suit your working environment. + +## Deprecated: Manual checkout from Github + +Steps: + +* Perform a standard CiviCRM install from tarball +* Use the "gitify" command to replace the codebase with the latest code from git. + +Obtain the existing CiviCRM directory (such as `/var/www/drupal/sites/all/modules/civicrm` or `/home/myuser/src/civicrm`), then run the `gitify` command. You will need to adapt the command arguments, but a typical case would be: + + cd /tmp + wget https://github.com/civicrm/civicrm-core/raw/master/bin/gitify + bash gitify Drupal git://github.com/civicrm /var/www/drupal/sites/all/modules/civicrm --hooks + +If you develop for multi-CMS, then you might have one copy of CiviCRM (e.g. `/home/myuser/src/civicrm`) shared by each CMS. You can use `gitify` to setup this directory, and then use symlinks to share among CMSs: + + ## Create ~/src/civicrm + mkdir -p ~/src/civicrm + wget https://github.com/civicrm/civicrm-core/raw/master/bin/gitify + bash gitify all git://github.com/civicrm ~/src/civicrm --l10n --hooks + + ## Replace an old symlink with new symlink + rm /var/www/drupal7/sites/all/modules/civicrm + ln -s ~/src/civicrm /var/www/drupal7/sites/all/modules/civicrm + +## References + +* [Wiki: GitHub For CiviCRM](https://wiki.civicrm.org/confluence/display/CRMDOC43/GitHub+for+CiviCRM) diff --git a/docs/develop.md b/docs/develop.md index f58af5f5553503afac537f37a349364115557c67..738197f7cdd7408c670397d59787907c239fb563 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -1,3 +1,22 @@ -*Develop* +# Develop -TODO: Assimilate http://wiki.civicrm.org/confluence/display/CRMDOC/GitHub+for+CiviCRM +Tip: If Git or GitHub are unfamiliar to you, see [Git and GitHub](git.md) first. + +## Repositories + +CiviCRM is divided into a few repositories. This allows developers to work with different components, allows different teams to manage each component, and will allow all the pieces to be remixed using different tools (civibuild, shell scripts, Drush & Drush make, or composer). The repositories are: + +* [civicrm-core](https://github.com/civicrm/civicrm-core/) - Core application which can be embedded in different systems (Drupal, Joomla, etc). +* [civicrm-drupal](https://github.com/civicrm/civicrm-drupal/) - Drupal integration modules, with branches for each CiviCRM release & Drupal major version (e.g. 7.x-4.6, 7.x-4.7, 6.x-4.4, 6.x-4.6). +* [civicrm-joomla](https://github.com/civicrm/civicrm-joomla/) - Joomla integration modules. +* [civicrm-wordpress](https://github.com/civicrm/civicrm-wordpress/) - WordPress integration modules. +* [civicrm-packages](https://github.com/civicrm/civicrm-packages/) - External dependencies required by CiviCRM. +* [civicrm-l10n](https://github.com/civicrm/civicrm-l10n/) - Localization data. + +## Obtaining a development build of CiviCRM + +The recommended method is to use [CiviCRM Buildkit](https://github.com/civicrm/civicrm-buildkit/) to build a CiviCRM codebase to develop with. + +## Deprecated instructions + +Previous methods for obtaining a CiviCRM source build are documented at [Deprecated Developer Processes](develop-deprecated.md). diff --git a/docs/git.md b/docs/git.md new file mode 100644 index 0000000000000000000000000000000000000000..e39ae08c0578f4d000e9948d05d792351248b96c --- /dev/null +++ b/docs/git.md @@ -0,0 +1,13 @@ +# Git and GitHub + +**Git** is a "source-code management system" or "version control system" – an alternative to Subversion. It was designed for a large open-source project (Linux) and has seen broad adoption among other FOSS projects. **GitHub** is a company which provides hosted, web-based tools for enhancing Git development. For open projects like CiviCRM, its services are free. + +Git and GitHub offer advantages for CiviCRM development: + +* The tools are already popular among FOSS projects and web developers. +* The tools are free ("as in beer") and mostly free ("as in speech"). +* They support off-line development. +* They support lightweight branching, merging, and code-review. +* They support open teams – anyone can jump-in, make changes, and share changes. + +For more introductions to Git and Github, see [help.github.com](https://help.github.com/). diff --git a/docs/testing.md b/docs/testing.md index e16d9c0f529217d48a92941cbf223296c107f6fa..b12cc68f9ac3776c991a0ab9c69a29130d117782 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1,65 +1,67 @@ Testing ======= -Testing in CiviCRM is done by a combination of human code review and testing as well as automated testing. Testing is done based on pull requests (PRs) in [Github](https://github.com/civicrm/civicrm-core/pulls). PRs are generally a response to issues reported in [JIRA](https://issues.civicrm.org/), the issue tracking system for CiviCRM. +Testing in CiviCRM is done by a combination of human code review and testing as well as automated testing. Testing is done based on pull requests (PRs) in [GitHub](https://github.com/civicrm/civicrm-core/pulls). Pull requests are code submitted in response to issues reported in [JIRA](https://issues.civicrm.org/), the issue tracking system for CiviCRM. Automated tests --------------- -TODO: +TO DO: * http://wiki.civicrm.org/confluence/display/CRMDOC/Testing Manual testing --------------- -When testing this is the proccess you should use: +When testing the process you should use is: -* Check if the PR is paired with a JIRA issue +* Check if the PR is paired with an issue in JIRA * Read the JIRA ticket * Look at the bug in JIRA and ask yourself if you agree with the analysis of the bug * Check if the automated tests have passed * Attempt to replicate the bug * Comment on the Github PR if you managed to replicate the issue, and how. -* Check that the bug has been fixed with the patch +* Check that the bug has been fixed with the patch In order to reproduce the bug you can reproduce the issue in the appropriate [CiviCRM Sandbox](https://civicrm.org/sandboxes). Enabling debugging can help to get more details. -CiviCRM uses a system called Jenkins to do automated testing. To get to Jenkins results for a specific PR click *Show all checks* and then *Details*. +CiviCRM uses a system called Jenkins to do automated testing. To get to Jenkins results for a specific PR click *Show all checks* and then *Details*.  -When Jenkins runs the tests, it also setups a test site that will be available for aproximately one week. To find the link to the site click "Console Output" on the left hand menu. Click "Full Log" at the top of the page and then you can search for *CMS_URL* in the output. +When Jenkins runs the tests, it also setups a test site that will be available for aproximately one week. To find the link to the site click "Console Output" on the left hand menu. Click "Full Log" at the top of the page and then you can search for *CMS_URL* in the output. - + There are multiple times that CMS_URL is in the log output. -If a PR is updated or re-tested, the initial test site will be deleted (since a new test site will have been created). +If a PR is updated or re-tested, the initial test site will be deleted (since a new test site will have been created). -If the tests have failed for something that we suspect is a random failure, we can ask Jenkins to run the tests again by commenting in the PR "Jenkins, test this please". [see] (https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin). New contributors to CiviCRM will require an admin to approve running the tests by commenting on the PR "ok to test". Jenkins will automatically respond "can an admin verify this patch?" If the user is trusted, CiviCRM administrators can add the person to the whitelist by commenting "add to whitelist". +If the tests have failed for something that we suspect is a random failure, we can ask Jenkins to run the tests again by commenting in the PR "Jenkins, test this please" (this is the [GitHub PR Builder plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin)). For new (unrecognised by Jenkins) contributors, Jenkins will automatically respond "can an admin verify this patch?", and a Github user with admin permissions may approve running the tests by commenting on the PR "ok to test". If the user is trusted, CiviCRM administrators can add the person to the whitelist by commenting "add to whitelist". Jenkins only builds a Drupal site that is built against the branch that your PR is modifying. If you need to test a patch against another CMS than you will want to test the patch in your own environment. If you have an existing environment you can use *git* or *hub* to checkout the specific PR. Hub example where 8473 is the PR ID. -`hub checkout https://github.com/civicrm/civicrm-core/pull/8473` -Git example where 8473 is the PR ID and 4.6 is the branch. -`git fetch origin pull/8473/head:4.6` + hub checkout https://github.com/civicrm/civicrm-core/pull/8473 -If you do not have an existing environment you can use Buildkit to create one quickly. [Buildkit](https://github.com/civicrm/civicrm-buildkit) is a powerful command line tool for CiviCRM that allows for rapidly creating CiviCRM environments. Buildkit can create installs for Drupal7, Drupal6, WordPress and Backdrop. +Example Git command, where 8473 is the PR ID and 4.6 is the branch. -You can for example run `civibuild create dmaster --url http://localhost:8001 --patch https://github.com/civicrm/civicrm-core/pull/8494 --admin-pass s3cr3t` and you will get a test environment with the Drupal, CiviCRM master branch and the patch in PR 8494. You can get much more detailed information in the [Civibuild documentation](https://github.com/civicrm/civicrm-buildkit/blob/master/doc/civibuild.md) + git fetch origin pull/8473/head:4.6 -Every month, a release announcement message is sent to participants in the review process. The announcement is sent on the [civicrm-dev mailing-list](http://lists.civicrm.org/lists/info/civicrm-dev) and issue is posted on [github.com/civicrm](http://github.com/civicrm). The GitHub post mentions the account names of everyone who has submitted a PR recently (so that they get a notification). +If you do not have an existing environment you can use Buildkit to create one quickly. [Buildkit](https://github.com/civicrm/civicrm-buildkit) is a powerful command line tool for CiviCRM that allows for rapidly creating CiviCRM environments. Buildkit can create installs for Drupal7, Drupal6, WordPress and Backdrop. -###Notifications -* When opening a PR, submitter is pointed to the CiviCRM Core [contributing documentation](https://github.com/civicrm/civicrm-core/blob/master/.github/CONTRIBUTING.md) -* At start of month @mentions is used to ping authors, e.g. [https://github.com/civicrm/release-management/issues/2](https://github.com/civicrm/release-management/issues/2) -* The notice to authors contains the Release Planning spreadsheet. For [example](https://docs.google.com/spreadsheets/d/10EyNqm3-CbAwUjYzckrwSE7VjpZCfatzh-bES59XqA8/edit?usp=sharing). -* You can also signup for the release week planning emails. For [example](https://gist.github.com/totten/0d05ca4bbe0e1727ee5895f6e588d068) +Using Buildkit, you can create a CiviCRM environment with the PR applied. Example Buildkit command: + civibuild create dmaster --url http://localhost:8001 --patch https://github.com/civicrm/civicrm-core/pull/8494 --admin-pass s3cr3t +This will create a test environment with the Drupal, CiviCRM master branch and the patch in PR 8494. More detailed information is in the [Civibuild documentation](https://github.com/civicrm/civicrm-buildkit/blob/master/doc/civibuild.md) +Every month, a release announcement message is sent to participants in the review process. The announcement is sent on the [civicrm-dev mailing-list](http://lists.civicrm.org/lists/info/civicrm-dev) and issue is posted on [github.com/civicrm](http://github.com/civicrm). The GitHub post mentions the account names of everyone who has submitted a PR recently (so that they get a notification). +## Notifications +* When opening a PR, submitter is pointed to the CiviCRM Core [contributing documentation](https://github.com/civicrm/civicrm-core/blob/master/.github/CONTRIBUTING.md) +* At start of month @mentions is used to ping authors, e.g. [https://github.com/civicrm/release-management/issues/2](https://github.com/civicrm/release-management/issues/2) +* The notice to authors contains the Release Planning spreadsheet. For [example](https://docs.google.com/spreadsheets/d/10EyNqm3-CbAwUjYzckrwSE7VjpZCfatzh-bES59XqA8/edit?usp=sharing). +* You can also signup for the release week planning emails. For [example](https://gist.github.com/totten/0d05ca4bbe0e1727ee5895f6e588d068) diff --git a/mkdocs.yml b/mkdocs.yml index 170a745756745ad9e5124fdbf1622a47927b0379..5bedbc60c1044e550dd0fb699acf934cda904ce7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,6 +8,7 @@ pages: - Customize: customize.md - Extend: extend.md - Develop: develop.md + - Git: git.md - Testing: testing.md - 'Reference: APIv3': - General: api/general.md @@ -18,6 +19,8 @@ pages: - 'Reference: Hooks': - General: hook.md - Database: hooks-db.md - - Gunk: + - Miscellaneous: - Markdown: markdownrules.md - hookref-old: hookref-old.md + - Deprecated: + - 'Building CiviCRM from source': develop-deprecated.md