Skip to content

chore: migrating redis package - WIP #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/package-redis-store--bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 'Bug report for the java-server-sdk-redis-store package'
about: Create a report to help us improve
title: ''
labels: 'package: java-server-sdk-redis-store, bug'
assignees: ''
---

**Is this a support request?**
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the code in this library. If you're not sure whether the problem you are having is specifically related to this library, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing [email protected].

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.

**SDK version**
The version of this SDK that you are using.

**Language version, developer tools**
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.

**OS/platform**
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/package-redis-store--feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request for the java-server-sdk-redis-store package
about: Suggest an idea for this project
title: ''
labels: 'package: java-server-sdk-redis-store, enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
8 changes: 8 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ runs:
distribution: ${{ inputs.java_distribution }}
java-version: ${{ inputs.java_version }}

- name: Setup Redis Service
shell: bash
if: ${{ inputs.workspace_path == 'lib/java-server-sdk-redis-store' }}
run: |
sudo apt-get update -y
sudo apt-get install redis-server -y
sudo service redis-server start

- name: Restore dependencies
shell: bash
id: restore
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/java-server-sdk-redis-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: java-server-sdk-redis-store

on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'

jobs:
build-test-java-server-sdk-redis-store:
strategy:
matrix:
jedis-version: [2.9.0, 3.0.0]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Edit build.gradle to change Jedis version
shell: bash
run: |
cd lib/java-server-sdk-redis-store
sed -i.bak 's#"jedis":.*"[0-9.]*"#"jedis":"${{ matrix.jedis-version }}"#' build.gradle

- name: Shared CI Steps
uses: ./.github/actions/ci
with:
workspace_path: 'lib/java-server-sdk-redis-store'
java_version: 8

build-test-java-server-sdk-windows:
strategy:
matrix:
jedis-version: [2.9.0, 3.0.0]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- run: |
$ProgressPreference = "SilentlyContinue"
iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip
mkdir redis
Expand-Archive -Path redis.zip -DestinationPath redis
cd redis
.\redis-server --service-install
.\redis-server --service-start
Start-Sleep -s 5
.\redis-cli ping

- name: Edit build.gradle to change Jedis version
shell: bash
run: |
cd lib/java-server-sdk-redis-store
sed -i.bak 's#"jedis":.*"[0-9.]*"#"jedis":"${{ matrix.jedis-version }}"#' build.gradle

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8

- name: Restore dependencies
shell: bash
id: restore
run: lib/java-server-sdk-redis-store/gradlew dependencies -p lib/java-server-sdk-redis-store

- name: Build
shell: bash
id: build
run: lib/java-server-sdk-redis-store/gradlew build -p lib/java-server-sdk-redis-store

- name: Build Jar
shell: bash
id: buildjar
run: lib/java-server-sdk-redis-store/gradlew jar -p lib/java-server-sdk-redis-store

- name: Run Tests
if: steps.build.outcome == 'success' && inputs.run_tests == 'true'
shell: bash
run: lib/java-server-sdk-redis-store/gradlew test -p lib/java-server-sdk-redis-store

- name: Build Documentation
shell: bash
run: lib/java-server-sdk-redis-store/gradlew javadoc -p lib/java-server-sdk-redis-store
3 changes: 2 additions & 1 deletion .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ on:
required: true
type: choice
options:
- lib/java-server-sdk-otel
- lib/shared/common
- lib/shared/internal
- lib/sdk/server
- lib/java-server-sdk-otel
- lib/java-server-sdk-redis-store
dry_run:
description: 'Is this a dry run. If so no docs will be published.'
type: boolean
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ on:
required: true
type: choice
options:
- lib/java-server-sdk-otel
- lib/shared/common
- lib/shared/internal
- lib/sdk/server
- lib/java-server-sdk-otel
- lib/java-server-sdk-redis-store
prerelease:
description: 'Is this a prerelease.'
type: boolean
Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
runs-on: ubuntu-latest

outputs:
package-server-sdk-otel-released: ${{ steps.release.outputs['lib/java-server-sdk-otel--release_created'] }}
package-sdk-common-released: ${{ steps.release.outputs['lib/java-sdk-common--release_created'] }}
package-sdk-internal-released: ${{ steps.release.outputs['lib/java-sdk-internal--release_created'] }}
package-server-sdk-released: ${{ steps.release.outputs['lib/java-server-sdk--release_created'] }}
package-server-sdk-otel-released: ${{ steps.release.outputs['lib/java-server-sdk-otel--release_created'] }}
package-server-sdk-redis-store-released: ${{ steps.release.outputs['lib/java-server-sdk-redis-store--release_created'] }}

steps:
- uses: google-github-actions/release-please-action@v4
Expand Down Expand Up @@ -86,6 +87,38 @@ jobs:
aws_role: ${{ vars.AWS_ROLE_ARN }}
token: ${{ secrets.GITHUB_TOKEN }}

release-server-sdk-redis-store:
runs-on: ubuntu-latest
needs: release-please
permissions:
id-token: write
contents: write
pull-requests: write
if: ${{ needs.release-please.outputs.package-server-sdk-redis-store-released == 'true'}}
steps:
- uses: actions/checkout@v4

- uses: launchdarkly/gh-actions/actions/[email protected]
name: Get secrets
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/sonatype/username = SONATYPE_USER_NAME,
/production/common/releasing/sonatype/password = SONATYPE_PASSWORD'
s3_path_pairs: 'launchdarkly-releaser/java/code-signing-keyring.gpg = code-signing-keyring.gpg'

- uses: ./.github/actions/full-release
with:
workspace_path: lib/java-server-sdk-redis-store
dry_run: false
prerelease: false
code_signing_keyring: 'code-signing-keyring.gpg'
signing_key_id: ${{ env.SIGNING_KEY_ID }}
signing_key_passphrase: ${{ env.SIGNING_KEY_PASSPHRASE }}
sonatype_username: ${{ env.SONATYPE_USER_NAME }}
sonatype_password: ${{ env.SONATYPE_PASSWORD }}
aws_role: ${{ vars.AWS_ROLE_ARN }}
token: ${{ secrets.GITHUB_TOKEN }}

release-sdk-internal:
runs-on: ubuntu-latest
needs: release-please
Expand Down
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"lib/java-server-sdk-otel": "0.1.0",
"lib/java-server-sdk-redis-store": "3.0.0",
"lib/shared/common": "2.1.1",
"lib/shared/internal": "1.3.0",
"lib/sdk/server": "7.7.0"
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ This includes shared libraries, used by SDKs and other tools, as well as SDKs.
| [@launchdarkly/java-sdk-internal](lib/shared/internal/README.md) | [![Documentation][sdk-internal-docs-badge]][sdk-internal-docs-link] | [![maven][sdk-internal-maven-badge]][sdk-internal-maven-link] | [Issues][sdk-internal-issues] | [![Actions Status][sdk-internal-ci-badge]][sdk-internal-ci-link] |
| [@launchdarkly/java-sdk-common](lib/shared/common/README.md) | [![Documentation][sdk-common-docs-badge]][sdk-common-docs-link] | [![maven][sdk-common-maven-badge]][sdk-common-maven-link] | [Issues][sdk-common-issues] | [![Actions Status][sdk-common-ci-badge]][sdk-common-ci-link] |

| Telemetry Packages | API Docs | maven | issues | tests |
| Other Packages | API Docs | maven | issues | tests |
| ---------------------------------------------------------------------------- |--------------------------------------------------------------| ---------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------- |
| [@launchdarkly/java-server-sdk-otel](lib/java-server-sdk-otel/README.md) | [![Documentation][server-otel-docs-badge]][server-otel-docs-link] | [![maven][server-otel-maven-badge]][server-otel-maven-link] | [Issues][server-otel-issues] | [![Actions Status][server-otel-ci-badge]][server-otel-ci-link] |
| [@launchdarkly/java-server-sdk-redis-store](lib/java-server-sdk-redis-store/README.md) | [![Documentation][server-redis-docs-badge]][server-redis-docs-link] | [![maven][server-redis-maven-badge]][server-redis-maven-link] | [Issues][server-redis-issues] | [![Actions Status][server-redis-ci-badge]][server-redis-ci-link] |

## Organization

Expand Down Expand Up @@ -71,6 +72,15 @@ We encourage pull requests and other contributions from the community. Check out
[server-otel-docs-badge]: https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8
[server-otel-docs-link]: https://launchdarkly.github.io/java-core/lib/java-server-sdk-otel/

[//]: # 'java-server-sdk-redis-store'
[server-redis-issues]: https://github.com/launchdarkly/java-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+java-server-sdk-redis-store%22+
[server-redis-maven-badge]: https://img.shields.io/maven-central/v/com.launchdarkly/launchdarkly-java-server-sdk-redis-store
[server-redis-maven-link]: https://central.sonatype.com/artifact/com.launchdarkly/launchdarkly-java-server-sdk-redis-store
[server-redis-ci-badge]: https://github.com/launchdarkly/java-core/actions/workflows/java-server-sdk-redis-store.yml/badge.svg
[server-redis-ci-link]: https://github.com/launchdarkly/java-core/actions/workflows/java-server-sdk-redis-store.yml
[server-redis-docs-badge]: https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8
[server-redis-docs-link]: https://launchdarkly.github.io/java-core/lib/java-server-sdk-redis-store/

[//]: # 'java-sdk-internal'
[sdk-internal-issues]: https://github.com/launchdarkly/java-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+java-sdk-internal%22+
[sdk-internal-maven-badge]: https://img.shields.io/maven-central/v/com.launchdarkly/launchdarkly-java-sdk-internal
Expand Down
33 changes: 33 additions & 0 deletions lib/java-server-sdk-redis-store/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Change log

All notable changes to the LaunchDarkly Java SDK Redis integration will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [3.0.0] - 2022-12-07
This release corresponds to the 6.0.0 release of the LaunchDarkly Java SDK. Any application code that is being updated to use the 6.0.0 SDK, and was using a 2.x version of `launchdarkly-java-server-sdk-redis-store`, should now use a 3.x version instead.

There are no functional differences in the behavior of the Redis integration; the differences are only related to changes in the usage of interface types for configuration in the SDK.

### Added:
- `Redis.bigSegmentStore()`, which creates a configuration builder for use with Big Segments. Previously, the `Redis.dataStore()` builder was used for both regular data stores and Big Segment stores.

### Changed:
- The type `RedisDataStoreBuilder` has been removed, replaced by a generic type `RedisStoreBuilder`. Application code would not normally need to reference these types by name, but if necessary, use either `RedisStoreBuilder<PersistentDataStore>` or `RedisStoreBuilder<BigSegmentStore>` depending on whether you are configuring a regular data store or a Big Segment store.

## [2.0.0] - 2022-07-29
This release updates the package to use the new logging mechanism that was introduced in version 5.10.0 of the LaunchDarkly Java SDK, so that log output from the Redis integration is handled in whatever way was specified by the SDK's logging configuration.

This version of the package will not work with SDK versions earlier than 5.10.0; that is the only reason for the 2.0.0 major version increment. The functionality of the package is otherwise unchanged, and there are no API changes.

## [1.1.0] - 2022-01-28
### Added:
- Added support for Big Segments. An Early Access Program for creating and syncing Big Segments from customer data platforms is available to enterprise customers.

## [1.0.1] - 2021-08-06
### Fixed:
- This integration now works with Jedis 3.x as well as Jedis 2.9.x. The default dependency is still 2.9.x, but an application can override this with a dependency on a 3.x version. (Thanks, [robotmlg](https://github.com/launchdarkly/java-server-sdk-redis/pull/3)!)

## [1.0.0] - 2020-06-02
Initial release, corresponding to the 5.0.0 release of [`launchdarkly-java-server-sdk`](https://github.com/launchdarkly/java-server-sdk).

Prior to that release, the Redis integration was built into the main SDK library. For more information about changes in the SDK database integrations, see the [4.x to 5.0 migration guide](https://docs-stg.launchdarkly.com/252/sdk/server-side/java/migration-4-to-5/).

Loading
Loading