Skip to content

Commit f91c51c

Browse files
committed
Release 1.0.0-beta.2
1 parent 4063d2d commit f91c51c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+842
-98
lines changed

.circleci/config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,41 @@ jobs:
3838
path: target/doc
3939
destination: doc
4040

41+
- run:
42+
name: make test output directory
43+
command: mkdir /tmp/test-results
44+
- run: make build-contract-tests
45+
- run:
46+
command: make start-contract-test-service
47+
background: true
48+
- run:
49+
name: run contract tests
50+
command: TEST_HARNESS_PARAMS="-junit /tmp/test-results/contract-tests-junit.xml" make run-contract-tests
51+
52+
- store_test_results:
53+
path: /tmp/test-results/
54+
55+
build-with-musl:
56+
docker:
57+
- image: cimg/rust:1.56.1
58+
resource_class: medium+
59+
steps:
60+
- checkout
61+
62+
- run:
63+
name: Install musl tools
64+
command: |
65+
sudo apt-get update && sudo apt-get install -y musl-tools
66+
rustup target add x86_64-unknown-linux-musl
67+
68+
- run:
69+
name: Build
70+
command: |
71+
TARGET_CC=musl-gcc RUSTFLAGS="-C linker=musl-gcc" cargo build --release --target=x86_64-unknown-linux-musl
72+
4173
workflows:
4274
version: 2
4375
build:
4476
jobs:
4577
- build
78+
- build-with-musl

.ldrelease/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -ue
4+
5+
cd launchdarkly-server-sdk
6+
cargo package

.ldrelease/publish-dry-run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -ue
4+
5+
echo "DRY RUN: not publishing to crates.io, only copying crate"
6+
cp ./target/package/*.crate "${LD_RELEASE_ARTIFACTS_DIR}"

.ldrelease/publish.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
set -ue
4+
5+
export CARGO_REGISTRY_TOKEN="$(cat "${LD_RELEASE_SECRETS_DIR}/rust_cratesio_api_token")"
6+
7+
cd launchdarkly-server-sdk
8+
cargo publish

.ldrelease/update-version.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -ue
4+
5+
sed -i "/^version\b/c version = \"${LD_RELEASE_VERSION}\"" ./launchdarkly-server-sdk/Cargo.toml

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,18 @@
22

33
All notable changes to the LaunchDarkly Rust server-side SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
6+
## [1.0.0-beta.2] - 2022-02-02
7+
### Added
8+
- Initial support for contract test harness.
9+
- Ensure we can build using musl build tools.
10+
11+
### Changed
12+
- Drop OpenSSL dependency in favor of rustls.
13+
14+
### Fixed
15+
- Creation date is now included in alias events.
16+
- Emit index events for feature events correctly.
17+
518
## [1.0.0-beta.1] - 2022-01-21
619
Initial beta release of the LaunchDarkly Server-Side SDK for Rust.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ This SDK uses the standard `cargo` build system.
1919
To build the SDK without running any tests:
2020

2121
```sh
22-
cargo build
22+
cargo build -p launchdarkly-server-sdk
2323
```
2424

2525
To check and report errors without compiling object files, run:
2626

2727
```sh
28-
cargo check
28+
cargo check -p launchdarkly-server-sdk
2929
```
3030

3131
### Testing
@@ -39,5 +39,5 @@ cargo test
3939
If you want to only run the much faster unit tests, run:
4040

4141
```sh
42-
cargo test --lib
42+
cargo test -p launchdarkly-server-sdk --lib
4343
```

Cargo.toml

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,6 @@
1-
[package]
2-
name = "launchdarkly-server-sdk"
3-
description = "LaunchDarkly Server-Side SDK"
4-
version = "1.0.0-beta.1"
5-
authors = ["LaunchDarkly"]
6-
edition = "2018"
7-
license = "Apache-2.0"
8-
homepage = "https://docs.launchdarkly.com/sdk/server-side/rust"
9-
repository = "https://github.com/launchdarkly/rust-server-sdk-evaluation"
10-
keywords = ["launchdarkly", "launchdarkly-sdk", "feature-flags", "feature-toggles"]
11-
exclude = [
12-
".circleci",
13-
".github",
14-
".ldrelease",
15-
".pre-commit-config.yaml",
16-
"coverage.sh"
17-
]
18-
19-
[dependencies]
20-
chrono = "0.4.19"
21-
crossbeam-channel = "0.5.1"
22-
data-encoding = "2.3.2"
23-
eventsource-client = "0.8.1"
24-
futures = "0.3.12"
25-
lazy_static = "1.4.0"
26-
log = "0.4.14"
27-
lru = { version = "0.5.3", default_features = false }
28-
reqwest = "0.9.11"
29-
ring = "0.16.20"
30-
launchdarkly-server-sdk-evaluation = { version = "1.0.0-beta.2" }
31-
serde = { version = "1.0.132", features = ["derive"] }
32-
serde_json = { version = "1.0.73", features = ["float_roundtrip"] }
33-
thiserror = "1.0"
34-
tokio = { version = "1.2.0", features = ["rt-multi-thread"] }
35-
threadpool = "1.8.1"
36-
parking_lot = "0.11.2"
37-
tokio-stream = { version = "0.1.8", features = ["sync"] }
1+
[workspace]
382

39-
[dev-dependencies]
40-
maplit = "1.0.1"
41-
env_logger = "0.7.1"
42-
serde_json = { version = "1.0.73", features = ["preserve_order"] } # for deterministic JSON testing
43-
spectral = "0.6.0"
44-
cursive = "0.11"
45-
tokio = { version = "1.2.0", features = ["macros", "time"] }
46-
test-case = "1.2.0"
47-
mockito = "0.30.0"
48-
49-
[build-dependencies]
50-
built = "0.4"
3+
members = [
4+
"contract-tests",
5+
"launchdarkly-server-sdk"
6+
]

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
TEMP_TEST_OUTPUT=/tmp/contract-test-service.log
2+
UNSUPPORTED_TESTS = -skip 'streaming/retry behavior' -skip 'streaming/validation/drop and reconnect if stream event has well-formed JSON not matching schema' -skip 'streaming/validation/drop and reconnect if stream event has malformed JSON' -skip 'evaluation/all flags state/client not ready' -skip 'evaluation/client not ready' -skip 'events/user properties/.*allAttributesPrivate=true.*/' -skip 'events/user properties/.*user-private.*/' -skip 'events/user properties/.*globally-private.*/' -skip 'evaluation/parameterized/evaluation failures.*/' -skip 'evaluation/parameterized/rule match.*/' -skip 'evaluation/all flags state/error in flag/' -skip 'events/feature events/full feature event for failed tracked flag/' -skip 'events/feature events/full feature event for tracked flag.*/' -skip 'events/feature events/only index.*for untracked flag/' -skip 'data store/updates from stream' -skip 'evaluation/all flags state/compact representations'
3+
4+
build-contract-tests:
5+
@cargo build -p contract-tests --release
6+
7+
start-contract-test-service:
8+
@./target/release/contract-tests
9+
10+
start-contract-test-service-bg:
11+
@echo "Test service output will be captured in $(TEMP_TEST_OUTPUT)"
12+
@make start-contract-test-service >$(TEMP_TEST_OUTPUT) 2>&1 &
13+
14+
run-contract-tests:
15+
@curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/master/downloader/run.sh \
16+
| VERSION=v1 PARAMS="-url http://localhost:8000 -debug -stop-service-at-end $(TEST_HARNESS_PARAMS) $(UNSUPPORTED_TESTS)" sh
17+
18+
contract-tests: build-contract-tests start-contract-test-service-bg run-contract-tests
19+
20+
.PHONY: build-contract-tests start-contract-test-service run-contract-tests contract-tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LaunchDarkly Server-Side SDK for Rust
22

3-
[![CircleCI](https://circleci.com/gh/launchdarkly/rust-server-sdk.svg?style=svg)](https://circleci.com/gh/launchdarkly/rust-server-sdk)
3+
[![CircleCI](https://circleci.com/gh/launchdarkly/rust-server-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/launchdarkly/rust-server-sdk/tree/master)
44

55
The LaunchDarkly Server-Side SDK for Rust is designed primarily for use in multi-user systems such as web servers and applications. It follows the server-side LaunchDarkly model for multi-user contexts. It is not intended for use in desktop and embedded systems applications.
66

0 commit comments

Comments
 (0)