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

Eli/APPEALS-28088_APPEALS-28090 (#19726) #20354

Merged
merged 21 commits into from
Dec 27, 2023
Merged

Conversation

mikefinneran
Copy link
Contributor

Resolves Jira Issue Title

Description

Please explain the changes you made here.

Acceptance Criteria

  • Code compiles correctly

Testing Plan

  1. Go to Jira Issue/Test Plan Link or list them below
  • For feature branches merging into master: Was this deployed to UAT?

Frontend

User Facing Changes

  • Screenshots of UI changes added to PR & Original Issue
BEFORE AFTER

Storybook Story

For Frontend (Presentation) Components

  • Add a Storybook file alongside the component file (e.g. create MyComponent.stories.js alongside MyComponent.jsx)
  • Give it a title that reflects the component's location within the overall Caseflow hierarchy
  • Write a separate story (within the same file) for each discrete variation of the component

Backend

Database Changes

Only for Schema Changes

  • Add typical timestamps (created_at, updated_at) for new tables
  • Update column comments; include a "PII" prefix to indicate definite or potential PII data content
  • Have your migration classes inherit from Caseflow::Migration, especially when adding indexes (use add_safe_index) (see Writing DB migrations)
  • Verify that migrate:rollback works as desired (change supported functions)
  • Perform query profiling (eyeball Rails log, check bullet and fasterer output)
  • For queries using raw sql was an explain plan run by System Team
  • Add appropriate indexes (especially for foreign keys, polymorphic columns, unique constraints, and Rails scopes)
  • Run make check-fks; add any missing foreign keys or add to config/initializers/immigrant.rb (see Record associations and Foreign Keys)
  • Add belongs_to for associations to enable the schema diagrams to be automatically updated
  • Document any non-obvious semantics or logic useful for interpreting database data at Caseflow Data Model and Dictionary

Integrations: Adding endpoints for external APIs

  • Check that Caseflow's external API code for the endpoint matches the code in the relevant integration repo
    • Request: Service name, method name, input field names
    • Response: Check expected data structure
    • Check that calls are wrapped in MetricService record block
  • Check that all configuration is coming from ENV variables
    • Listed all new ENV variables in description
    • Worked with or notified System Team that new ENV variables need to be set
  • Update Fakes
  • For feature branches: Was this tested in Caseflow UAT

Best practices

Code Documentation Updates

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

Tests

Test Coverage

Did you include any test coverage for your code? Check below:

  • RSpec
  • Jest
  • Other

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

Monitoring

  • Are performance metrics (e.g., response time, throughput) being tracked?
  • Are key application components monitored (e.g., database, cache, queues)?
  • Is there a system in place for setting up alerts based on performance thresholds?

Logging

  • Are logs being produced at appropriate log levels (debug, info, warn, error, fatal)?
  • Are logs structured (e.g., using log tags) for easier querying and analysis?
  • Are sensitive data (e.g., passwords, tokens) redacted or omitted from logs?
  • Is log retention and rotation configured correctly?
  • Are logs being forwarded to a centralized logging system if needed?

Auditing

  • Are user actions being logged for audit purposes?
  • Are changes to critical data being tracked ?
  • Are logs being securely stored and protected from tampering or exposing protected data?

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 ?

Exception Handling

  • Are custom exceptions defined and used where appropriate?
  • Is exception handling consistent throughout the codebase?
  • Are exceptions logged with relevant context and stack trace information?
  • Are exceptions being grouped and categorized for easier analysis and resolution?

elilogbro and others added 21 commits October 23, 2023 10:09
* seed file for ama endpoint testing, trait added to end_product_establishment factory

* make command for the seed file

* seed file added to seed method, loads on make reset

* added seeds for two other scenarios: request issue has many decision issues, and decision issue has many request issues

* code climate fixes

* code climate fix

* spec file for seeds

* swapped decision issue trait

* decision issue trait to associate in rspec

* formatted parenthesis

* code climate fix

* potential github actions fix

* fixed reliance on the order of creation

* add relations and scopes to RI and DI for VBMS API

* add controller and ama dto service object

* add route to vbms ama

* add ama namespace

* add legacy TODO

* add pagination info

* switch to vet participant_id in route

* add pagination fields

* add jsonapi-serializer gem

* remove scopes

* change to show controller method

* switch to jsonapi-serializer method

* fix cc

* remove extra association

* update dto builder namespace in controller

* update veteran to participant_id

* default to page(1) and add check

* refactor

* add ternary to disallow page(0)

* migration created for nonrating_issue_bgs_id column on request_issues

* legacy_appeals method to check if veteran has appeals in VACOLS

* added legacy_appeals_present query to determine boolean

* removes attributes key and nested metadata from request_issue objects

* spec for veteran_has_appeals_in_vacols? method

* add more attributes to RI serializer

* throw error on veteran not found

* add feature flag

* remove concern

* fix cc

* set up for easier development

* added seeds and spec for vets with legacy appeals in vacols

* added two new attributes to serializer

* fix typo

* remove to_json on request issues

* added direct query to check for vacols cases, updated spec

* test feature flag; remove comment

* add vbms_intake ama controller spec

* change route to singular

* move pagination constant into env variable

* add api veteran controller tests

* reverted legacy appeal method

* fix pagination bug

* add checks for remaining json fields

* add serializer spec

* disable feature flag

* change routes to plural and comment out feature flag from tests

* comment for legacy_appeals method, altered attribute names to be more specific

---------

Co-authored-by: nkirby-va <nicholas.kirby@va.gov>
* APPEALS-33403- created legacy_dto_builder and modified issue.rb to have vbms_attributes

* APPEALS-33403 - got Issue object to use :vbms_attributes within builder, and added routes and spec for serliazerc

* APPEALS-33403- got serlializer working and able to populate a json response for one the vacols_ids within the array.

* APPEALS-33403 - create vbms_legacy_appeal_serializer, and was able to get a reponse on the first vacols_id, json response has both legacy appeal and vacols issue.

* APPEALS-33403- Got Mapper and Serializer to get a response. Modfied JSON Response to get it to look as close the schema we provided.

* APPEALS-33403 - created unit test for vacols_issue_serializer, test pass

* APPEALS-33403- added unit test for issue.vbms_attributes inside the issue model. Test Pass

* Update routes.rb

removed my changes

* APPEALS-33403 - added new method to builder to be more clear about whats happening, changed class name and file structure to match ama, and updated spec class names
* rename route

* add error responses

* add test for no request issues; modify test for missing vet

* add mock for app error

* eli's fix for claimant generation

* add missing field

* attempt feature flag fix

* update feature toggle

* remove jsonapi-serializer

* re-enable feature flags

* refactor api v3 ama issues vet controller spec

* refactor out exceeds paginates per context

* better readability

* add unauthorized tests

* add verbage for readability

* modify 500 response

* move out base controller; move ama issues controller to v4

* finish migration to v4

* fix typo

* change to empty array on no request issues

* add use last page if page param greater than last page

* move to new v3 namespace

* add claimant_participant_id

* add claimant_participant_id to spec

* add api doc for ama issues

* add doc specs for ama issues

* add negative page number handling, implement larger than page size test

* upgrade to openapi 3.0.3

* add pagination info to docs

* remove todo

* add description of class

* update comments

* add comp pension fiduciary to RI filter

* add active?

* add fields to request issue

* add fields to yaml

* fix stray; change to openapi 3.0.3

* switch back to jsonapi-serializer

* patch hlr for just bundle installing jsonapi-serializer

* add request issues per page

* add simple test

* add additional per value specs

* add more per specs

* change upper bound env name

* revert to fastjson

* fix line length

* fix single quote

* fix line length

* fix line length and empty line

* remove stray byebug

* fix some rubocops

* move legacy back from jsonapi

* switch stubbed with genuine error

* seeds to test vet without request issues and non-veteran claimant

* change to per_page

* add more fields on #active? test

* add MetricService

* change to per_page in route

* trigger GA

* adjust total count for comp pen fid

* fix comments

---------

Co-authored-by: Eli Brown <elilogbro@gmail.com>
* APPEALS-28091 initial controller and route setup

* remved refs to request issues

* APPEALS-28091 fixed route typo and started spec

* refactoring route

* saving progress

* saving progress

* DTO builder and rspec updates

* saving rspec progress

* Updated ENV var and rspec test case

* saving changes before header param refactor

* refactored to take header param for VFN

* added additional test cases

* changed route to issues/vacols

* saving changes

* added per_page to veterans controller params and dto_builder

* fixed per_page to remove out of bounds characters

* cleaning up tests

* reverting to FastJson gem

* removing references to ama and old paths

* saving progress of yaml doc

* added yaml doc

* uncommenting toggles

* addressing PR review comments

* added doc to route

* added Metrics Service

* added reek comment for instance vars

* 100% code coverage

* APPEALS-28091 - updated path and class name

* APPEALS-28091 - removed some lint errors

* updated spec to reflect new method

* updated text

---------

Co-authored-by: Jonathan Tsang <tsang_jonathan@bah.com>
Co-authored-by: TuckerRose <tuckerrose@tuckerroses-mbp.lan>
Co-authored-by: Enrilo Ugalde <ugalde_enrilo@bah.com>
Co-authored-by: Eli Brown <elilogbro@gmail.com>
* Added more error catching for invalid VFNs

* added logging & switched rescue_from order

---------

Co-authored-by: Jonathan Tsang <tsang_jonathan@bah.com>
* spec file updates

* fix failing GA test
#20070)

* Made code climates fixes, added claim_id to serializer and fixed nomethoderror 500 error

* updated nomethod error to standarderror and fixed more linting issues

---------

Co-authored-by: TuckerRose <tuckerrose@tuckerroses-mbp.lan>
@mikefinneran mikefinneran merged commit 5e5cfe0 into uat/FY24Q1.6.3 Dec 27, 2023
10 of 14 checks passed
@mikefinneran mikefinneran deleted the uat/APPEALS-28087 branch December 27, 2023 20:19
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.

7 participants