Skip to content

Latest commit

 

History

History
96 lines (69 loc) · 3.67 KB

CONTRIBUTING.md

File metadata and controls

96 lines (69 loc) · 3.67 KB

How to Contribute

Please follow the guidelines below before opening an issue or a PR:

  1. Ensure the issue was not already reported.
  2. Open a new issue if you are unable to find an existing issue addressing your problem. Make sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
  3. Discuss the priority and potential solutions with the maintainers in the issue. The maintainers would review the issue and add a label "Accepting Contributions" once the issue is ready for accepting contributions.
  4. Open a PR only if the issue is labeled with "Accepting Contributions", ensure the PR description clearly describes the problem and solution. Note that an open PR without an issues labeled with "Accepting Contributions" will not be accepted.

Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.

Code reviews

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.

Community Guidelines

This project follows Google's Open Source Community Guidelines.

Building the project

To build, package, and run all unit tests run the command

mvn clean verify

Running Integration tests

To include integration tests when building the project, you need access to a GCP Project with a valid service account.

For instructions on how to generate a service account and corresponding credentials JSON see: Creating a Service Account.

Then run the following to build, package, run all unit tests and run all integration tests.

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json
mvn -Penable-integration-tests clean verify

Code Samples

All code samples must be in compliance with the java sample formatting guide. Code Samples must be bundled in separate Maven modules.

The samples must be separate from the primary project for a few reasons:

  1. Primary projects have a minimum Java version of Java 8 whereas samples can have Java version of Java 11. Due to this we need the ability to selectively exclude samples from a build run.
  2. Many code samples depend on external GCP services and need credentials to access the service.
  3. Code samples are not released as Maven artifacts and must be excluded from release builds.

Building

mvn clean verify

Some samples require access to GCP services and require a service account:

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json
mvn clean verify

Code Formatting

Code in this repo is formatted with google-java-format. To run formatting on your project, you can run:

mvn com.coveo:fmt-maven-plugin:format