-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PBP 94672 Pension and Burial ZSF manual remediation script (#18829)
- Loading branch information
1 parent
736f72f
commit beda804
Showing
30 changed files
with
610 additions
and
14 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
documentation/adr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# See https://help.github.com/articles/ignoring-files for more about ignoring files. | ||
# | ||
# 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' | ||
|
||
# Ignore bundler config. | ||
.bundle | ||
.envrc | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
!/log/.keep | ||
/tmp/* | ||
!/tmp/.keep | ||
|
||
# Ignore generated directories | ||
/coverage | ||
/reports | ||
|
||
# ignore yardoc generation | ||
.yardoc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Disable autocomplete in deployed environments | ||
# to help prevent running unintended commands | ||
if ENV['RAILS_ENV'] == 'production' | ||
IRB.conf[:USE_AUTOCOMPLETE] = false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--color | ||
--require spec_helper | ||
--format progress | ||
<% if ENV['CI'] %> | ||
--format RspecJunitFormatter | ||
--out log/rspec.xml | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
# Declare your gem's dependencies in simple_forms_api.gemspec. | ||
# Bundler will treat runtime dependencies like base dependencies, and | ||
# development dependencies will be added by default to the :development group. | ||
gemspec | ||
|
||
# Declare any dependencies that are still in development here instead of in | ||
# your gemspec. These might include edge Rails or gems from your path or | ||
# Git. Remember to move these dependencies to your gemspec before releasing | ||
# your gem to rubygems.org. | ||
|
||
# To use a debugger | ||
# gem 'byebug', group: [:development, :test] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Burials | ||
|
||
Pension & Burial Program (PBP) | ||
|
||
Engineering related documentation can be found under [/documentation/](./documentation/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
begin | ||
require 'bundler/setup' | ||
rescue LoadError | ||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | ||
end | ||
|
||
require 'bundler/gem_tasks' | ||
|
||
unless Rails.env.production? | ||
require 'rspec/core/rake_task' | ||
task(spec: :environment).clear | ||
RSpec::Core::RakeTask.new(:spec) do |t| | ||
t.pattern = Dir.glob(['spec/**/*_spec.rb']) | ||
t.verbose = false | ||
end | ||
end |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# This command will automatically be run when you run "rails" with Rails gems | ||
# installed from the root of your application. | ||
|
||
ENGINE_ROOT = File.expand_path('..', __dir__) | ||
ENGINE_PATH = File.expand_path('../lib/burials/engine', __dir__) | ||
APP_PATH = File.expand_path('../test/dummy/config/application', __dir__) | ||
|
||
# Set up gems listed in the Gemfile. | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | ||
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) | ||
|
||
require 'rails/all' | ||
require 'rails/engine/commands' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.push File.expand_path('lib', __dir__) | ||
|
||
require 'burials/version' | ||
|
||
# Describe your gem and declare its dependencies: | ||
Gem::Specification.new do |spec| | ||
spec.name = 'burials' | ||
spec.version = Burials::VERSION | ||
spec.authors = ['Benefits Burials'] | ||
spec.email = [''] | ||
spec.homepage = 'https://api.va.gov' | ||
spec.summary = 'An api.va.gov module' | ||
spec.description = 'This module was auto-generated please update this description' | ||
spec.license = 'CC0-1.0' | ||
|
||
spec.files = Dir['{app,config,db,lib}/**/*', 'Rakefile', 'README.md'] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
Burials::Engine.routes.draw do | ||
namespace :v0, defaults: { format: :json } do | ||
resources :claims, only: %i[create show] | ||
end | ||
end |
41 changes: 41 additions & 0 deletions
41
modules/burials/documentation/adr/0001-record-architecture-decisions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 1. Record architecture decisions | ||
|
||
Date: 2024-06-14 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
We need to record the architectural decisions made on this project. | ||
|
||
## Decision Documentation | ||
|
||
We will use Architecture Decision Records, as [described by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions). | ||
|
||
### Using adr-tools | ||
|
||
This repository makes use of [adr-tools](https://github.com/npryce/adr-tools/tree/master) to record architectural decisions as part of the code base. | ||
|
||
There are two uses for this, recording a new decision and superseding an existing decision. | ||
|
||
#### Recording a new decision | ||
|
||
To create a new decision use the adr new command: | ||
|
||
```bash | ||
adr new <decision-title> | ||
``` | ||
|
||
#### Superseding an existing decision | ||
|
||
To overwrite an existing decision you can add the -s flag followed by which is getting overwritten. In this example we are overwriting decision 9 with an updated decision: | ||
|
||
```bash | ||
adr new -s 9 <decision-title> | ||
``` | ||
|
||
## Consequences | ||
|
||
See Michael Nygard's article, linked above. For a lightweight ADR toolset, see Nat Pryce's [adr-tools](https://github.com/npryce/adr-tools). |
22 changes: 22 additions & 0 deletions
22
modules/burials/documentation/adr/0002-use-modules-folder-for-burials-code.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 2. Move burials application to modules folder | ||
|
||
Date: 2024-10-10 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
The vets-api is a large monorepo with many overlapping forms. The tangle of code between applications has made it difficult for teams to iterate without impacting others. | ||
|
||
## Decision | ||
|
||
In an effort to isolate code, the PBP team has decided to take advantage of [Ruby on Rails Engines](https://guides.rubyonrails.org/engines.html) to create a separate application for the 21P-530EZ form (burials). Engines can be isolated from their host applications which will allow for us to: | ||
|
||
- Isolate the code pertinent to Burials | ||
- Work toward running a CI/CD that can be applied only to Burial code | ||
|
||
## Consequences | ||
|
||
The result of this change will allow for the PBP team to more quickly iterate and innovate on future changes. There is a risk that isolating burial code will result in a lot of duplication of code. The longer term goal would be to move common benefits logic into a module of its own as is being done for burial code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Burials Documentation | ||
|
||
Pension & Burial Program (PBP) | ||
|
||
## ADR | ||
|
||
The PBP team uses [ADR Tools](https://github.com/npryce/adr-tools/tree/master) to document important engineering related decisions for the vets-api repo. The goal is to capture the technical decisions our group makes so that anyone new to our team or following behind will be able to understand the reasons for the decisions. | ||
|
||
Additional architectural decisions made by other teams can be found here: | ||
https://github.com/department-of-veterans-affairs/va.gov-team-sensitive/tree/master/teams/benefits/architectural-decision-records | ||
|
||
| Decision | | ||
| ----------------------------------------------------------------------------------------------------------- | | ||
| [Use ADR to document important engineering decisions](./adr/0001-record-architecture-decisions.md) | | ||
| [Move the burials specific code to the modules folder](./adr/0002-use-modules-folder-for-burials-code.md) | | ||
| | | ||
|
||
## Folder structure | ||
|
||
For more information on the Ruby on Rails directory structure, please refer to https://github.com/jwipeout/rails-directory-structure-guide | ||
|
||
The current folder structure generally follows the default directory structure that **Ruby on Rails** comes with. | ||
|
||
##### App Folder | ||
|
||
- At a high level, within the app folder, there are [controllers](https://guides.rubyonrails.org/action_controller_overview.html) and [models](https://guides.rubyonrails.org/active_record_basics.html). Ruby on Rails uses a MVC (model, view, controller) architecture pattern. There is little historical context or documentation on the choice of V0 or V1 for the controllers. | ||
- There are also a [sidekiq](https://github.com/sidekiq/sidekiq) and [swagger](https://swagger.io/) folders. | ||
|
||
##### DB Folder | ||
|
||
- The db folder contains the schema and migrations used for the application. | ||
|
||
##### Lib Folder | ||
|
||
- The lib folder is intended for common code or code that can be reused by other teams. It is also where the code for interfacing with external APIs lives. | ||
|
||
##### Config Folder | ||
|
||
- The config folder is where most of the configuration files for the main rails app, plugins, etc. are housed | ||
|
||
##### Spec Folder | ||
|
||
- Contains the tests for vets-api | ||
|
||
## Team | ||
|
||
| Name | Email Address | | ||
| ------------ | ------------------------- | | ||
| Matt Knight | [email protected] | | ||
| Wayne Weibel | [email protected] | | ||
| Tai Wilkin | [email protected] | | ||
| Todd Rizzolo | [email protected] | | ||
| Daniel Lim | [email protected] | | ||
| Bryan Alexander | [email protected] | | ||
|
||
## Troubleshooting | ||
|
||
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'burials/engine' | ||
|
||
## | ||
# Burial 21P-530EZ Module | ||
# | ||
module Burials | ||
# API Version 0 | ||
module V0 | ||
end | ||
|
||
# ZeroSilentFailures | ||
# @see lib/zero_silent_failures | ||
module ZeroSilentFailures | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
module Burials | ||
# @see https://api.rubyonrails.org/classes/Rails/Engine.html | ||
class Engine < ::Rails::Engine | ||
isolate_namespace Burials | ||
config.generators.api_only = true | ||
|
||
initializer 'burials.factories', after: 'factory_bot.set_factory_paths' do | ||
FactoryBot.definition_file_paths << File.expand_path('../../spec/factories', __dir__) if defined?(FactoryBot) | ||
end | ||
|
||
initializer 'burials.zero_silent_failures' do |app| | ||
app.config.to_prepare do | ||
require_all "#{__dir__}/../zero_silent_failures" | ||
end | ||
end | ||
|
||
# TODO: move PDFFill library to this module | ||
# initializer 'burials.register_form' do |app| | ||
# app.config.to_prepare do | ||
# require 'pdf_fill/filler' | ||
# require_relative '../pdf_fill/va21p530v2' | ||
|
||
# # Register our Burial Pdf Fill form | ||
# ::PdfFill::Filler.register_form(Burials::PdfFill::Va21p530v2::FORM_ID, Burials::PdfFill::Va21p530v2) | ||
# end | ||
# end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Burials | ||
## | ||
# The module path | ||
# | ||
MODULE_PATH = 'modules/burials' | ||
|
||
## | ||
# The module version | ||
# | ||
VERSION = '0.1.0' | ||
end |
Oops, something went wrong.