1. For tests that use Capybara or PhantomJS, see this [article on how
[how to write reliable, asynchronous integration tests](https://robots.thoughtbot.com/write-reliable-asynchronous-integration-tests-with-capybara).
to write reliable asynchronous tests](https://robots.thoughtbot.com/write-reliable-asynchronous-integration-tests-with-capybara).
1. If your merge request introduces changes that require additional steps when
1. If your merge request introduces changes that require additional steps when
installing GitLab from source, add them to `doc/install/installation.md` in
installing GitLab from source, add them to `doc/install/installation.md` in
the same merge request.
the same merge request.
...
@@ -95,109 +99,117 @@ request is as follows:
...
@@ -95,109 +99,117 @@ request is as follows:
instructions are specific to a version, add them to the "Version specific
instructions are specific to a version, add them to the "Version specific
upgrading instructions" section.
upgrading instructions" section.
Please keep the change in a single MR **as small as possible**. If you want to
If you would like quick feedback on your merge request feel free to mention someone
contribute a large feature think very hard what the minimum viable change is.
from the [core team](https://about.gitlab.com/community/core-team/) or one of the
Can you split the functionality? Can you only submit the backend/API code? Can
[merge request coaches](https://about.gitlab.com/team/). When having your code reviewed
you start with a very simple UI? Can you do part of the refactor? The increased
and when reviewing merge requests, please keep the [code review guidelines](../code_review.md)
reviewability of small MRs that leads to higher code quality is more important
in mind.
to us than having a minimal commit log. The smaller an MR is the more likely it
is it will be merged (quickly). After that you can send more MRs to enhance it.
### Keep it simple
The ['How to get faster PR reviews' document of Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md) also has some great points regarding this.
*Live by smaller iterations.* Please keep the amount of changes in a single MR **as small as possible**.
For examples of feedback on merge requests please look at already
If you want to contribute a large feature, think very carefully about what the
[closed merge requests][closed-merge-requests]. If you would like quick feedback
enhance and expand the feature. The [How to get faster PR reviews](https://github.com/kubernetes/kubernetes/blob/release-1.5/docs/devel/faster_reviews.md)
For more information see [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/).
## Contribution acceptance criteria
## Contribution acceptance criteria
1. The change is as small as possible
To make sure that your merge request can be approved, please ensure that it meets
the contribution acceptance criteria below:
1. The change is as small as possible.
1. Include proper tests and make all tests pass (unless it contains a test
1. 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
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.
unit tests, even if the class is exercised at a higher level, such as a feature test.
1. If you suspect a failing CI build is unrelated to your contribution, you may
- If a failing CI build seems to be unrelated to your contribution, you can try
try and restart the failing CI job or ask a developer to fix the
restarting the failing CI job, rebasing from master to bring in updates that
aforementioned failing test
may resolve the failure, or if it has not been fixed yet, ask a developer to
1. Your MR initially contains a single commit (please use `git rebase -i` to
help you fix the test.
squash commits)
1. The MR initially contains a a few logically organized commits.
1. Your changes can merge without problems (if not please rebase if you're the
1. The changes can merge without problems. If not, you should rebase if you're the
only one working on your feature branch, otherwise, merge `master`)
only one working on your feature branch, otherwise merge `master`.
1. Does not break any existing functionality
1. Only one specific issue is fixed or one specific feature is implemented. Do not
1. Fixes one specific issue or implements one specific feature (do not combine
combine things; send separate merge requests for each issue or feature.
things, send separate merge requests if needed)
1. Migrations should do only one thing (e.g., create a table, move data to a new
1. Migrations should do only one thing (e.g., either create a table, move data
table, or remove an old table) to aid retrying on failure.
to a new table or remove an old table) to aid retrying on failure
1. Contains functionality that other users will benefit from.
1. Keeps the GitLab code base clean and well structured
1. Doesn't add configuration options or settings options since they complicate making
1. Contains functionality we think other users will benefit from too
and testing future changes.
1. Doesn't add configuration options or settings options since they complicate
1. Changes do not degrade performance:
making and testing future changes
- Avoid repeated polling of endpoints that require a significant amount of overhead.
1. Changes do not adversely degrade performance.
- Check for N+1 queries via the SQL log or [`QueryRecorder`](../merge_request_performance_guidelines.md).
- Avoid repeated polling of endpoints that require a significant amount of overhead
- Avoid repeated access of the filesystem.
- Check for N+1 queries via the SQL log or [`QueryRecorder`](https://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- Use [polling with ETag caching](../polling.md) if needed to support real-time features.
- Avoid repeated access of filesystem
1. If the merge request adds any new libraries (gems, JavaScript libraries, etc.),
1. If you need polling to support real-time features, please use
they should conform to our [Licensing guidelines](../licensing.md). See those
[polling with ETag caching][polling-etag].
instructions for help if the "license-finder" test fails with a
1. Changes after submitting the merge request should be in separate commits
`Dependencies that need approval` error. Also, make the reviewer aware of the new
(no squashing).
library and explain why you need it.
1. It conforms to the [style guides](style_guides.md) and the following:
1. The merge request meets GitLab's [definition of done](#definition-of-done), below.
- If your change touches a line that does not follow the style, modify the
entire line to follow it. This prevents linting tools from generating warnings.
- Don't touch neighbouring lines. As an exception, automatic mass
refactoring modifications may leave style non-compliant.
1. If the merge request adds any new libraries (gems, JavaScript libraries,
etc.), they should conform to our [Licensing guidelines][license-finder-doc].
See the instructions in that document for help if your MR fails the
"license-finder" test with a "Dependencies that need approval" error.
1. The merge request meets the [definition of done](#definition-of-done).
[license-finder-doc]:../licensing.md
[polling-etag]:../polling.md
## Definition of done
## Definition of done
If you contribute to GitLab please know that changes involve more than just
If you contribute to GitLab please know that changes involve more than just
code. We have the following [definition of done][definition-of-done]. Please ensure you support
code. We use the following [definition of done](https://www.agilealliance.org/glossary/definition-of-done).
the feature you contribute through all of these steps.
Your contribution is not *done* until you have made sure it meets all of these
requirements.
1. Description explaining the relevancy (see following item)
1. Working and clean code that is commented where needed
1. Clear description explaining the relevancy of the contribution.
1.[Unit, integration, and system tests][testing] that pass on the CI server
1. Working and clean code that is commented where needed.
1. Performance/scalability implications have been considered, addressed, and tested
1.[Unit, integration, and system tests](../testing_guide/index.md) that all pass
1.[Documented][doc-guidelines] in the `/doc` directory
on the CI server.
1.[Changelog entry added][changelog], if necessary
1. Performance/scalability implications have been considered, addressed, and tested.
1. Reviewed by UX/FE/BE and any concerns are addressed
1.[Documented](../documentation/index.md) in the `/doc` directory.
1. Merged by a project maintainer
1.[Changelog entry added](../changelog.md), if necessary.
1. Added to the release blog article, if relevant
1. Reviewed by relevant (UX/FE/BE/tech writing) reviewers and all concerns are addressed.
1. Added to [the website](https://gitlab.com/gitlab-com/www-gitlab-com/), if relevant
1. Merged by a project maintainer.
1. Community questions answered
1. Added to the [release post](https://about.gitlab.com/handbook/marketing/blog/release-posts/),
1. Answers to questions radiated (in docs/wiki/support etc.)
if relevant.
1.[Black-box tests/end-to-end tests](../testing_guide/testing_levels.md#black-box-tests-at-the-system-level-aka-end-to-end-tests) added if required. Please contact [the quality team](https://about.gitlab.com/handbook/engineering/quality/#teams) with any questions
1. Added to [the website](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/features.yml), if relevant.