Skip to content

Latest commit

 

History

History
74 lines (49 loc) · 3.44 KB

CONTRIBUTING.md

File metadata and controls

74 lines (49 loc) · 3.44 KB

Contributing to the LaunchDarkly Relay Proxy

The LaunchDarkly Relay Proxy's functionality is closely related to the LaunchDarkly SDKs'. We suggest that you review the LaunchDarkly SDK contributor's guide if you are working on this code.

Submitting bug reports and feature requests

The LaunchDarkly SDK team monitors the issue tracker in this repository. File bug reports and feature requests specific to the Relay Proxy in this issue tracker. The SDK team will respond to all newly filed issues within two business days.

Submitting pull requests

We encourage pull requests and other contributions from the community. Before you submit a pull request, verify that you've removed that all temporary or unintended code. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days.

Build instructions

Prerequisites

The version of go specified by the go.mod file.

Building

To build the Relay Proxy without running any tests:

make

If you wish to clean your working directory between builds, you can clean it by running:

make clean

To run the linter:

make lint

Testing

To build the Relay Proxy and run all unit tests that don't require a persistent data store:

make test

To include tests of persistent data store behavior using Redis, assuming a Redis server is running at localhost:6379:

TAGS=redis_unit_tests make test

To analyze test coverage:

make test-with-coverage

To run integration tests, such as a test of Docker deployment:

make integration-test

Coding guidelines

As this is a larger codebase than most LaunchDarkly open-source projects, we have a few guidelines to maintain internal consistency.

  • No packages outside of internal/ should export any symbols other than the ones that are necessary to support usage of the Relay Proxy as a library. Anything else that is visible becomes part of the supported external API for this project and can't be changed without a new major version, so be careful not to export any irrelevant implementation details. Anything within internal/ can safely be changed.
  • Package imports should be grouped as follows: 1. all built-in Go packages; 2. all packages that are part of this repository (github.com/launchdarkly/ld-relay/...); 3. all other LaunchDarkly packages (github.com/launchdarkly/..., gopkg.in/launchdarkly/...); 4. all third-party packages.

Runtime platform versions (Go and Alpine) for Docker

The published ld-relay Docker image embeds specific versions of the Alpine OS and the Go runtime. We update these to take advantage of patch releases for both Alpine and Go.

These versions are specified in several places. To ensure that they're updated consistently, and that the CI builds are using the same, use the following scripts:

  • ./scripts/update-go-version.sh VERSION - updates CI and Docker configuration to use the specified Go version (do not include the v prefix).
  • ./scripts/update-alpine-version.sh VERSION - updates CI and Docker configuration to use the specified Alpine version.

The script ./scripts/verify-release-versions.sh verifies that the current configurations are consistent. This is run automatically in CI, and also whenever you use the scripts above.