-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Bot Filtering #106
Conversation
lib/optimizely/event_builder.rb
Outdated
visitor_attributes.push(feature) | ||
end | ||
# Append Bot Filtering Attribute | ||
if bot_filtering.is_a?(TrueClass) || bot_filtering.is_a?(FalseClass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can directly check if it is true or false. No value in doing class comparison.
lib/optimizely/project_config.rb
Outdated
end | ||
return attribute['id'] | ||
end | ||
return attribute_key if has_reserved_prefix && attribute_key != Helpers::Constants::CONTROL_ATTRIBUTES['BOT_FILTERING'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. Like in other SDKs we can omit the special check for bot filtering.
spec/event_builder_spec.rb
Outdated
key: 'browser_type', | ||
type: 'custom', | ||
value: 'firefox' | ||
}, entity_id: Optimizely::Helpers::Constants::CONTROL_ATTRIBUTES['BUCKETING_ID'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styling seems incorrect. Too many spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment not addressed
spec/project_config_spec.rb
Outdated
expect(spy_logger).to have_received(:log).with(Logger::WARN, | ||
"Attribute '$opt_bot' unexpectedly has reserved prefix '$opt_'; using attribute ID instead of reserved attribute name.") | ||
end | ||
it 'should return attribute ID when provided attribute key is valid' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put a new line between each of these individual tests.
lib/optimizely/project_config.rb
Outdated
end | ||
return attribute['id'] | ||
end | ||
return attribute_key if has_reserved_prefix && attribute_key != Helpers::Constants::CONTROL_ATTRIBUTES['BOT_FILTERING'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like in other SDKs, requesting to not special case bot filtering.
@aliabbasrizvi Please review the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need fix for unit test.
spec/event_builder_spec.rb
Outdated
key: 'browser_type', | ||
type: 'custom', | ||
value: 'firefox' | ||
}, entity_id: Optimizely::Helpers::Constants::CONTROL_ATTRIBUTES['BUCKETING_ID'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment not addressed
spec/event_builder_spec.rb
Outdated
# with right params when user agent attribute is provided and | ||
# bot filtering is enabled | ||
|
||
@expected_impression_params[:visitors][0][:attributes].unshift( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not have bot filtering param listed. Please update test.
@rashidsp can you resolve conflicts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please resolve merge conflicts.
Looks good. |
No description provided.