-
Notifications
You must be signed in to change notification settings - Fork 174
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
Breadcrumbs: Add Mongo integration #516
Conversation
…nge name to event_name
… to avoid namespace clashes
…dcrumb definitions
@@ -0,0 +1,5 @@ | |||
class Test |
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.
Rename this class to MongoModel
so that it matches the file name, and so you don't have to require
this file in MongoController
@@ -0,0 +1,15 @@ | |||
require './app/models/mongo_model' | |||
|
|||
class MongoController < ActionController::Base |
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.
Controllers should generally inherit from ApplicationController
instead (and usually don't need the protect_from_forgery
on the next line unless the controller in question needs to deviate from what is set in ApplicationController
regarding CSRF protection)
default: | ||
# Defines the name of the default database that Mongoid can connect to. | ||
# (required). | ||
database: rails52_development |
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.
Should this be rails4_development instead? (because it is the rails4 fixture app)
Similar comment applies to a few other places.
class MongoController < ActionController::Base | ||
protect_from_forgery with: :exception | ||
|
||
def index |
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.
This action appears to be unused.
lib/bugsnag/integrations/mongo.rb
Outdated
## | ||
# Listens to the 'started' event | ||
# | ||
# @param event [Object] the mongo_ruby_driver generated event |
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.
[Mongo::Event::Base]
(same with the other event
parameters
And the request used the "Ruby Bugsnag Notifier" notifier | ||
And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa" | ||
And the event has a "process" breadcrumb named "Mongo query started" | ||
And the event has a "process" breadcrumb named "Mongo query succeeded" |
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.
Can you add a test for the failed event from a separate route/controller-action? (I think causing a duplicate key error on a collection with a unique index should trigger a failed event if you can't think of some other way)
@@ -56,3 +56,24 @@ Scenario Outline: SQL Breadcrumb | |||
| 2.4 | 5 | | |||
| 2.5 | 3 | | |||
| 2.5 | 5 | | |||
|
|||
Scenario Outline: Mongo breadcrumbs |
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 would put this in a separate feature file as it isn't related to the other activesupport/Rails related breadcrumbs.
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.
some of the controllers need to inherit from ApplicationController
for them to work, and a couple other minor comments, otherwise lgtm
features/fixtures/docker-compose.yml
Outdated
@@ -93,6 +96,8 @@ services: | |||
args: | |||
- RUBY_VERSION | |||
- APP_PATH | |||
depends_on: | |||
- mongo |
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.
It looks like you don't have any Rails 3 + mongo tests, so this depends_on
here is unnecessary.
default: | ||
database: rails4_test | ||
hosts: | ||
- mongo:27018 |
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.
Should this be 27017 instead? (although I guess the maze-runner tests don't run test suites themselves, so this is probably doesn't matter)
@@ -0,0 +1,17 @@ | |||
class MongoController < ActionController |
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.
This should inherit from ApplicationController
, not ActionController
(same with the rails5 app)
* Breadcrumbs/Circular buffer: Added circular buffer class * Breadcrumbs/Circular buffer: Added initial buffer unit tests * Breadcrumbs/Circular buffer: Ensure test file is named correctly * Breadcrumbs/Circular buffer: Code tidy up * Breadcrumbs / Breadcrumb class: Add first pass breadcrumb class with unit tests * Breadcrumbs/Circular buffer rubocop fixes * Breadcrumbs / Breadcrumb class: Rubocop fixes * Breadcrumbs/Cricular buffer: Improve test readability * Breadcrumbs/Breadcrumb: Simplified timestamp, improved tests * Breadcrumbs/Breadcrumb: Rubocop requirements * Breadcrumbs/Breadcrumb: Added doc comments * Breadcrumbs/Circular buffer: Fixed RSpec/Rspec typo * Breadcrumbs/Breadcrumb: Using explicit RSpec.describe call * Breadcrumbs/Validator: Added validator and tests * Breadcrumbs/Validator: Rubocop fixes * Breadcrumbs/Validator: Tidying up from initial review * Breadcrumbs/Validator: Re-add renamed types file * Breadcrumbs/Breadcrumb: Change message => name, add yard comments * Breadcrumbs/Circular buffer: Added yard docs * Breadcrumbs/Breadcrumb: Improve tests, convert to utc sooner * Breadcrumbs/Configuration: Initial configuration changes * Breadcrumbs/Report: Initial report changes to support breadcrumbs * Breadcrumbs/Breadcrumb: Test timestamps match up * Breadcrumbs/Validator: Change 'message' to 'name', use name and meta_data clones * Breadcrumbs/Validator: Refactor toward instance_double & let * Breadcrumbs/Configuration: Add in missing import statement * Breadcrumbs/Circular buffer docs: Improve readability * Breadcrumbs/Configuration: Add configuration tests * Breadcrumbs/Configuration: Added yardoc comments * Breadcrumbs/Configuration: Simplify before_breadcrumb_callbacks, allow automatic_breadcrumb_types editting * Breadcrumbs/Configuration: Add automatic breadcrumbs types editablilty test * Breadcrumbs/Configuration: Add types to Yardoc arrays * Breadcrumbs/Validator: Use an instance_double to reflect Configuration better * Breadcrumbs/Validator: Add Yardoc comments * Breadcrumbs/Validator: Use select over each when filtering * Breadcrumbs/Validator: Clean up tests * Breadcrumbs/Validator: Use double for configuration * Breadcrumbs/Validator: Improved Yardoc * Breadcrumbs/Leave breadcrumb: Add implementation and tests * Breadcrumbs/Middleware: Add breadcrumb middleware * Breadcrumbs/Report: Rubify get_summary method name * Breadcrumbs/Report: Ensure message is set correctly * Breadcrumbs/Report: Change default breadcrumbs from Hash to Array * Breadcrumbs/Report: Ensure breadcrumb meta_data is filtered correctly * Breadcrumbs/Report: Fixed typo * Bugsnag/Report: Added tests * Breadcrumbs/Leave breadcrumb: Update rubocop to allow increased Bugsnag module length * Breadcrumbs/middleware: Rubocop fixes * Breadcrumbs/Leave-breadcrumb: Rubocop improvements/early return * Breadcrumbs/Leave-breadcrumb: Better block styling * Breadcrumbs/Report: Ensure report summary is consistent with dashboard * Breadcrumbs/Report: Better Rubocop report exclusions * Breadcrumbs/Report: Rspec improvements * Breadcrumbs/Notify-breadcrumb: Initial implementation and tests * Breadcrumbs/Notify breadcrumb: Add test against notifying a string * Breadcrumbs/Report: Better checking against Java error * Breadcrumbs/Report: Make summary more accurate * Breadcrumbs/Report update: make summary guard more readable * Breadcrumbs/Update automatic_breadcrumb_types to enabled_automatic_breadcrumb_types * Breadcrumbs: Rails Breadcrumbs (#514) * Breadcrumbs/Rails integration: Initial integration implemenetation * Breadcrumbs/Rails: Minor fixes * Breadcrumbs/Rails: Add initial maze tests * Breadcrumbs/Rails breadcrumbs: Remove plural event data * Breadcrumbs/Rails breadcrumbs: Ammend breadcrumb namespace * Breadcrumbs/Rails breadcrumbs: Remove event_id from allowed keys, change name to event_name * Breadcrumbs/Rails breadcrumbs: Require breadcrumb file when necessary to avoid namespace clashes * Breadcrumbs/Rails breadcrumbs: Fix rubocop issues * Breadcrumbs/Rails breadcrumbs: Clarify namespaces better * Breadcrumbs/Rails breadcrumbs: Remove invalid data from captured breadcrumb definitions * Breadcrumbs/Rails breadcrumbs: Added ActiveJob breadcrumb test * Breadcrumbs/Rails breadcrumbs: Ammended active_job event id * Breadcrumbs/Ruby breadcrumbs: Removed complex breadcrumb metadata * Breadcrumbs/Ruby: Added cache breadcrumb * Breadcrumbs/Ruby breadcrumbs: Fleshed out maze-test expectations where possible * Breadcrumbs/Rails breadcrumbs: Fixed broken test fixture, made fixtures more rails-y * Breadcrumbs: Add Mongo integration (#516) * Breadcrumbs/Rails integration: Initial integration implemenetation * Breadcrumbs/Rails: Minor fixes * Breadcrumbs/Rails: Add initial maze tests * Breadcrumbs/Mongo: Initial subscriber implementation * Breadcrumbs/Rails breadcrumbs: Remove plural event data * Breadcrumbs/Rails breadcrumbs: Ammend breadcrumb namespace * Breadcrumbs/Rails breadcrumbs: Remove event_id from allowed keys, change name to event_name * Breadcrumbs/Rails breadcrumbs: Require breadcrumb file when necessary to avoid namespace clashes * Breadcrumbs/Mongo integration: Fix module name issue * Breadcrumbs/Mongo integration: Maintain consistency with ActiveSupport arguments * Breadcrumbs/Rails breadcrumbs: Fix rubocop issues * Breadcrumbs/Rails breadcrumbs: Clarify namespaces better * Breadcrumbs/Mongo integration: Add integration tests * Breadcrumbs/Mongo integration: Remove example commits * Breadcrumbs/Rails breadcrumbs: Remove invalid data from captured breadcrumb definitions * Breadcrumbs/Mongo integration: Rubocop fixes * Breadcrumbs/Mongo integration: Better doc comments * Breadcrumbs/Mongo integration: Improve tests, add 'failure' test * Breadcrumbs/Mongo integration: Re-add 'success' test * Breadcrumbs/Rails breadcrumbs: Added ActiveJob breadcrumb test * Breadcrumbs/Rails breadcrumbs: Ammended active_job event id * Breadcrumbs/Ruby breadcrumbs: Removed complex breadcrumb metadata * Breadcrumbs/Ruby: Added cache breadcrumb * Breadcrumbs/Ruby breadcrumbs: Fleshed out maze-test expectations where possible * Breadcrumbs/Mongo integration: Rubocop fixes * Breadcrumbs/Rails breadcrumbs: Fixed broken test fixture, made fixtures more rails-y * Breadcrumbs/Mongo integration: Maze fixes * Breadcrumbs/Validator: Allow nil as an acceptable meta_data type (#520) * Breadcrumbs/Mongo: Remove 'started' breadcrumb, add collection detail (#519) * Breadcrumbs/Mongo integration: Remove 'started' event, add 'collection' data * Breadcrumbs/Mongo: Add filter keys * Breadcrumbs/Mongo integration: Made filters consistent with other breadcrumb implementations * Breadcrumbs/Mongo integration: Rubocop fixes * Breadcrumbs/Mongo integration: Address feedback * Breadcrumbs: Additional Rails ActiveRecord data (#521) * Breadcrumbs/Rails breadcrumbs: Capture event_id * Breadcrumbs/Rails breadcrumbs: Capture 'sql' string and redacted bindings * Breadcrumbs/Rails integration: Redact SQL string values * Breadcrumbs/Rails integration: Remove SQL string acquisition * Breadcrumbs/Rails improvements: Remove unnecessary require * Breadcrumbs/Rails integration: Add integration tests for bindings * Breadcrumbs/Ruby integration: lock nokogiri version * Breadcrumbs/Ruby integration: Better meta_data naming, Ruby < 2.1 compatability * Breadcrumbs/Mongo integration: Handle 'any_of' cases (#522) * Breadcrumbs/Mongo integration: Handle 'any_of' cases * Breadcrumbs/Mongo Integration: Improve filter sanitization process and add unit tests * Breadcrumbs/Mongo integration: Ensure tests are notated correctly * Breadcrumbs/Mongo filters: Add 1.9.3 & 2.0.0 compatability * Breadcrumbs/Mongo integration: Appease rubocop * Breadcrumbs/Mongo integration: Minor test and efficieny improvements * Breadcrumbs/Mongo integration: Test improvements * Breadcrumbs/Mongo integrations: Test spelling * Breadcrumbs: Fix rubocop issues (excluding configuration from ClassLength until refactor)
Goal
Add Mongo integration to support capturing breadcrumbs