Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Run CI
on:
push:
branches: [ main ]
branches: [ main, 'feat/**' ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ main ]
branches: [ main, 'feat/**' ]
paths-ignore:
- '**.md'

Expand Down
2 changes: 1 addition & 1 deletion contract-tests/client_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def initialize(log, config)

if config[:hooks]
opts[:hooks] = config[:hooks][:hooks].map do |hook|
Hook.new(hook[:name], hook[:callbackUri], hook[:data] || {})
Hook.new(hook[:name], hook[:callbackUri], hook[:data] || {}, hook[:errors] || {})
end
end

Expand Down
8 changes: 7 additions & 1 deletion contract-tests/hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ class Hook
# @param name [String]
# @param callback_uri [String]
# @param data [Hash]
# @parm errors [Hash]
#
def initialize(name, callback_uri, data)
def initialize(name, callback_uri, data, errors)
@metadata = LaunchDarkly::Interfaces::Hooks::Metadata.new(name)
@callback_uri = callback_uri
@data = data
@errors = errors
@context_filter = LaunchDarkly::Impl::ContextFilter.new(false, [])
end

Expand All @@ -24,6 +26,8 @@ def metadata
# @param data [Hash]
#
def before_evaluation(evaluation_series_context, data)
raise @errors[:beforeEvaluation] if @errors.include? :beforeEvaluation

payload = {
evaluationSeriesContext: {
flagKey: evaluation_series_context.key,
Expand All @@ -46,6 +50,8 @@ def before_evaluation(evaluation_series_context, data)
# @param detail [LaunchDarkly::EvaluationDetail]
#
def after_evaluation(evaluation_series_context, data, detail)
raise @errors[:afterEvaluation] if @errors.include? :afterEvaluation

payload = {
evaluationSeriesContext: {
flagKey: evaluation_series_context.key,
Expand Down