Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix audit remove script and modify GHA workflow #19092

Merged
merged 5 commits into from
Aug 2, 2023

Conversation

craigrva
Copy link
Contributor

@craigrva craigrva commented Jul 31, 2023

Resolves APPEALS-26130

Modifies our Github Actions config as described below

Excludes 'db/scripts' in .codeclimate.yml

Description

Add a rescue block to script remove_caseflow_audit_schema.rb to prevent it from erroring and causing failures when attempting to run make reset after initially creating docker containers/volumes

Modify .github/workflow.yml caseflow_rspec_job to:

  • Set yarn's cache directory to a specified value, so that path resolves correctly with later steps
  • Changed the paths cached to include the yarn cache (set above) and the node_modules
  • Modified the cache's key value to be based on the yarn.lock file so that changing dependencies will generate a new cache

These changes will properly cache the frontend dependencies in a similar way to how we cache the backend dependencies for CI runs. It will save a significant amount of time each run and help minimize the chance that problems with external dependency repositories can cause our builds to fail.

Acceptance Criteria

  • Code compiles correctly
  • Rspec test nodes build without error and run tests
  • make reset (or similar commands) can be run without the database caseflow_certification_development in the postgres server

Testing Plan

WARNING: This test plan will drop your database and then re-seed it

  1. Run bundle exec rake db:drop
  2. Run make audit-remove and verify that you see the console output "Database caseflow_certification_development does not exist; skipping make audit-remove"
  3. Run make reset
  4. Verify that make reset runs without erroring due to ActiveRecord::NoDatabaseError

Additional post-merge instructions

Manually trigger the Rspec Jest Lint workflow in Github Actions for the master branch. This should generate the master branch yarn cache

Best practices

Code Documentation Updates

  • Add or update code comments at the top of the class, module, and/or component.

Code Climate

Your code does not add any new code climate offenses? If so why?

  • No new code climate issues added

Monitoring, Logging, Auditing, Error, and Exception Handling Checklist

Error Handling

  • Are errors being caught and handled gracefully?
  • Are appropriate error messages being displayed to users?
  • Are critical errors being reported to an error tracking system (e.g., Sentry, ELK)?
  • Are unhandled exceptions being caught at the application level ?

@codeclimate
Copy link

codeclimate bot commented Jul 31, 2023

Code Climate has analyzed commit a5ae986 and detected 0 issues on this pull request.

View more on Code Climate.

@craigrva craigrva changed the title add exception handling to audit remove script fix audit remove script and modify GHA workflow Aug 1, 2023
@craigrva craigrva marked this pull request as ready for review August 1, 2023 21:42
@craigrva craigrva merged commit 2ea0fb6 into master Aug 2, 2023
0 of 14 checks passed
@craigrva craigrva deleted the dev-support/APPEALS-26130 branch August 2, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants