dev/provisioning/modules/elasticsearch/CONTRIBUTING.md
author ymh <ymh.work@gmail.com>
Thu, 23 Feb 2017 18:55:55 +0100
changeset 524 85e8382852e7
parent 406 cf0f23803a53
permissions -rwxr-xr-x
Correct viaf resolver when there is no fr or en names
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     1
# Contributing
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     3
If you have a bugfix or new feature that you would like to contribute to this puppet module, please find or open an issue about it first.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     4
Talk about what you would like to do.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     5
It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     6
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     7
**Note**: If you have support-oriented questions that aren't a bugfix or feature request, please post your questions on the [discussion forums](https://discuss.elastic.co/c/elasticsearch).
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     8
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     9
We enjoy working with contributors to get their code accepted.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    10
There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
The process for contributing to any of the Elastic repositories is similar.
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    14
## The Contributor License Agreement
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    15
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    16
Please make sure you have signed the [Contributor License Agreement](http://www.elastic.co/contributor-agreement/).
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    17
We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    18
We ask this of all contributors in order to assure our users of the origin and continuing existence of the code.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    19
You only need to sign the CLA once.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    20
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    21
## Development Setup
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    22
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    23
There are a few testing prerequisites to meet:
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    24
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    25
* Ruby.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    26
  As long as you have a recent version with `bundler` available, `bundler` will install development dependencies.
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    28
You can then install the necessary gems with:
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    29
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    30
    make
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    31
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    32
This will install the requisite rubygems for testing into `.vendor`.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    33
Note that you can purge all testing fixtures/artifacts/gems with `make clean`.
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    35
* Docker.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    36
  Note that Docker is used to run tests that require a Linux container/VM - if you only need to run simple rspec/doc tests, this shouldn't be necessary.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    37
  If you are developing on a Linux machine with a working Docker instance, this should be sufficient.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    38
  On OS X, just use the official [Docker installation method](https://docs.docker.com/engine/installation/mac/) to get a working `docker` setup.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    39
  Confirm that you can communicate with the Docker hypervisor with `docker version`.
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    41
## Testing
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    43
Running through the tests on your own machine can get ahead of any problems others (or Jenkins) may run into.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    44
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    45
First, run the rspec tests and ensure it completes without errors with your changes. These are lightweight tests.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    46
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    47
    make test-rspec
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    48
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    49
Next, run the more thorough acceptance tests.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    50
By default, the test will run against a Debian 8 Docker image - other available hosts can be found in `spec/acceptance/nodesets`.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    51
For example, to run the acceptance tests against CentOS 6, run the following:
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    52
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    53
    DISTRO=centos-6-x64 make test-acceptance
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    54
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    55
The final output line will tell you which, if any, tests failed.
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    57
## Opening Pull Requests
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    58
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    59
In summary, to open a new PR:
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    61
* Sign the Contributor License Agreement
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    62
* Run the tests to confirm everything works as expected
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    63
* Rebase your changes.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    64
  Update your local repository with the most recent code from this puppet module repository, and rebase your branch on top of the latest master branch.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    65
* Submit a pull request
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    66
  Push your local changes to your forked copy of the repository and submit a pull request.
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    67
  In the pull request, describe what your changes do and mention the number of the issue where discussion has taken place, eg "Closes #123".
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
406
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    69
Then sit back and wait!
cf0f23803a53 upgrade elasticsearch to 5.0, upgrade ember
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    70
There will probably be discussion about the pull request and, if any changes are needed, we would love to work with you to get your pull request merged into this puppet module.