Skip to content

Commit

Permalink
Merge pull request #404 from uclibs/qa
Browse files Browse the repository at this point in the history
Preparing 1.0.1 release
  • Loading branch information
crowesn authored Nov 16, 2023
2 parents cd8e52e + dac33e7 commit 1f01b00
Show file tree
Hide file tree
Showing 169 changed files with 3,777 additions and 797 deletions.
3 changes: 3 additions & 0 deletions .bundler-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
ignore:
- CVE-2022-25765
42 changes: 26 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ executors:
docker:
- image: docker:20.10.7-git

orbs:
ruby: circleci/[email protected]
node: circleci/[email protected]
browser-tools: circleci/[email protected]
coveralls: coveralls/[email protected]

jobs:
build:
docker:
# specify the version you desire here
- image: circleci/ruby:2.7.4-node-browsers
- image: cimg/ruby:3.0.5-browsers

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand All @@ -38,6 +44,8 @@ jobs:

steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver

- restore_cache:
keys:
Expand All @@ -54,6 +62,7 @@ jobs:
- run:
name: Install Dependencies
no_output_timeout: 15m
command: |
bundle install
sudo apt-get update
Expand All @@ -74,6 +83,19 @@ jobs:
gem install rubocop
bundle exec rubocop --require rubocop-rails
# Brakeman
- run:
name: Run Brakeman
command: bundle exec brakeman -q -w 2

# Bundler-audit
- run:
name: Install Bundler-audit
command: gem install bundler-audit
- run:
name: Run Bundle-audit
command: bundle exec bundle audit check --update

# run tests!
- run:
name: Run rspec in parallel
Expand All @@ -82,21 +104,9 @@ jobs:
bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
#bundle exec rspec --out /tmp/test-results/rspec.xml $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
# collect reports
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
destination: test-results


- store_artifacts:
path: coverage

- deploy:
name: Update Coveralls
command: |
curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_BUILD_NUM&payload[status]=done"
- coveralls/upload:
parallel_finished: true
path_to_lcov: /home/circleci/treatment_database/coverage/lcov/treatment_database.lcov

workflows:
version: 2
Expand Down
6 changes: 5 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
TREATMENT_DATABASE_POOL=5
TREATMENT_DATABASE_PORT=
TREATMENT_DATABASE_TIMEOUT=5000
TREATMENT_DATABASE_USERNAME=
TREATMENT_DATABASE_USERNAME=

Mailer settings
TREATMENT_PRODUCTION_MAILER_FROM=[email protected]
TREATMENT_PRODUCTION_MAILER_URL=localhost
31 changes: 16 additions & 15 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: weekly
day: sunday
labels:
- dependencies
- bundler
- automated pr
target-branch: qa
reviewers:
- hortongn
assignees:
- hortongn
# Update gems
# - package-ecosystem: bundler
# directory: "/"
# schedule:
# interval: weekly
# day: sunday
# labels:
# - dependencies
# - bundler
# - automated pr
# target-branch: qa
# reviewers:
# - hortongn
# assignees:
# - hortongn

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
Expand All @@ -29,4 +30,4 @@ updates:
reviewers:
- hortongn
assignees:
- hortongn
- hortongn
4 changes: 2 additions & 2 deletions .github/workflows/upgrade-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: "Upgrade Ruby"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4.0.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Upgraded Ruby from ${{ steps.check-ruby-version.outputs.CURRENT_RUBY_VERSION }} to ${{ steps.check-ruby-version.outputs.LATEST_RUBY_VERSION }}"
Expand Down
64 changes: 45 additions & 19 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,74 @@ require:
inherit_from: .rubocop_todo.yml

AllCops:
NewCops: enable
Exclude:
- "db/**/*"
- vendor/bundle/**/*
- 'db/**/*'
- 'vendor/bundle/**/*'

Metrics/ClassLength:
Exclude:
- app/controllers/conservation_records_controller.rb
- 'app/controllers/conservation_records_controller.rb'

Rails/LexicallyScopedActionFilter:
Exclude:
- app/controllers/users/registrations_controller.rb
- 'app/controllers/users/registrations_controller.rb'

Metrics/AbcSize:
Exclude:
- app/helpers/in_house_repair_records_helper.rb
- app/helpers/external_repair_records_helper.rb
- app/helpers/activity_helper.rb
- 'app/helpers/in_house_repair_records_helper.rb'
- 'app/helpers/external_repair_records_helper.rb'
- 'app/helpers/activity_helper.rb'
- 'app/controllers/users_controller.rb'
- 'lib/tasks/batch.rake'
- 'lib/tasks/export.rake'

Metrics/BlockLength:
Exclude:
- "spec/**/*.rb"
- 'spec/**/*.rb'
- 'lib/tasks/export.rake'

Metrics/LineLength:
Layout/LineLength:
Exclude:
- "app/views/conservation_records/_conservation_record.json.jbuilder"
- "spec/helpers/activity_helper_spec.rb"

- 'app/views/conservation_records/_conservation_record.json.jbuilder'
- 'lib/tasks/batch.rake'
- 'spec/helpers/activity_helper_spec.rb'
- 'spec/helpers/in_house_repair_records_helper_spec.rb'
- 'lib/tasks/export.rake'

Metrics/MethodLength:
Exclude:
- "app/controllers/search_controller.rb"
- "app/controllers/treatment_reports_controller.rb"
- "app/models/ability.rb"
- "app/helpers/activity_helper.rb"
- 'app/controllers/search_controller.rb'
- 'app/controllers/treatment_reports_controller.rb'
- 'app/models/ability.rb'
- 'app/helpers/activity_helper.rb'
- 'app/controllers/users_controller.rb'
- 'lib/tasks/batch.rake'
- 'app/helpers/in_house_repair_records_helper.rb'
- 'lib/tasks/export.rake'

Metrics/CyclomaticComplexity:
Exclude:
- "app/helpers/activity_helper.rb"
- 'app/helpers/activity_helper.rb'

Metrics/PerceivedComplexity:
Exclude:
- "app/helpers/activity_helper.rb"
- 'app/helpers/activity_helper.rb'

Rails/EagerEvaluationLogMessage:
Exclude:
- 'config/deploy.rb'

Rails/Exit:
Exclude:
- 'config/deploy/production.rb'
- 'config/deploy.rb'

Rails/Output:
Exclude:
- 'config/deploy/production.rb'
- 'config/deploy.rb'

Style/ExpandPathArguments:
Exclude:
- "config/puma.rb"
- 'config/puma.rb'
4 changes: 3 additions & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Style/MixinUsage:
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Layout/LineLength:
Max: 154
Exclude:
- "db/**/*"
Expand All @@ -41,3 +41,5 @@ Rails/FilePath:
- "app/controllers/conservation_records_controller.rb"
- "config/environments/development.rb"
- "config/environments/staging.rb"
Rails/I18nLocaleTexts:
Enabled: false
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.7.4
ruby-3.0.5
19 changes: 19 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git

require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

task :use_rvm do
require 'capistrano/rvm'
end

task local: :use_rvm
35 changes: 20 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.4'
ruby '3.0.5'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
gem 'rails', '~> 6.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.11'
gem 'puma'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Expand All @@ -27,27 +27,29 @@ gem 'jbuilder', '~> 2.5'
# Use rails-controller-testing for testing a controller
gem 'rails-controller-testing'
# Use coveralls for code-coverage
gem 'coveralls', '~> 0.8.22', require: false
# gem 'coveralls', '~> 0.8.22', require: false
gem 'coveralls_reborn'
# Use rubocop for static code analysis
gem 'rubocop'
# Use simplecov to generate the coveralls report in .html format
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

gem 'nokogiri', '>= 1.13'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
# Use devise for authentication
gem 'devise'

gem 'activestorage', '>= 5.2.6.3'

gem 'bootstrap', '~> 4.3.1'

gem 'jquery-rails'
Expand All @@ -60,28 +62,30 @@ gem 'cancancan'

gem 'paper_trail'

gem 'pagy', '~> 3.7'

gem 'ransack'
gem 'pagy'

gem 'brakeman', '~> 5.1', '>= 5.1.1'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'bcrypt_pbkdf'
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'capistrano', '3.17.1'
gem 'capistrano-bundler', '~> 1.6', require: false
gem 'capistrano-rails', '~> 1.4', require: false
gem 'capistrano-rvm', require: false
gem 'database_cleaner'
gem 'ed25519'
gem 'factory_bot_rails'
gem 'rspec_junit_formatter'
gem 'rspec-rails', '~> 3.8'
gem 'rspec-rails', '~> 4.1.0'
gem 'rubocop-rails'
gem 'selenium-webdriver'
gem 'webdrivers'
end

group :development do
gem 'bundler-audit'
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'web-console', '>= 3.3.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
Expand All @@ -96,12 +100,13 @@ end

group :production do
# Needed to get console working in production mode
gem 'aws-xray-sdk', require: ['aws-xray-sdk/facets/rails/railtie']
# gem 'aws-xray-sdk', require: ['aws-xray-sdk/facets/rails/railtie']
gem 'mysql2'
gem 'rb-readline'
end

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

gem 'wkhtmltopdf-binary'
# wkhtmltopdf uclibs fork
gem 'wkhtmltopdf-binary', git: 'https://github.com/uclibs/wkhtmltopdf_binary_gem', branch: '153/oracle-linux-support'
Loading

0 comments on commit 1f01b00

Please sign in to comment.