Skip to content

Commit

Permalink
Rails & Ruby upgrade (#68)
Browse files Browse the repository at this point in the history
TODO
- [x] Rails 7 -> Closes #18 
- [x] Ruby 3.2 -> Closes #19 
- [x] Github workflows
- [x] Standardrb 
- [x] bin/dev + foreman
- [x] Schema + models
- [x] Controllers
- [x] Helpers
- [x] Views
- [x] README, LICENSE + CODE OF CONDUCT
- [x] GraphQL for ShopifyPartnerAPI -> Closes #55 
- [x] Add Sidekiq and convert Workers to ActiveJob -> Closes #16 
- [x] Routes
- [x] Devise
- [x] Action Mailer
- [x] Check Initializers
- [x] Active Storage -> Closes #20
- [x] JS & CSS Assets -> Closes #28 
- [x] Polaris View Components -> Closes #33 
- [x] Rename PaymentHistory to Payments for simplicity
- [x] Import model, associate with payment_histories & metrics
- [x] Cleanup metric calculations and importers
- [x] UI: User profile
- [x] UI: Chartkick
- [x] UI: Payments summary
- [x] UI: Re-name app screen
- [x] UI: Ensure only 1 in progress import at a time
- [x] UI: API Connection settings
- [x] UI: Yearly graphs & metrics per charge type
- [x] UI: New homepage
- [x] Fix tests + Mocha
- [x] Add support for YEARLY subscription metrics
- [x] Add support for more history data (12 years for CSV + 3 months for
API only)
- [x] Contact link to issues in Github
- [x] Double check everything 😅
- [x] ActiveStorage production settings
- [x] Sendgrid production settings
- [x] Add DeleteApp feature
- [x] Controller + System tests for main pages
- [x] Update README with upgrade instructions
  • Loading branch information
forsbergplustwo authored Sep 21, 2023
2 parents 6536b34 + 6f90da2 commit e6cec85
Show file tree
Hide file tree
Showing 303 changed files with 66,218 additions and 10,140 deletions.
15 changes: 2 additions & 13 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
SECRET_KEY_BASE="b9e3d8d8ddf8e997077ff5a4db3d948800c2eebee74c79e1dc5bcfb1e467e087c2f97d9fb2a8b02041abac00785af1a45249sdff5978e2d6a9a6bd28ea4729f1"

SENDGRID_USERNAME=
SENDGRID_PASSWORD=
EMAIL_FROM_ADDRESS=

S3_BUCKET=
AWS_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

INTERCOM_APP_ID=
INTERCOM_APP_SECRET=
# Please keep .env.example identical to .env so that future developers know what goes into the file
REDIS_URL=redis://localhost:6379/1
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
required: false
default: false
secrets:
secret_key_base:
master_key:
required: true
bundle_token:
required: true
Expand Down Expand Up @@ -57,16 +57,22 @@ jobs:
- name: Setup test database
env:
RAILS_ENV: test
SECRET_KEY_BASE: ${{ secrets.secret_key_base }}
RAILS_MASTER_KEY: ${{ secrets.master_key }}
run: |
bin/rake db:create
bin/rake db:schema:load
bin/rake db:migrate
- name: Build assets
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.master_key }}
run: |
bin/rake assets:precompile
- name: Run tests
env:
AWS_REGION: us-east-1
REDIS_URL: redis://localhost:6379/0
SECRET_KEY_BASE: ${{ secrets.secret_key_base }}
RAILS_MASTER_KEY: ${{ secrets.master_key }}
run: |
bin/rake test
- name: Upload artifacts
Expand Down
89 changes: 24 additions & 65 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,77 +1,36 @@
#----------------------------------------------------------------------------
# Ignore these files when commiting to a git repository.
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# The original version of this file is found here:
# https://github.com/RailsApps/rails-composer/blob/master/files/gitignore.txt
#
# Corrections? Improvements? Create a GitHub issue:
# http://github.com/RailsApps/rails-composer/issues
#----------------------------------------------------------------------------
# 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'

# bundler state
# Ignore bundler config.
/.bundle
/vendor/bundle/
/vendor/ruby/

# minimal Rails specific artifacts
db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# various artifacts
**.war
*.rbc
*.sassc
.redcar/
.sass-cache
/config/config.yml
/coverage.data
/coverage/
/db/*.javadb/
/db/*.sqlite3
/doc/api/
/doc/app/
/doc/features.html
/doc/specs.html
/public/cache
/public/stylesheets/compiled
/public/system/*
/spec/tmp/*
/cache
/capybara*
/capybara-*.html
/gems
/specifications
rerun.txt
pickle-email-*.html
.zeus.sock

# 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
#
# Here are some files you may want to ignore globally:

# scm revert files
**.orig

# Mac finder artifacts
.DS_Store
# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Netbeans project directory
/nbproject/
# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

# RubyMine project files
.idea
/public/assets

# Textmate project files
/*.tmproj
# Ignore master key for decrypting credentials and more.
/config/master.key

# vim artifacts
**.swp
/app/assets/builds/*
!/app/assets/builds/.keep

# Environment files that may contain sensitive data
.env
/node_modules
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.8
3.2.0
9 changes: 6 additions & 3 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins:
- standard-rails
- standard-minitest
- standard-thread_safety

ignore:
- 'bin/*'
- 'db/**/*'
- 'config/environments/*'
- '**/*':
- Rails/EnvironmentVariableAccess
- Lint/FloatComparison
- 'config/puma.rb'
102 changes: 46 additions & 56 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,70 +1,60 @@
source "https://rubygems.org"
ruby "2.6.8"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gem "activerecord-import"
gem "aws-sdk", "~> 2"
gem "bootstrap-datepicker-rails"
gem "bootstrap-sass"
gem "bootstrap-select-rails", "~> 1.12.0"
gem "chartkick"
gem "coffee-rails", "~> 4.0.0"
gem "convenient_grouper"
ruby "3.2.0"

# Backend
gem "rails", "~> 7.0.5"
gem "pg", "~> 1.1"
gem "puma", "~> 6.0"
gem "redis", "~> 5.0"
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
gem "bootsnap", require: false
gem "sidekiq"
gem "rack-timeout", require: "rack/timeout/base"
gem "active_storage_validations"
gem "sendgrid-actionmailer"

# Frontend
gem "sprockets-rails"
gem "jsbundling-rails"
gem "turbo-rails"
gem "stimulus-rails"
gem "devise"
gem "devise-bootstrap-views"
gem "font-awesome-rails", "~> 4.7.0"
gem "font-awesome-sass", "~> 4.7.0"
gem "polaris_view_components"

# Charting + Metrics Display
gem "chartkick"
gem "groupdate"
gem "high_voltage"
gem "intercom-rails"
gem "jbuilder", "~> 2.0"
gem "jquery-rails"
gem "jquery-tablesorter"
gem "pg", "< 1.0.0"
gem "pkg-config"
gem "rack-timeout", require: "rack/timeout/base"
gem "rails", "~> 4.2"
gem "redis", "~> 4.0"
gem "remotipart", "~> 1.0"
gem "resque"
gem "resque-pool"
gem "resque-web", require: "resque_web"
gem "rubyzip"
gem "sass-rails", "~> 4.0.3"
gem "sdoc", "~> 0.4.0", group: :doc
gem "convenient_grouper"
gem "prophet-rb"

# Importing
gem "csvreader"
gem "spring", group: :development
gem "uglifier", ">= 1.3.0"
gem "unicorn"
gem "activerecord-import"
gem "graphql-client"
gem "aws-sdk-s3", require: false

group :development, :test do
gem "foreman"
gem "dotenv-rails"
gem "debug", platforms: %i[mri mingw x64_mingw]
end

# Code analysis / linters
gem "brakeman"
gem "bullet"
gem "bundle-audit"
group :development do
gem "web-console"
gem "pry-rails"
gem "foreman"
gem "standard"

gem "mocha"
gem "standard-rails"
gem "standard-minitest"
gem "standard-thread_safety"
gem "hotwire-livereload"
gem "letter_opener"
gem "http_logger"

# TODO: Add these back when Ruby 2.7+ is supported
# gem "standard-rails"
# gem "standard-minitest"
# gem "standard-thread_safety"
end

group :development do
gem "better_errors"
gem "binding_of_caller"
gem "hub", require: nil
gem "quiet_assets"
gem "rails_layout"
end
group :production do
gem "rails_12factor"
group :test do
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
gem "mocha"
end

gem "graphiql-rails", group: :development
Loading

0 comments on commit e6cec85

Please sign in to comment.