Make pull requests to the develop
branch. Once all tests are passing on develop
, we will merge to master
and release the gem.
gooddata-ruby has a robust CI setup in place to ensure easy contributing by both GD employees and outsiders. The CI is based on travis-ci and all of the environment specifics is versioned in .travis.yml
The pipeline is split into two parts - before-merge and after-merge.
This pipeline has to pass before the merge of a PR. All of the checks included are runnable without special permissions or credentials (it is possible to run them as an outside contributor). It includes a suite of unit tests, automated code review tools and mocked (thru VCR) integration and E2E tests.
This pipeline has to pass before a release is made. It extends the before-merge suite, running it against a live GD env (staging servers) and adds more thorough specs (load specs, slow specs). Special permissions and credentials are required (member of github GD organization, valid testing credentials).
It is possible to create a local "fork" of the CI environment on travis-ci.org or travis-ci.com. The forked environment will still use the versioned .travis.yml, so all of the settings (including email reporting) will be also valid on the fork. To see a solution to this, check https://confluence.intgdc.com/display/~jakub.mahnert/gooddata-ruby+CI+notification+setup (only applies to specific GD employees)
bundle exec rake test:unit
Currently only GoodData employees can run integration tests for security reasons.
GD_SPEC_PASSWORD=*** bundle exec rake test:integration
Integration tests can be run against different GoodData environments or with VCR.
When adding new integration test, always set :vcr
metadata.
describe 'New integration test', :vcr
The VCR record
mode can be set via VCR_RECORD_MODE
environment variable. Set it to all
to make a new recording.
Please check the recorded payloads for possible sensitive data before submitting to github.
If you are so lucky and have acces to PI, you can run the test agains it ... there is guide in confluence
We use Pronto to detect code smells using static analysis.
bundle exec pronto run --unstaged -c upstream/develop
We use yard
to auto-generate documentation from comments. Document all new and modified public methods using yard
tags. Run ./yard-server.sh
to see the result.
Usage examples can be found here. If your change deserves an example, make a PR to this repo.
- The change is as small as possible. It fixes one specific issue or implements one specific feature. Do not combine things, send separate pull requests if needed.
- Include proper tests and make all tests pass (unless it contains a test exposing a bug in existing code). Every new class should have corresponding unit tests, even if the class is exercised at a higher level, such as a feature test.
- Every bug-fix has a regression test.
- If you suspect a failing CI build is unrelated to your contribution, you may try and restart the failing CI job or ask a developer to fix the aforementioned failing test.
- Code conforms to this style guide.
- When writing tests, please follow these guidelines.
- Changes do not adversely degrade performance.
- Your PR contains a single commit (please use
git rebase -i
to squash commits) - When writing commit messages, please follow these guidelines.
- Your changes can merge without problems (if not please rebase if you're the
only one working on your feature branch, otherwise, merge
master
). - If the pull request adds any new libraries, they should be in line with our license.
- Use
GoodData.logger
for logging instead ofputs
. - Public methods are documented and examples are added to the cookbook when applicable.
Based on GitLab's contribution guide.