Skip to content

Latest commit

 

History

History
103 lines (79 loc) · 6.35 KB

CONTRIBUTING.md

File metadata and controls

103 lines (79 loc) · 6.35 KB

Contributing

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow 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 issue labeled with "Accepting Contributions" will not be accepted.

Repository Structure

  • google-cloud-java (/pom.xml)
    • The root aggregator POM that lists all of the modules.
    • Does not get released.
  • google-cloud-pom-parent
    • Serves as the parent POM for the gapic-libraries-bom and module mini BOMs.
    • Should not have any dependency management so as not to impact the BOMs.
  • google-cloud-jar-parent
    • The root POM for all modules.
    • The only POM where non-annotated versions should be managed using dependencyManagement.
    • Contains common configuration for jar projects.
  • generation
    • A collection of scripts that are used to make updates across modules.
  • gapic-libraries-bom
    • A BOM for all non-preview libraries in the monorepo.
  • java-*
    • Individual client libraries.

Using maven for build/test

To run the tests, you must have application default credentials in a JSON file on your development machine. Generate a JSON service account key in the cloud console and download they key to a secure location on your development box. Then set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the location of the JSON file. For example:

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/key.json

After you clone the repository, use Maven for building and running the tests.

Integration tests run tests against real services and take a long time to run. Consider mvn install -DskipITs to skip them when installing. Maven 3.0+ is required.

It's also important to test that changes don't break compatibility with App/Compute Engine and when running elsewhere. To run tests on different platforms, try deploying the apps available on the google-cloud-examples repository. End-to-end tests should ensure that google-cloud-java works when running on the

When changes are made to authentication and project ID-related code, authentication and project ID inference should be tested using all relevant methods detailed in the authentication docs and project ID docs.

Known issue: If you have installed the Google Cloud SDK, be sure to log in (using gcloud auth login) before running tests. Though the Datastore tests use a local Datastore emulator that doesn't require authentication, they will not run if you have the Google Cloud SDK installed but aren't authenticated.

Please, do not use your production projects for executing integration tests. While we do our best to make our tests independent of your project's state and content, they do perform create, modify and deletes, and you do not want to have your production data accidentally modified.

Adding Features

In order to add a feature to google-cloud-java:

The feature must be fully documented using Javadoc and examples should be provided. The feature must work fully on Java 7 and above. The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should be discussed).

Adding Support for a New Service

See SUPPORTING_NEW_SERVICES for guidelines on how to add support for a new Google Cloud service to google-cloud-java.

Coding Style

Maintain the coding style in the project and in particular the modified files. Follow the Google Java style.

In pull requests, please run mvn com.coveo:fmt-maven-plugin:format to format your code diff.

Contributor License Agreements

Before we can accept your pull requests you'll need to sign a Contributor License Agreement (CLA):

  • If you are an individual writing original source code and you own the intellectual property, then you'll need to sign an individual CLA.
  • If you work for a company that wants to allow you to contribute your work, then you'll need to sign a corporate CLA.

You can sign these electronically (just scroll to the bottom). After that, we'll be able to accept your pull requests.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Code of Conduct for more information.