Skip to content
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

Merged
merged 8 commits into from
Jun 28, 2018
Merged

Introduce Bot Filtering #106

merged 8 commits into from
Jun 28, 2018

Conversation

rashidsp
Copy link
Contributor

@rashidsp rashidsp commented Jun 6, 2018

No description provided.

@coveralls
Copy link

coveralls commented Jun 6, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling d4795b2 on rashid/bot_filtering into 3f201e3 on master.

visitor_attributes.push(feature)
end
# Append Bot Filtering Attribute
if bot_filtering.is_a?(TrueClass) || bot_filtering.is_a?(FalseClass)
Copy link
Contributor

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.

end
return attribute['id']
end
return attribute_key if has_reserved_prefix && attribute_key != Helpers::Constants::CONTROL_ATTRIBUTES['BOT_FILTERING']
Copy link
Contributor

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.

key: 'browser_type',
type: 'custom',
value: 'firefox'
}, entity_id: Optimizely::Helpers::Constants::CONTROL_ATTRIBUTES['BUCKETING_ID'],
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Comment not addressed

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
Copy link
Contributor

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.

end
return attribute['id']
end
return attribute_key if has_reserved_prefix && attribute_key != Helpers::Constants::CONTROL_ATTRIBUTES['BOT_FILTERING']
Copy link
Contributor

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.

@rashidsp
Copy link
Contributor Author

rashidsp commented Jun 13, 2018

@aliabbasrizvi Please review the changes.

Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a 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.

key: 'browser_type',
type: 'custom',
value: 'firefox'
}, entity_id: Optimizely::Helpers::Constants::CONTROL_ATTRIBUTES['BUCKETING_ID'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment not addressed

# with right params when user agent attribute is provided and
# bot filtering is enabled

@expected_impression_params[:visitors][0][:attributes].unshift(
Copy link
Contributor

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.

@aliabbasrizvi
Copy link
Contributor

@rashidsp can you resolve conflicts?

Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a 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.

@aliabbasrizvi
Copy link
Contributor

Looks good.

@aliabbasrizvi aliabbasrizvi merged commit ea0d318 into master Jun 28, 2018
@aliabbasrizvi aliabbasrizvi deleted the rashid/bot_filtering branch June 28, 2018 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants