Skip to content

Commit

Permalink
Merge pull request #839 from greenriver/release-63
Browse files Browse the repository at this point in the history
Release 63
  • Loading branch information
eanders authored Sep 26, 2024
2 parents 9ef4620 + 3b088fb commit bc54e6b
Show file tree
Hide file tree
Showing 58 changed files with 350 additions and 468 deletions.
48 changes: 48 additions & 0 deletions .github/dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
aws-cli
bash
build-base
ca-certificates
chromium
curl
curl-dev
file
file-dev
freetds-dev
freetype
freetype-dev
geos
geos-dev
git
glib
harfbuzz
icu
icu-dev
imagemagick
lftp
libcurl
libgcc
libintl
libmagic
libstdc++
libx11
libxext
libxml2-dev
libxrender
libxslt-dev
nodejs
npm
nss
postgis
postgresql
postgresql-dev
shared-mime-info
tmux
ttf-dejavu
ttf-droid
ttf-freefont
ttf-freefont
ttf-freefont
ttf-liberation
tzdata
xz
yarn
25 changes: 4 additions & 21 deletions .github/workflows/asset_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install GNU tar (required by cache step and checksumming)
run: |
Expand All @@ -58,34 +58,16 @@ jobs:
DATABASE_DB_TEST: cas_test
REPORTING_DATABASE_DB_TEST: reporting_test
run: |
apk add --no-cache \
nodejs yarn npm \
aws-cli \
tzdata \
git \
bash \
freetds-dev \
icu icu-dev \
curl libcurl curl-dev \
imagemagick \
libmagic file-dev file \
build-base libxml2-dev libxslt-dev postgresql-dev \
libgcc libstdc++ libx11 glib libxrender libxext libintl ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-freefont \
chromium nss freetype freetype-dev harfbuzz ca-certificates ttf-freefont \
lftp postgresql tmux postgis geos geos-dev xz \
shared-mime-info \
xz
apk add --no-cache $(cat .github/dependencies.txt)
echo "postgres:5432:*:postgres:postgres" > ~/.pgpass
chmod 600 ~/.pgpass
gem install bundler --version=2.5.17
# According to https://www.jessesquires.com/blog/2021/08/23/caching-bundler-on-github-actions/
# this is fragile and failure prone, but the step they recommend using instead (ruby/ruby-setup)
# isn't supported on Alpine.
- name: cache gems
uses: actions/cache@v3
uses: actions/cache@v4
id: gemcache
with:
path: |
Expand All @@ -102,6 +84,7 @@ jobs:
- name: Install gems
if: always()
run: |
gem install bundler --version=2.5.17
bundle config set --local without 'production staging development'
bundle install --jobs 10 --retry 3
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Bundle Audit and Brakeman

on:
push:
branches:
- '*'
- '**/*'
concurrency:
group: ${{ github.ref }}-audit
cancel-in-progress: true

jobs:
audit:
runs-on: ubuntu-20.04
# Docker Hub image that the job executes in
container: ruby:3.1.6-alpine3.20

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up dependencies
run: |
apk add --no-cache $(cat .github/dependencies.txt)
- name: 'Install gems'
run: |
gem install bundler --version=2.5.17
bundle config set --local without 'production staging development'
bundle install --jobs 4 --retry 3
- name: Run bundle-audit
run: |
bundle exec bundle-audit check --update
- name: Run brakeman
run: |
bundle exec brakeman -q --no-pager --except PermitAttributes,Render
83 changes: 0 additions & 83 deletions .github/workflows/ci.yml

This file was deleted.

44 changes: 20 additions & 24 deletions .github/workflows/rails_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ on:
branches:
- '*'
- '**/*'
# NOTE: you don't need to build all PRs if you are also building all branches
# pull_request:
# branches:
# - '*'
# - '**/*'
concurrency:
group: ${{ github.ref }}-tests
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -43,36 +41,34 @@ jobs:
DATABASE_WAREHOUSE_DB_TEST: test_hmis_warehouse
DATABASE_DB_TEST: boston_cas_test
steps:
- name: Install git
run: |
apk add --no-cache git
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up dependencies

run: |
apk add --no-cache \
nodejs yarn npm \
tzdata \
git \
bash \
freetds-dev \
icu icu-dev \
curl libcurl curl-dev \
imagemagick \
libmagic file-dev file \
build-base libxml2-dev libxslt-dev postgresql-dev \
libgcc libstdc++ libx11 glib libxrender libxext libintl ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-freefont \
freetype freetype-dev harfbuzz ca-certificates ttf-freefont \
postgresql tmux postgis geos geos-dev xz \
shared-mime-info
apk add --no-cache $(cat .github/dependencies.txt)
echo "postgres:5432:*:postgres:postgres" > ~/.pgpass
chmod 600 ~/.pgpass
yarn install --frozen-lockfile
gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
gem install bundler -v '< 2'
- name: 'Install gems'
- name: cache gems
uses: actions/cache@v4
id: gemcache
with:
path: |
vendor/bundle
/usr/local/bundle/
key: ${{ runner.os }}-gemcache-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/.ruby-version') }}

- name: Install gems
run: |
gem install bundler --version=2.5.17
bundle config set --local without 'production staging development'
bundle install --jobs 4 --retry 3
- name: 'App setup'
Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,36 @@ jobs:
# Docker Hub image that the job executes in
container: ruby:3.1.6-alpine3.20
steps:
- id: dependencies
name: Set up dependencies
- name: Install git
run: |
apk add --no-cache \
nodejs yarn npm \
tzdata \
git \
bash \
freetds-dev \
icu icu-dev \
curl libcurl curl-dev \
imagemagick \
libmagic file-dev file \
build-base libxml2-dev libxslt-dev postgresql-dev \
libgcc libstdc++ libx11 glib libxrender libxext libintl ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-freefont \
chromium nss freetype freetype-dev harfbuzz ca-certificates ttf-freefont \
lftp postgresql postgis geos geos-dev \
shared-mime-info
gem install bundler --version=2.5.7
apk add --no-cache git
- uses: actions/checkout@v4
with:
fetch-depth: 0

- id: dependencies
name: Set up dependencies
run: |
apk add --no-cache $(cat .github/dependencies.txt)
# ensure changed-files can read repo files from git
- name: Configure Git Safe Directory
run: git config --global --add safe.directory /__w/boston-cas/boston-cas

- name: cache gems
uses: actions/cache@v4
id: gemcache
with:
path: |
vendor/bundle
/usr/local/bundle/
key: ${{ runner.os }}-gemcache-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/.ruby-version') }}

- id: gems
name: Install gems
run: |
gem install bundler --version=2.5.17
bundle config set --local without 'production staging'
bundle install --jobs 4 --retry 3
Expand All @@ -60,7 +59,9 @@ jobs:
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
files=`echo "${ALL_CHANGED_FILES}" | tr " " "\n" | grep "**/*.rb" | tr "\n" " ./"`
# Ignore files we don't control the format of
ignore_patterns="db/schema.rb\|bin/rails\|bin/rake\|bin/bundle"
files=`echo "${ALL_CHANGED_FILES}" | tr " " "\n" | grep -v $ignore_patterns | grep "**/*.rb" | tr "\n" " ./"`
num=`echo $files | wc -w`
echo $files
if [ $num -gt 0 ]; then bundle exec rubocop --config ./.rubocop.yml $files; else echo "No changed ruby files"; fi
3 changes: 2 additions & 1 deletion app/controllers/reports/agency_interactions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ def index

def match_decision_reasons_collection
MatchDecisionReasons::Base.
active.
order(name: :asc).
map { |reason| [reason_text(reason), reason.id] }
end
helper_method :match_decision_reasons_collection

def reason_text(match_decision_reason)
text = match_decision_reason.name
text << " (#{match_decision_reason.title})" if match_decision_reason.title.present?
text << " (#{match_decision_reason.title})" if match_decision_reason.title.present? && match_decision_reason.title != match_decision_reason.name
text
end
helper_method :reason_text
Expand Down
Loading

0 comments on commit bc54e6b

Please sign in to comment.