Skip to content

Commit

Permalink
Merge 9f05cf7 into eaef01a
Browse files Browse the repository at this point in the history
  • Loading branch information
Cawllec committed Apr 29, 2019
2 parents eaef01a + 9f05cf7 commit 2f9b27e
Show file tree
Hide file tree
Showing 121 changed files with 7,813 additions and 10 deletions.
37 changes: 37 additions & 0 deletions features/fixtures/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,43 @@ services:
published: 61285
restart: "no"

rails6:
build:
context: rails6
args:
- RUBY_VERSION
- APP_PATH
environment:
- BUGSNAG_API_KEY
- http_proxy
- RAILS_ENV
- BUGSNAG_APP_TYPE
- BUGSNAG_APP_VERSION
- BUGSNAG_AUTO_CAPTURE_SESSIONS
- BUGSNAG_AUTO_NOTIFY
- BUGSNAG_ENDPOINT
- BUGSNAG_IGNORE_CLASS
- BUGSNAG_IGNORE_MESSAGE
- BUGSNAG_META_DATA_FILTERS
- BUGSNAG_NOTIFY_RELEASE_STAGE
- BUGSNAG_PROJECT_ROOT
- BUGSNAG_PROXY_HOST
- BUGSNAG_PROXY_PASSWORD
- BUGSNAG_PROXY_PORT
- BUGSNAG_PROXY_USER
- BUGSNAG_RELEASE_STAGE
- BUGSNAG_SEND_CODE
- BUGSNAG_SEND_ENVIRONMENT
- BUGSNAG_SESSION_ENDPOINT
- BUGSNAG_TIMEOUT
- CALLBACK_INITIATOR
- SQL_ONLY_BREADCRUMBS
- USE_DEFAULT_AUTO_CAPTURE_SESSIONS
ports:
- target: 3000
published: 61286
restart: "no"

resque:
build:
context: resque
Expand Down
1 change: 1 addition & 0 deletions features/fixtures/rails6/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app/Gemfile.lock
26 changes: 26 additions & 0 deletions features/fixtures/rails6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ARG RUBY_VERSION
FROM ruby:$RUBY_VERSION

RUN apt-get update

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list

RUN apt-get install -y nodejs yarn

WORKDIR /bugsnag
COPY temp-bugsnag-lib ./

WORKDIR /usr/src/app
COPY app/Gemfile /usr/src/app/
RUN bundle install

RUN cat Gemfile.lock

COPY app/ /usr/src/app

RUN bundle exec rake db:migrate

RUN bundle exec rake app:update:bin

CMD ["bundle", "exec", "bin/rails", "s", "-b", "0.0.0.0"]
1 change: 1 addition & 0 deletions features/fixtures/rails6/app/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults
35 changes: 35 additions & 0 deletions features/fixtures/rails6/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep

/public/assets
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
1 change: 1 addition & 0 deletions features/fixtures/rails6/app/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.1
57 changes: 57 additions & 0 deletions features/fixtures/rails6/app/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.0.beta3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.3', '>= 1.3.6'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '>= 4.0.0.rc.3'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.1', require: false

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

# Added at 2019-04-24 17:24:14 +0100 by amoinet:
gem "bugsnag", "~> 6.11"

gem "clearance", "~> 1.16"
24 changes: 24 additions & 0 deletions features/fixtures/rails6/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# README

This README would normally document whatever steps are necessary to get the
application up and running.

Things you may want to cover:

* Ruby version

* System dependencies

* Configuration

* Database creation

* Database initialization

* How to run the test suite

* Services (job queues, cache servers, search engines, etc.)

* Deployment instructions

* ...
6 changes: 6 additions & 0 deletions features/fixtures/rails6/app/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative 'config/application'

Rails.application.load_tasks
2 changes: 2 additions & 0 deletions features/fixtures/rails6/app/app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
16 changes: 16 additions & 0 deletions features/fixtures/rails6/app/app/controllers/api_key_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class ApiKeyController < ActionController::Base
protect_from_forgery

def environment
Bugsnag.notify("handled string")
render json: {}
end

def changing
Bugsnag.configure do |conf|
conf.api_key = params[:api_key]
end
Bugsnag.notify("handled string")
render json: {}
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class AppTypeController < ActionController::Base
protect_from_forgery

def initializer
Bugsnag.notify("handled string")
render json: {}
end

def after
Bugsnag.configure do |conf|
conf.app_type = params[:type]
end
Bugsnag.notify("handled string")
render json: {}
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class AppVersionController < ActionController::Base
protect_from_forgery

def default
Bugsnag.notify("handled string")
render json: {}
end

def initializer
Bugsnag.notify("handled string")
render json: {}
end

def after
Bugsnag.configure do |conf|
conf.app_version = params[:version]
end
Bugsnag.notify("handled string")
render json: {}
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class ApplicationController < ActionController::Base
protect_from_forgery

def index
render json: {}
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class AutoNotifyController < ActionController::Base
protect_from_forgery

def unhandled
generate_unhandled_error
end

def handled
Bugsnag.notify("handled string")
render json: {}
end

def unhandled_after
Bugsnag.configure do |conf|
conf.auto_notify = false
end
generate_unhandled_error
end

def handled_after
Bugsnag.configure do |conf|
conf.auto_notify = false
end
Bugsnag.notify("handled string")
render json: {}
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
class BeforeNotifyController < ActionController::Base
protect_from_forgery
before_bugsnag_notify :add_diagnostics_to_bugsnag

def handled
Bugsnag.before_notify_callbacks << Proc.new do |report|
report.add_tab(:before_notify, {
:source => "rails_before_handled"
})
end
Bugsnag.notify("handled string")
render json: {}
end

def unhandled
Bugsnag.before_notify_callbacks << Proc.new do |report|
report.add_tab(:before_notify, {
:source => "rails_before_unhandled"
})
end
generate_unhandled_error
end

def inline
Bugsnag.notify("handled string") do |report|
report.add_tab(:before_notify, {
:source => "rails_inline"
})
end
render json: {}
end

private

def add_diagnostics_to_bugsnag(report)
report.add_tab(:controller, {
:name => "BeforeNotifyController"
})
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class BreadcrumbsController < ApplicationController
def handled
Bugsnag.notify("Request breadcrumb")
render json: {}
end

def sql_breadcrumb
User.find_by(email: "foo")
Bugsnag.notify("SQL breadcrumb")
render json: {}
end

def active_job
NotifyJob.perform_later
render json: {}
end

def cache_read
Rails.cache.write('test', true)
Rails.cache.read('test')
Bugsnag.notify("Cache breadcrumb")
render json: {}
end
end

0 comments on commit 2f9b27e

Please sign in to comment.