Skip to content

Latest commit

 

History

History
123 lines (76 loc) · 10.1 KB

CONTRIBUTING.md

File metadata and controls

123 lines (76 loc) · 10.1 KB

Contributing to the Apache Pekko DynamoDB Persistence Plugin

Infrastructure

Project & Developer Guidelines

These guidelines are meant to be a living document that should be changed and adapted as needed. We encourage changes that makes it easier to achieve our goals in an efficient way.

General Workflow

This is the process for committing code into main branch. There are of course exceptions to these rules, for example minor changes to comments and documentation, fixing a broken build etc.

  1. For non-trivial changes, you will be asked to submit a CLA - if you do not have one on file.

  2. Before starting to work on a feature or a fix, make sure that:

    1. There is a ticket for your work in the project's issue tracker. If not, create it first.
    2. The ticket has been scheduled for the current milestone.
    3. The ticket have been discussed and prioritized by the team.
  3. You should always perform your work in a Git feature branch.

  4. When the feature or fix is completed you should open a Pull Request on GitHub.

  5. The Pull Request should be reviewed by other maintainers (as many as feasible/practical). Note that the maintainers can consist of outside contributors, both within and outside Typesafe. Outside contributors (for example from EPFL or independent committers) are encouraged to participate in the review process, it is not a closed process.

  6. After the review you should fix the issues as needed (pushing a new commit for new review etc.), iterating until the reviewers give their thumbs up.

    When the branch conflicts with its merge target (either by way of git merge conflict or failing CI tests), do not merge the target branch into your feature branch. Instead rebase your branch onto the target branch. Merges complicate the git history, especially for the squashing which is necessary later (see below).

  7. Once the code has passed review the Pull Request can be merged into the main branch. For this purpose the commits which were added on the feature branch should be squashed into a single commit. This can be done using the command git rebase -i main (or the appropriate target branch), picking the first commit and squashing all following ones.

    Also make sure that the commit message conforms to the syntax specified below.

  8. If the code change needs to be applied to other branches as well, create pull requests against those branches which contain the change after rebasing it onto the respective branch and await successful verification by the continuous integration infrastructure; then merge those pull requests.

    Please mark these pull requests with (for validation) in the title to make the purpose clear in the pull request list.

  9. Once everything is said and done, associate the ticket with the “earliest” release milestone (i.e. if back-ported so that it will be in release x.y.z, find the relevant milestone for that release) and close it.

Pull Request Requirements

For a Pull Request to be considered at all it has to meet these requirements:

  1. Live up to the current code standard:
  2. Regardless if the code introduces new features or fixes bugs or regressions, it must have comprehensive tests.
  3. The code must be well documented in the Typesafe's standard documentation format (see the ‘Documentation’ section below).
  4. The commit messages must properly describe the changes, see further below.
  5. All ASF projects require the source code to have license headers.

Other guidelines to follow for copyright notices:

  • If you copy code from another source then retain its source header(s).
  • New source files should have an Apache Source License.
  • Never delete or change existing source headers.
  • Do not use @author tags since it does not encourage Collective Code Ownership.

If these requirements are not met then the code should not be merged into main branch, or even reviewed - regardless of how good or important it is. No exceptions.

Whether or not a pull request (or parts of it) shall be back- or forward-ported will be discussed on the pull request discussion page, it shall therefore not be part of the commit messages. If desired the intent can be expressed in the pull request description.

Continuous Integration

Each project should be configured to use a continuous integration (CI) tool (i.e. a build server à la Jenkins). Typesafe has a Jenkins server farm that can be used. The CI tool should, on each push to main branch, build the full distribution and run all tests, and if something fails it should email out a notification with the failure report to the committer and the core team. The CI tool should also be used in conjunction with Typesafe’s Pull Request Validator (discussed below).

Documentation

Unlike most Apache Pekko projects, the Apache Pekko DynamoDB Persistence Plugin project does not yet have documentation that is published to pekko.apache.org. Until this happens, we will use the GitHub project README and wiki to document how this project works.

Any new features should be documented. If there are any mistakes in the documentation, please get in touch and we will try to get the documentation fixed.

External Dependencies

All the external runtime dependencies for the project, including transitive dependencies, must have an open source license that is equal to, or compatible with, Apache 2.

This must be ensured by manually verifying the license for all the dependencies for the project:

  1. Whenever a committer to the project changes a version of a dependency (including Scala) in the build file.
  2. Whenever a committer to the project adds a new dependency.
  3. Whenever a new release is cut (public or private for a customer).

Which licenses are compatible with Apache 2 are defined in this doc, where you can see that the licenses that are listed under Category A automatically compatible with Apache 2, while the ones listed under Category B needs additional action:

Each license in this category requires some degree of reciprocity; therefore, additional action must be taken in order to minimize the chance that a user of an Apache product will create a derivative work of a reciprocally-licensed portion of an Apache product without being aware of the applicable requirements.

Each project must also create and maintain a list of all dependencies and their licenses, including all their transitive dependencies. This can be done in either in the documentation or in the build file next to each dependency.

Work In Progress

It is ok to work on a public feature branch in the GitHub repository. Something that can sometimes be useful for early feedback etc. If so then it is preferable to name the branch accordingly. This can be done by either prefix the name with wip- as in ‘Work In Progress’, or use hierarchical names like wip/.., feature/.. or topic/... Either way is fine as long as it is clear that it is work in progress and not ready for merge. This work can temporarily have a lower standard. However, to be merged into main branch it will have to go through the regular process outlined above, with Pull Request, review etc..

Also, to facilitate both well-formed commits and working together, the wip and feature/topic identifiers also have special meaning. Any branch labelled with wip is considered “git-unstable” and may be rebased and have its history rewritten. Any branch with feature/topic in the name is considered “stable” enough for others to depend on when a group is working on a feature.

Creating Commits And Writing Commit Messages

Follow these guidelines when creating public commits and writing commit messages.

  1. If your work spans multiple local commits (for example; if you do safe point commits while working in a feature branch or work in a branch for long time doing merges/rebases etc.) then please do not commit it all but rewrite the history by squashing the commits into a single big commit which you write a good commit message for (like discussed in the following sections). For more info read this article: Git Workflow. Every commit should be able to be used in isolation, cherry picked etc.

  2. First line should be a descriptive sentence what the commit is doing, including the ticket number. It should be possible to fully understand what the commit does—but not necessarily how it does it—by just reading this single line. We follow the “imperative present tense” style for commit messages (more info here).

    It is not ok to only list the ticket number, type "minor fix" or similar. If the commit is a small fix, then you are done. If not, go to 3.

  3. Following the single line description should be a blank line followed by an enumerated list with the details of the commit.

  4. Add keywords for your commit (depending on the degree of automation we reach, the list may change over time):

    • Review by @gituser - if you want to notify someone on the team. The others can, and are encouraged to participate.

Example:

enable Travis CI #1

* Details 1
* Details 2
* Details 3

Source style

Apache Pekko uses scalafmt to enforce some of the code style rules.