Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Ruby client for the [Unleash](https://github.com/Unleash/unleash) feature manage
- [Releasing](#releasing)
- [Contributing](#contributing)

## Migrating to v6

If you're using custom strategies or overriding built in strategies, please read the full [migration guide](./v6_MIGRATION_GUIDE.md) before upgrading to v6.

## Supported Ruby Interpreters

- MRI 3.3
Expand Down
39 changes: 39 additions & 0 deletions v6_MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Migrating to Unleash-Client-Ruby 6.0.0

The upgrade the v6.0.0 of the Unleash client should be mostly seamless. There are a few significant changes that may require some changes on the consumer side or that the consumer should be generally aware of.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The upgrade the v6.0.0 of the Unleash client should be mostly seamless. There are a few significant changes that may require some changes on the consumer side or that the consumer should be generally aware of.
The upgrade of Unleash client to v6.0.0 should be mostly seamless. But if you have extended or modified the SDK, there are a few things that may require changes on the consumer side or that the consumer should be aware of.


## Custom strategy changes

There's a few changes to custom strategies that may affect you if you make heavy use of them.

Firstly, custom strategies are no longer allowed to override the built in strategies, namely custom strategies named 'applicationHostname', 'default', 'flexibleRollout', 'gradualRolloutRandom', 'gradualRolloutSessionId', 'gradualRolloutUserId', 'remoteAddress' or 'userWithId' will now raise an error on startup, whereas previously creating a custom strategy with one of these names would raise a warning in the logs.

Secondly, the deprecated `register_custom_strategies` method has now been removed. The only way to register a custom strategy is to use configuration, i.e.

```ruby
class MyCustomStrategy
def name
'myCustomStrategy'
end

def is_enabled?(params = {}, context = nil)
true
end
end

Unleash.configure do |config|
config.strategies.add(MyCustomStrategy.new)
end
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same as our documentation on the readme. I'm thinking if adding the snippet here adds value or if we can just link to the readme. The downside of having the snippet is that people skimming through these docs may think there's a bunch o changes, but actually, we expect users to already be doing this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


If you're already using configuration to register your custom strategies and you're not overriding the default strategies, this section doesn't affect you.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be at the beginning of this section as a bold note.


## Direct access to strategy objects

The objects for base strategies are no longer directly accessible via the SDK, the `known_strategies` method will only return custom strategies registered by the user. If you need to know whether or not a custom strategy will override either a built in or custom strategy, the `includes?` method will return a false if the name is available.

Generally, it's strongly discouraged to access or alter any of the strategy properties other than the name for built in strategies. v.6.0.0 makes this a hard requirement.

## ARM requirements

v6.0.0 has a new dependency on a native binary; we currently only distribute ARM binaries for MacOS. If you need ARM support on Linux or Windows, please feel free to open an issue.
Loading