Skip to content

Commit

Permalink
prepare 7.3.0 release (#225)
Browse files Browse the repository at this point in the history
## [7.3.0] - 2023-10-16
### Fixed:
- The documentation for the `default_connect_timeout` setting stated it
defaulted to 10 seconds when the code actually defaults to 2. (Thanks,
[zmagg-figma](#223)!)

### Deprecated:
- Creating an `LDContext` using the legacy user format has been
deprecated and will be removed in the next major release. To learn more,
read the [Contexts
documentation](https://docs.launchdarkly.com/guides/flags/intro-contexts).

---------

Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Jacob Smith <jacob@jacobsmith.io>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: hroederld <hroeder@launchdarkly.com>
Co-authored-by: Kerrie Martinez <kyee@launchdarkly.com>
Co-authored-by: pellyg-ld <gpelly@launchdarkly.com>
Co-authored-by: Sam Stokes <sstokes@launchdarkly.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Louis Chan <91093020+louis-launchdarkly@users.noreply.github.com>
Co-authored-by: Matthew M. Keeler <keelerm84@gmail.com>
Co-authored-by: Ben Levy <benjaminlevy007@gmail.com>
Co-authored-by: Ben Levy <ben@foxhound.systems>
Co-authored-by: Matthew M. Keeler <mkeeler@launchdarkly.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: Matt Hooks <46452201+matt-dutchie@users.noreply.github.com>
  • Loading branch information
21 people committed Oct 16, 2023
1 parent 13e8359 commit 6b375ae
Show file tree
Hide file tree
Showing 52 changed files with 2,795 additions and 2,746 deletions.
17 changes: 15 additions & 2 deletions .circleci/config.yml
Expand Up @@ -21,10 +21,14 @@ workflows:
- build-test-linux:
name: Ruby 3.1
docker-image: cimg/ruby:3.1
- build-test-linux:
name: Ruby 3.2
docker-image: cimg/ruby:3.2
- build-test-linux:
name: JRuby 9.4
docker-image: jruby:9.4-jdk
jruby: true
spec-tags: -t '~flaky'

jobs:
build-test-windows:
Expand All @@ -37,6 +41,12 @@ jobs:
steps:
- checkout

# No idea what this is. But the win orb starts it up on port 8000 which
# conflicts with DynamoDB. So we will stop it.
- run:
name: "Shutdown IBXDashboard"
command: Stop-Service IBXDashboard

- run:
name: "Setup DynamoDB"
command: |
Expand Down Expand Up @@ -97,10 +107,13 @@ jobs:
jruby:
type: boolean
default: false
spec-tags:
type: string
default: ""

docker:
- image: <<parameters.docker-image>>
- image: consul
- image: hashicorp/consul
- image: redis
- image: amazon/dynamodb-local

Expand All @@ -124,7 +137,7 @@ jobs:
- run: gem install bundler -v 2.2.33
- run: bundle _2.2.33_ install
- run: mkdir /tmp/circle-artifacts
- run: bundle _2.2.33_ exec rspec --format documentation --format RspecJunitFormatter -o /tmp/circle-artifacts/rspec.xml spec
- run: bundle _2.2.33_ exec rspec --format documentation --format RspecJunitFormatter -o /tmp/circle-artifacts/rspec.xml spec <<parameters.spec-tags>>
- run: mv coverage /tmp/circle-artifacts/

- when:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -170,7 +170,7 @@ Style/FormatString:
Style/GlobalVars:
Description: 'Do not introduce global variables.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
Reference: 'https://www.zenspider.com/ruby/quickref.html'
Enabled: false

Style/GuardClause:
Expand Down
3 changes: 2 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
@@ -1 +1,2 @@

# Repository Maintainers
* @launchdarkly/team-sdk-ruby
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -9,7 +9,7 @@ LaunchDarkly Server-side SDK for Ruby

LaunchDarkly overview
-------------------------
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

Expand All @@ -26,7 +26,7 @@ Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/r
Learn more
-----------

Check out our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [reference guide for this SDK](http://docs.launchdarkly.com/docs/ruby-sdk-reference).
Read our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [reference guide for this SDK](http://docs.launchdarkly.com/docs/ruby-sdk-reference).

Generated API documentation for all versions of the SDK is on [RubyDoc.info](https://www.rubydoc.info/gems/launchdarkly-server-sdk). The API documentation for the latest version is also on [GitHub Pages](https://launchdarkly.github.io/ruby-server-sdk).

Expand Down
4 changes: 4 additions & 0 deletions lib/ldclient-rb/context.rb
Expand Up @@ -317,6 +317,8 @@ def self.with_key(key, kind = KIND_DEFAULT)
# {https://docs.launchdarkly.com/sdk/features/user-config SDK
# documentation}.
#
# @deprecated The old user format will be removed in 8.0.0. Please use the new context specific format.
#
# @param data [Hash]
# @return [LDContext]
#
Expand Down Expand Up @@ -397,6 +399,8 @@ def self.create_multi(contexts)
# @return [LDContext]
#
private_class_method def self.create_legacy_context(data)
warn("DEPRECATED: legacy user format will be removed in 8.0.0", uplevel: 1)

key = data[:key]

# Legacy users are allowed to have "" as a key but they cannot have nil as a key.
Expand Down
6 changes: 3 additions & 3 deletions lib/ldclient-rb/impl/context.rb
Expand Up @@ -40,7 +40,7 @@ def self.validate_kind(kind)
return ERR_KIND_NON_STRING unless kind.is_a?(String)
return ERR_KIND_CANNOT_BE_KIND if kind == "kind"
return ERR_KIND_CANNOT_BE_MULTI if kind == "multi"
return ERR_KIND_INVALID_CHARS unless kind.match?(/^[\w.-]+$/)
ERR_KIND_INVALID_CHARS unless kind.match?(/^[\w.-]+$/)
end

#
Expand All @@ -51,7 +51,7 @@ def self.validate_kind(kind)
#
def self.validate_key(key)
return ERR_KEY_NON_STRING unless key.is_a?(String)
return ERR_KEY_EMPTY if key == ""
ERR_KEY_EMPTY if key == ""
end

#
Expand All @@ -61,7 +61,7 @@ def self.validate_key(key)
# @return [String, nil]
#
def self.validate_name(name)
return ERR_NAME_NON_STRING unless name.nil? || name.is_a?(String)
ERR_NAME_NON_STRING unless name.nil? || name.is_a?(String)
end

#
Expand Down
1 change: 1 addition & 0 deletions lib/ldclient-rb/impl/event_sender.rb
Expand Up @@ -64,6 +64,7 @@ def send_event_data(event_data, description, is_diagnostic)
begin
res_time = Time.httpdate(response.headers["date"])
rescue ArgumentError
# Ignored
end
end
return EventSenderResult.new(true, false, res_time)
Expand Down
1 change: 1 addition & 0 deletions lib/ldclient-rb/impl/integrations/file_data_source.rb
Expand Up @@ -18,6 +18,7 @@ class FileDataSourceImpl
require 'listen'
@@have_listen = true
rescue LoadError
# Ignored
end

#
Expand Down
3 changes: 2 additions & 1 deletion lib/ldclient-rb/impl/integrations/redis_impl.rb
@@ -1,3 +1,4 @@
require "ldclient-rb/interfaces"
require "concurrent/atomics"
require "json"

Expand Down Expand Up @@ -117,7 +118,7 @@ def initialize(opts)
@logger = opts[:logger] || Config.default_logger
@test_hook = opts[:test_hook] # used for unit tests, deliberately undocumented

@stopped = Concurrent::AtomicBoolean.new()
@stopped = Concurrent::AtomicBoolean.new

with_connection do |redis|
@logger.info("#{description}: using Redis instance at #{redis.connection[:host]}:#{redis.connection[:port]} and prefix: #{@prefix}")
Expand Down
6 changes: 3 additions & 3 deletions lib/ldclient-rb/integrations/test_data.rb
Expand Up @@ -90,7 +90,7 @@ def call(_, config)
#
def flag(key)
existing_builder = @lock.with_read_lock { @flag_builders[key] }
if existing_builder.nil? then
if existing_builder.nil?
FlagBuilder.new(key).boolean_flag
else
existing_builder.clone
Expand Down Expand Up @@ -118,7 +118,7 @@ def update(flag_builder)
@flag_builders[flag_builder.key] = flag_builder
version = 0
flag_key = flag_builder.key.to_sym
if @current_flags[flag_key] then
if @current_flags[flag_key]
version = @current_flags[flag_key][:version]
end
new_flag = Impl::Model.deserialize(FEATURES, flag_builder.build(version+1))
Expand Down Expand Up @@ -175,7 +175,7 @@ def use_preconfigured_segment(segment)
key = item.key.to_sym
@lock.with_write_lock do
old_item = current[key]
unless old_item.nil? then
unless old_item.nil?
data = item.as_json
data[:version] = old_item.version + 1
item = Impl::Model.deserialize(kind, data)
Expand Down
6 changes: 3 additions & 3 deletions spec/big_segment_store_spec_base.rb
Expand Up @@ -82,7 +82,7 @@ def with_empty_store

it "includes only" do
with_empty_store do |store|
store_tester.set_big_segments(fake_context_hash, ["key1", "key2"], [])
store_tester.set_big_segments(fake_context_hash, %w[key1 key2], [])

membership = store.get_membership(fake_context_hash)
expect(membership).to eq({ "key1" => true, "key2" => true })
Expand All @@ -91,7 +91,7 @@ def with_empty_store

it "excludes only" do
with_empty_store do |store|
store_tester.set_big_segments(fake_context_hash, [], ["key1", "key2"])
store_tester.set_big_segments(fake_context_hash, [], %w[key1 key2])

membership = store.get_membership(fake_context_hash)
expect(membership).to eq({ "key1" => false, "key2" => false })
Expand All @@ -100,7 +100,7 @@ def with_empty_store

it "includes and excludes" do
with_empty_store do |store|
store_tester.set_big_segments(fake_context_hash, ["key1", "key2"], ["key2", "key3"])
store_tester.set_big_segments(fake_context_hash, %w[key1 key2], %w[key2 key3])

membership = store.get_membership(fake_context_hash)
expect(membership).to eq({ "key1" => true, "key2" => true, "key3" => false }) # include of key2 overrides exclude
Expand Down

0 comments on commit 6b375ae

Please sign in to comment.