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.
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.
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.
The version of go specified by the go.mod
file.
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
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
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 withininternal/
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.
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 thev
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.