Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 4.21 KB

CONTRIBUTING.md

File metadata and controls

64 lines (50 loc) · 4.21 KB

Lagom contributor guidelines

Prerequisites

Before making a contribution, it is important to make sure that the change you wish to make and the approach you wish to take will likely be accepted, otherwise you may end up doing a lot of work for nothing. If the change is only small, for example, if it's a documentation change or a simple bugfix, then it's likely to be accepted with no prior discussion. However, new features, or bigger refactorings should first be discussed on the our forums. Additionally, there are issues labels you can use to navigate issues that a good start to contribute:

Development tips

  • Use sbt launcher 1.2.x or later, which will automatically read JVM options from .jvmopts.
  • If using IntelliJ IDEA, import lagom/docs/build.sbt rather than lagom/build.sbt. This ensures that the source code and build dependencies in the docs project are also imported.

Testing maven archetype locally

If you need to change Lagom Maven Archetype and want to test it locally, you can do that by publishing it locally before trying to use it. To do that, run the following commands:

sbt publishLocal publishM2 maven-java-archetype/publishM2

After that, you can create a new project by running:

mvn archetype:generate \
  -DarchetypeGroupId=com.lightbend.lagom \
  -DarchetypeArtifactId=maven-archetype-lagom-java \
  -DarchetypeVersion=<VERSION>

Where <VERSION> is the local version published.

Pull request procedure

  1. Make sure you have signed the Lightbend CLA; if not, sign it online.
  2. Ensure that your contribution meets the following guidelines:
    1. Live up to the current code standard:
    2. Regardless of whether the code introduces new features or fixes bugs or regressions, it must have comprehensive tests. This includes when modifying existing code that isn't tested.
    3. The code must be well documented using the Play flavour of markdown with extracted code snippets (see the Play documentation guidelines.) Each API change must have the corresponding documentation change.
    4. Implementation-wise, the following things should be avoided as much as possible:
      • Global state
      • Public mutable state
      • Implicit conversions
      • ThreadLocal
      • Locks
      • Casting
      • Introducing new, heavy external dependencies
    5. The Lagom API design rules are the following:
      • Features are forever, always think about whether a new feature really belongs to the core framework or if it should be implemented as a module
      • Code must conform to standard style guidelines and pass all tests
      • Features and documentation must be provided for both Scala and Java API (unless they only make sense for one of the languages)
      • Java APIs should go to com.lightbend.lagom.javadsl.xxxxx in xxxxx-javadsl sbt project (the sbt project might be in a folder named xxxx/javadsl or similar)
      • Scala APIs should go to com.lightbend.lagom.scaladsl.xxxxx in xxxxx-scaladsl sbt project (the sbt project might be in a folder named xxxx/scaladsl or similar)
    6. Basic local validation:
      • Not use @author tags since it does not encourage Collective Code Ownership.
      • Run bin/local-pr-validation.sh to ensure all files are formatted and have the copyright header.
  3. Submit a pull request.

If the pull request does not meet the above requirements then the code should not be merged into master, or even reviewed - regardless of how good or important it is. No exceptions.