Skip to content

Commit

Permalink
Merge branch 'master' into revert-19042-feature/APPEALS-17497-v1
Browse files Browse the repository at this point in the history
  • Loading branch information
kristeja authored Aug 2, 2023
2 parents 7dd7137 + 2ea0fb6 commit 3d6b0f3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
1 change: 1 addition & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ plugins:
exclude_patterns:
- 'db/schema.rb'
- 'db/seeds.rb'
- 'db/scripts/*'
- 'node_modules/**/*'
- 'app/mappers/zip_code_to_lat_lng_mapper.rb'
- 'tmp/**/*'
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,38 @@ jobs:
steps:
- uses: actions/checkout@v3

# If we don't explicitly set this, the runner doesn't find the path when trying to save the cache
- name: Set yarn cache directory
id: set-yarn-cache-dir
run: mkdir -p ~/.cache/yarn && yarn config set cache-folder ~/.cache/yarn

- name: restore yarn cache
id: cache-yarn-cache
uses: actions/cache/restore@v3
with:
key: dot-cache-yarn-v2-{{ arch }}-{{ checksum "client/yarn.lock" }}
# hashFiles('client/yarn.lock') will use a unique cache based on dependencies so that we don't
# create a cache for each target branch
key: yarn-cache-${{ hashFiles('client/yarn.lock') }}
# We are including node_modules because most of the time is used to build the dependencies
path: |
node_modules
client/node_modules
~/.cache/yarn
public/assets
tmp/cache/assets/sprockets
restore-keys:
dot-cache-yarn-v2-{{ arch }}-{{ checksum "client/yarn.lock" }}
restore-keys: yarn-cache-${{ hashFiles('client/yarn.lock') }}

# We run yarn install after loading the cache to update any dependencies if their version is different
- name: Install Node Dependencies
run: ./ci-bin/capture-log "cd client && yarn install --frozen-lockfile"
run: ./ci-bin/capture-log "cd client && yarn install --frozen-lockfile --prefer-offline"

- name: Save Yarn Cache
if: steps.cache-yarn-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
key: dot-cache-yarn-v2-{{ arch }}-{{ checksum "client/yarn.lock" }}
key: yarn-cache-${{ hashFiles('client/yarn.lock') }}
path: |
node_modules
client/node_modules
~/.cache/yarn
public/assets
tmp/cache/assets/sprockets
- name: setup testfiles directory
run: ./ci-bin/capture-log "mkdir -p tmp/testfiles"
Expand Down Expand Up @@ -178,9 +186,11 @@ jobs:
./ci-bin/capture-log "DB=etl bundle exec rake db:create db:schema:load db:migrate"
./ci-bin/capture-log "bundle exec rake db:create db:schema:load db:migrate"
- name: make seed-dbs
# We don't want to seed DBs here because DatabaseCleaner just truncates it anyway. The setup_vacols
# rake task needs to be run because it adds data to two tables that are ignored by DBCleaner
- name: Seed databases
run: |
./ci-bin/capture-log "make -f Makefile.example seed-dbs"
./ci-bin/capture-log "bundle exec rake spec:setup_vacols"
- name: Assets Precompile
run: |
Expand Down
18 changes: 13 additions & 5 deletions db/scripts/audit/remove_caseflow_audit_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

require "pg"

conn = CaseflowRecord.connection
conn.execute(
"drop schema IF EXISTS caseflow_audit CASCADE;"
)
conn.close
begin
conn = CaseflowRecord.connection
conn.execute(
"drop schema IF EXISTS caseflow_audit CASCADE;"
)
conn.close
rescue ActiveRecord::NoDatabaseError => error
if error.message.include?('database "caseflow_certification_development" does not exist')
puts "Database caseflow_certification_development does not exist; skipping make audit-remove"
else
raise error
end
end

0 comments on commit 3d6b0f3

Please sign in to comment.