From 065e75a9ca869c561c9267b37e7bcb6e3beb9657 Mon Sep 17 00:00:00 2001 From: LaunchDarklyReleaseBot <86431345+LaunchDarklyReleaseBot@users.noreply.github.com> Date: Tue, 12 Oct 2021 19:20:44 -0400 Subject: [PATCH] prepare 6.2.5 release (#188) --- .circleci/config.yml | 11 ++++++++--- .ldrelease/build-docs.sh | 17 +++++++---------- .ldrelease/config.yml | 18 +++++++++--------- CHANGELOG.md | 4 ++-- CONTRIBUTING.md | 2 +- README.md | 6 +++--- launchdarkly-server-sdk.gemspec | 8 +++++--- lib/ldclient-rb/config.rb | 6 +++--- lib/ldclient-rb/integrations/dynamodb.rb | 2 +- lib/ldclient-rb/integrations/redis.rb | 2 +- lib/ldclient-rb/interfaces.rb | 2 +- lib/ldclient-rb/ldclient.rb | 10 +++++----- spec/event_sender_spec.rb | 6 ++++-- spec/ldclient_end_to_end_spec.rb | 8 ++++---- 14 files changed, 54 insertions(+), 48 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 90ae4c57..8ddba394 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ workflows: docker-image: cimg/ruby:3.0 - build-test-linux: name: JRuby 9.2 - docker-image: circleci/jruby:9.2-jdk + docker-image: jruby:9.2-jdk jruby: true jobs: @@ -42,12 +42,17 @@ jobs: condition: <> steps: - run: gem install jruby-openssl # required by bundler, no effect on Ruby MRI - - run: sudo apt-get update -y && sudo apt-get install -y build-essential + - run: apt-get update -y && apt-get install -y build-essential + - when: + condition: + not: <> + steps: + - run: sudo apt-get update -y && sudo apt-get install -y build-essential - run: ruby -v - run: gem install bundler -v 2.2.10 - run: bundle _2.2.10_ install - run: mkdir ./rspec - - run: bundle _2.2.10_ exec rspec --format progress --format RspecJunitFormatter -o ./rspec/rspec.xml spec + - run: bundle _2.2.10_ exec rspec --format documentation --format RspecJunitFormatter -o ./rspec/rspec.xml spec - store_test_results: path: ./rspec - store_artifacts: diff --git a/.ldrelease/build-docs.sh b/.ldrelease/build-docs.sh index 3b581297..8f41a5b6 100755 --- a/.ldrelease/build-docs.sh +++ b/.ldrelease/build-docs.sh @@ -2,17 +2,14 @@ # doc generation is not part of Releaser's standard Ruby project template -mkdir -p ./artifacts/ - cd ./docs make -cd .. +cd build/html -# Releaser will pick up docs generated in CI if we put an archive of them in the -# artifacts directory and name it docs.tar.gz or docs.zip. They will be uploaded -# to GitHub Pages and also attached as release artifacts. There's no separate -# "publish-docs" step because the external service that also hosts them doesn't -# require an upload, it just picks up gems automatically. +# Releaser will pick up generated docs if we put them in the designated +# directory. They will be uploaded to GitHub Pages and also attached as +# release artifacts. There's no separate "publish-docs" step because the +# external service that also hosts them doesn't require an upload, it just +# picks up gems automatically. -cd ./docs/build/html -tar cfz ../../../artifacts/docs.tar.gz * +cp -r * "${LD_RELEASE_DOCS_DIR}" diff --git a/.ldrelease/config.yml b/.ldrelease/config.yml index c1fcca80..7c44d0e5 100644 --- a/.ldrelease/config.yml +++ b/.ldrelease/config.yml @@ -1,8 +1,10 @@ +version: 2 + repo: public: ruby-server-sdk private: ruby-server-sdk-private -releasableBranches: +branches: - name: master - name: 5.x @@ -12,18 +14,16 @@ publications: - url: https://www.rubydoc.info/gems/launchdarkly-server-sdk description: documentation -template: - name: ruby - -circleci: - linux: - image: circleci/ruby:2.6.6-buster - context: org-global +jobs: + - docker: + image: ruby:2.5-buster + template: + name: ruby env: LD_SKIP_DATABASE_TESTS: "1" # Don't run Redis/Consul/DynamoDB tests in release; they are run in CI documentation: - githubPages: true + gitHubPages: true sdk: displayName: "Ruby" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b8d1bd7..c875e3e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -167,7 +167,7 @@ The gem name will also change. In the 5.5.6 release, it is still `ldclient-rb`; ## [5.5.0] - 2019-01-17 ### Added: -- It is now possible to use Consul or DynamoDB as a persistent feature store, similar to the existing Redis integration. See the `LaunchDarkly::Integrations::Consul` and `LaunchDarkly::Integrations::DynamoDB` modules, and the reference guide [Using a persistent feature store](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store). +- It is now possible to use Consul or DynamoDB as a persistent feature store, similar to the existing Redis integration. See the `LaunchDarkly::Integrations::Consul` and `LaunchDarkly::Integrations::DynamoDB` modules, and the reference guide [Persistent data stores](https://docs.launchdarkly.com/sdk/concepts/data-stores). - There is now a `LaunchDarkly::Integrations::Redis` module, which is the preferred method for creating a Redis feature store. - All of the database feature stores now support local caching not only for individual feature flag queries, but also for `all_flags_state`. - The `Config` property `data_source` is the new name for `update_processor` and `update_processor_factory`. @@ -249,7 +249,7 @@ Fixed a regression in version 5.0.0 that could prevent the client from reconnect ## [4.0.0] - 2018-05-10 ### Changed: -- To reduce the network bandwidth used for analytics events, feature request events are now sent as counters rather than individual events, and user details are now sent only at intervals rather than in each event. These behaviors can be modified through the LaunchDarkly UI and with the new configuration option `inline_users_in_events`. For more details, see [Analytics Data Stream Reference](https://docs.launchdarkly.com/v2.0/docs/analytics-data-stream-reference). +- To reduce the network bandwidth used for analytics events, feature request events are now sent as counters rather than individual events, and user details are now sent only at intervals rather than in each event. These behaviors can be modified through the LaunchDarkly UI and with the new configuration option `inline_users_in_events`. ### Removed: - JRuby 1.7 is no longer supported. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fb244f5c..49c6df85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ Contributing to the LaunchDarkly Server-side SDK for Ruby ================================================ -LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK. +LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/sdk/concepts/contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK. Submitting bug reports and feature requests ------------------ diff --git a/README.md b/README.md index 2f7b01c6..8125c068 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,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/docs/getting-started) using LaunchDarkly today! +[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! [![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly) @@ -22,7 +22,7 @@ This version of the LaunchDarkly SDK has a minimum Ruby version of 2.5.0, or 9.2 Getting started ----------- -Refer to the [SDK documentation](https://docs.launchdarkly.com/docs/ruby-sdk-reference#section-getting-started) for instructions on getting started with using the SDK. +Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/ruby#getting-started) for instructions on getting started with using the SDK. Learn more ----------- @@ -49,7 +49,7 @@ About LaunchDarkly * Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?). * Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file. * Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline. -* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list. +* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list. * Explore LaunchDarkly * [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information * [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides diff --git a/launchdarkly-server-sdk.gemspec b/launchdarkly-server-sdk.gemspec index 4321c874..d2be98d1 100644 --- a/launchdarkly-server-sdk.gemspec +++ b/launchdarkly-server-sdk.gemspec @@ -3,6 +3,7 @@ lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "ldclient-rb/version" +require "rake" # rubocop:disable Metrics/BlockLength Gem::Specification.new do |spec| @@ -15,9 +16,8 @@ Gem::Specification.new do |spec| spec.homepage = "https://github.com/launchdarkly/ruby-server-sdk" spec.license = "Apache-2.0" - spec.files = `git ls-files -z`.split("\x0") + spec.files = FileList["lib/**/*", "README.md", "LICENSE.txt"] spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] spec.required_ruby_version = ">= 2.5.0" @@ -36,7 +36,9 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "semantic", "~> 1.6" spec.add_runtime_dependency "concurrent-ruby", "~> 1.1" - spec.add_runtime_dependency "ld-eventsource", "2.0.1" + spec.add_runtime_dependency "ld-eventsource", "2.1.1" + # Please keep ld-eventsource dependency as an exact version so that bugfixes to + # that LD library are always associated with a new SDK version. spec.add_runtime_dependency "json", "~> 2.3" spec.add_runtime_dependency "http", ">= 4.4.0", "< 6.0.0" diff --git a/lib/ldclient-rb/config.rb b/lib/ldclient-rb/config.rb index edb21924..95cda71e 100644 --- a/lib/ldclient-rb/config.rb +++ b/lib/ldclient-rb/config.rb @@ -110,8 +110,8 @@ def stream? # Whether to use the LaunchDarkly relay proxy in daemon mode. In this mode, the client does not # use polling or streaming to get feature flag updates from the server, but instead reads them # from the {#feature_store feature store}, which is assumed to be a database that is populated by - # a LaunchDarkly relay proxy. For more information, see ["The relay proxy"](https://docs.launchdarkly.com/v2.0/docs/the-relay-proxy) - # and ["Using a persistent feature store"](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store). + # a LaunchDarkly relay proxy. For more information, see ["The relay proxy"](https://docs.launchdarkly.com/home/relay-proxy) + # and ["Using a persistent data stores"](https://docs.launchdarkly.com/sdk/concepts/data-stores). # # All other properties related to streaming or polling are ignored if this option is set to true. # @@ -189,7 +189,7 @@ def offline? # from LaunchDarkly, and uses the last stored data when evaluating flags. Defaults to # {InMemoryFeatureStore}; for other implementations, see {LaunchDarkly::Integrations}. # - # For more information, see ["Using a persistent feature store"](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store). + # For more information, see ["Persistent data stores"](https://docs.launchdarkly.com/sdk/concepts/data-stores). # # @return [LaunchDarkly::Interfaces::FeatureStore] # diff --git a/lib/ldclient-rb/integrations/dynamodb.rb b/lib/ldclient-rb/integrations/dynamodb.rb index 189e118f..c3af07d5 100644 --- a/lib/ldclient-rb/integrations/dynamodb.rb +++ b/lib/ldclient-rb/integrations/dynamodb.rb @@ -7,7 +7,7 @@ module DynamoDB # # Creates a DynamoDB-backed persistent feature store. For more details about how and why you can # use a persistent feature store, see the - # [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store). + # [SDK reference guide](https://docs.launchdarkly.com/sdk/features/storing-data#ruby). # # To use this method, you must first install one of the AWS SDK gems: either `aws-sdk-dynamodb`, or # the full `aws-sdk`. Then, put the object returned by this method into the `feature_store` property diff --git a/lib/ldclient-rb/integrations/redis.rb b/lib/ldclient-rb/integrations/redis.rb index 22bad6ef..5792d554 100644 --- a/lib/ldclient-rb/integrations/redis.rb +++ b/lib/ldclient-rb/integrations/redis.rb @@ -25,7 +25,7 @@ def self.default_prefix # # Creates a Redis-backed persistent feature store. For more details about how and why you can # use a persistent feature store, see the - # [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store). + # [SDK reference guide](https://docs.launchdarkly.com/sdk/features/storing-data#rubys). # # To use this method, you must first have the `redis` and `connection-pool` gems installed. Then, # put the object returned by this method into the `feature_store` property of your diff --git a/lib/ldclient-rb/interfaces.rb b/lib/ldclient-rb/interfaces.rb index d2a9f862..9ea0932b 100644 --- a/lib/ldclient-rb/interfaces.rb +++ b/lib/ldclient-rb/interfaces.rb @@ -9,7 +9,7 @@ module Interfaces # client uses the feature store to persist feature flags and related objects received from # the LaunchDarkly service. Implementations must support concurrent access and updates. # For more about how feature stores can be used, see: - # [Using a persistent feature store](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store). + # [Using a persistent feature store](https://docs.launchdarkly.com/sdk/features/storing-data#ruby). # # An entity that can be stored in a feature store is a hash that can be converted to and from # JSON, and that has at a minimum the following properties: `:key`, a string that is unique diff --git a/lib/ldclient-rb/ldclient.rb b/lib/ldclient-rb/ldclient.rb index d96dd1f7..ba2a7675 100644 --- a/lib/ldclient-rb/ldclient.rb +++ b/lib/ldclient-rb/ldclient.rb @@ -132,7 +132,7 @@ def toggle?(key, user, default = false) # # Creates a hash string that can be used by the JavaScript SDK to identify a user. - # For more information, see [Secure mode](https://docs.launchdarkly.com/docs/js-sdk-reference#section-secure-mode). + # For more information, see [Secure mode](https://docs.launchdarkly.com/sdk/features/secure-mode#ruby). # # @param user [Hash] the user properties # @return [String] a hash string @@ -172,11 +172,11 @@ def initialized? # # Other supported user attributes include IP address, country code, and an arbitrary hash of # custom attributes. For more about the supported user properties and how they work in - # LaunchDarkly, see [Targeting users](https://docs.launchdarkly.com/docs/targeting-users). + # LaunchDarkly, see [Targeting users](https://docs.launchdarkly.com/home/flags/targeting-users). # # The optional `:privateAttributeNames` user property allows you to specify a list of # attribute names that should not be sent back to LaunchDarkly. - # [Private attributes](https://docs.launchdarkly.com/docs/private-user-attributes) + # [Private attributes](https://docs.launchdarkly.com/home/users/attributes#creating-private-user-attributes) # can also be configured globally in {Config}. # # @example Basic user hash @@ -213,7 +213,7 @@ def variation(key, user, default) # be included in analytics events, if you are capturing detailed event data for this flag. # # For more information, see the reference guide on - # [Evaluation reasons](https://docs.launchdarkly.com/v2.0/docs/evaluation-reasons). + # [Evaluation reasons](https://docs.launchdarkly.com/sdk/concepts/evaluation-reasons). # # @param key [String] the unique feature key for the feature flag, as shown # on the LaunchDarkly dashboard @@ -260,7 +260,7 @@ def identify(user) # # As of this version’s release date, the LaunchDarkly service does not support the `metricValue` # parameter. As a result, specifying `metricValue` will not yet produce any different behavior - # from omitting it. Refer to the [SDK reference guide](https://docs.launchdarkly.com/docs/ruby-sdk-reference#section-track) + # from omitting it. Refer to the [SDK reference guide](https://docs.launchdarkly.com/sdk/features/events#ruby) # for the latest status. # # @param event_name [String] The name of the event diff --git a/spec/event_sender_spec.rb b/spec/event_sender_spec.rb index 5ad3f2f1..31bfb6ae 100644 --- a/spec/event_sender_spec.rb +++ b/spec/event_sender_spec.rb @@ -50,7 +50,9 @@ def with_sender_and_server with_server do |server| server.setup_ok_response("/bulk", "") - config = Config.new(events_uri: "http://events.com/bulk", socket_factory: SocketFactoryFromHash.new({"events.com" => server.port}), logger: $null_log) + config = Config.new(events_uri: "http://fake-event-server/bulk", + socket_factory: SocketFactoryFromHash.new({"fake-event-server" => server.port}), + logger: $null_log) es = subject.new(sdk_key, config, nil, 0.1) result = es.send_event_data(fake_data, "", false) @@ -58,7 +60,7 @@ def with_sender_and_server expect(result.success).to be true req = server.await_request expect(req.body).to eq fake_data - expect(req.host).to eq "events.com" + expect(req.host).to eq "fake-event-server" end end diff --git a/spec/ldclient_end_to_end_spec.rb b/spec/ldclient_end_to_end_spec.rb index a820b608..6366a6b7 100644 --- a/spec/ldclient_end_to_end_spec.rb +++ b/spec/ldclient_end_to_end_spec.rb @@ -128,13 +128,13 @@ module LaunchDarkly config = Config.new( stream: false, - base_uri: "http://polling.com", - events_uri: "http://events.com", + base_uri: "http://fake-polling-server", + events_uri: "http://fake-events-server", diagnostic_opt_out: true, logger: NullLogger.new, socket_factory: SocketFactoryFromHash.new({ - "polling.com" => poll_server.port, - "events.com" => events_server.port + "fake-polling-server" => poll_server.port, + "fake-events-server" => events_server.port }) ) with_client(config) do |client|