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

Caceves/appeals 49715 code climate test #22678

Closed
wants to merge 544 commits into from

Conversation

cacevesva
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?

cacevesva and others added 30 commits April 5, 2024 13:51
Co-authored-by: Jim Foley <james.foley4@va.gov>
* Reset BGS Service

* Add New Sensitivity Check Method

- Create new method in BGSService for checking participant
sensitivity using the BGS gem.

- Update auto assign logic to use new method for checking
sensitivity for user/veteran pairs.

* Fix Lint Error

* Update Sensitivity Check Logic

- Use new method in BGS gem for checking user sensitivity levels.

- Update specs and supporting files accordingly.
* Move Auto Assign Button to Correspondence Queue (#21324)

* Move Auto Assign Button to Correspondence Queue

* Fix Lint Errors

* Reset BGS Service (#21352)

* Use New BGS Gem Sensitivity Check Methods (#21356)

* Reset BGS Service

* Add New Sensitivity Check Method

- Create new method in BGSService for checking participant
sensitivity using the BGS gem.

- Update auto assign logic to use new method for checking
sensitivity for user/veteran pairs.

* Fix Lint Error

* Update Sensitivity Check Logic

- Use new method in BGS gem for checking user sensitivity levels.

- Update specs and supporting files accordingly.

---------

Co-authored-by: cacevesva <109166981+cacevesva@users.noreply.github.com>
Co-authored-by: Christopher Aceves <christopher.aceves@va.gov>
* Initial commit for UI/UX changes

* Added the existing caseflow search properties

* Updated the checkboxes style fix

* Changes for spec file with the latest code changes

* Modified the seed data to check pagination
* Initial commit for UI/UX changes

* Added the existing caseflow search properties

* Updated the checkboxes style fix

* Changes for spec file with the latest code changes

* Modified the seed data to check pagination

* Modified the lint issue change for if condition

* Modified the lint issue change for if condition
…21371)

* create CMP rake task to generate correspondence data in UAT

* added vbms doc types to rake task

* removed useless method
* change eFolderUploadFailedTask Routing

* change condicion for efolder

---------

Co-authored-by: Jim Foley <james.foley4@va.gov>
* creating review package controller, moving methods, editing routing

* Moving review package spec tests to new RP Spec file

* cleaning up code from intake controller spec
- Fix bug causing correspondences not be sorted by VA DOR in
ascending (oldest -> newest) order.

- Update specs to test this scenario.
* Added a join clause of appeal_type = 'Appeal' to the with_original_appeal_and_judge_task method in the distribution_scopes.rb to prevent a sequential table scan which was causing a database timeout with large datasets in the tasks table in production and prod test. (#21386)

Co-authored-by: = <tyler.broyles@va.gov>

* Hotfix/appeals 21696 (#21343)

* fix(create conference): update test for nil appellant email

* fix(create conference): nil appellant email check

* fix(conference job): lint

* fix(create conference): minor

* null

* null

* null

---------

Co-authored-by: Raymond Hughes <131811099+raymond-hughes@users.noreply.github.com>

* Hotfix/appeals 23420 v3 (#21347)

* Add LegacyAppealSearchSerializer to rendering

* Make additional improvements to the Legacy Serializer

* Add MST and PACT to both search serializers respectively

* schema check-in

---------

Co-authored-by: raymond-hughes <raymond.hughes2@va.gov>
Co-authored-by: Raymond Hughes <131811099+raymond-hughes@users.noreply.github.com>

* hotfix/APPEALS-27522 (#21326)

* update erroneous db cleaner syntax and add temp fix to changeset_at_index_for_task method

* update changeset_at_index_for_task method to account for lint error

* fix lint error and code climate error

---------

Co-authored-by: Raymond Hughes <131811099+raymond-hughes@users.noreply.github.com>

* Hotfix/appeals 10993 v2 (#21349)

* added logic for deciding aod on attorney claimant

* added tests

* refactored test to return true when motion is granted

---------

Co-authored-by: Andrew Hadley <hadley_andrew@bah.com>
Co-authored-by: Raymond Hughes <131811099+raymond-hughes@users.noreply.github.com>

* Fixed a bug where some of the Specialty Case Team assign queue settings would take priority over judge assign queue settings for judges who were also members of the specialty case team organization. (#21387)

Co-authored-by: = <tyler.broyles@va.gov>

* Merge hotfix/APPEALS-43956 into release/FY24Q2.7.0 (#21389)

* Added additional logic checks to the attorney task cancel to fix a bug where the cancel attorney task would attempt to update a non existing SpecialtyCaseTeamAssignTask when the appeal matches the sct_appeal? criteria of a 'vha' benefit type.

* Removed feature toggle from the checks since the cancel task should work properly for appeals that were disributed while the feature toggle used in distribution was turned on.

* Added a regression test.

---------

Co-authored-by: = <tyler.broyles@va.gov>

* Merge hotfix/APPEALS-43990 into release/FY24Q2.7.0 (#21388)

* Added a nil value to the inclusion field of the distributed case validation for the sct_appeal boolean that was causing an error when calling the rename_for_redistribution! on a distributed case where the value was not already set to true and false

* Added a regression test for the sct_appeal validation.

---------

Co-authored-by: = <tyler.broyles@va.gov>

* Added a null coalesce to prevent a javascript error caused by a race condition where remaining users could be nil instead of an array if the user is searching for a user at the same time they are adding a user. (#19487)

* APPEALS-43712, APPEALS-43835: Open VeteranRecordRequest and QualityReviewTask are causing distributions to fail (#21354)

* remove Appeal.can_redistribute_appeal? from JudgeAssignTask creation during normal distribution

* update test

* re-add tests for validating each bug scenario

* disable mail task test that is failing due to how it is written

* updating hearing_shift_date to prevent future hearing dates from occuring in local/demo (#21306)

Co-authored-by: Craig Reese <109101548+craigrva@users.noreply.github.com>

* Lint fixes (#21383)

* APPEALS-43423 - AssignedReassignPackageTask remove user limitation (#21400)

* Ryandwill/appeals 43393 (#21339)

* refactored correspondence_controller_util into correspondence_controller_concern

* refactor correspondence_controller

* updated method to be class level and in CorrespondenceTask model

* Updating the class methods from controller to model

* Updated the correspondence_task.rb

* Update intake endpoint with custom serialization and move logic to models

* update QueueApp with new props

* remove controller passed props from redux

* update frontend components for correspondence objects new data shape

* Update test for controller changes

* update test for new controller changes

* update test for controller changes

* fix typo in error msg and related tests

* remove unused argument

* remove unneeded prop validation

* move task update logic and banner presentation to correspondence tasks controller

* move team action to queue controller

* rubocop fix

* remove review package methods to prepare for feature merge

* clean up review package veteran update

* fix test to follow assertion

* update spec for new pagination requirements

* fix typo

* refactor reassign/remove package modals for RP page

* fix test setup to create RemovePackageTask properly

* fix test selector

* fix test - quotation marks and hyphen character in string

* fix style issues

* rspec fixes

* update rp controller inbound ops team check

* remove pry

* removed leftover binding pry

* remove pry

* remove previously deleted code

* fix flaky test

* fix tests

---------

Co-authored-by: Ryan Marshall <rnmarshall1993@gmail.com>
Co-authored-by: divyadasari-va <divya.dasari@va.gov>
Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>

* Move Correspondence ART CSS Styling Into a Single Stylesheet- Queue - APPEALS-43392 (#21384)

* WIP

* All styling has meen moved to scss

* Small fixes

* fixed inbound ops team being listed in queuetable dropdown (#21405)

* fixed inbound ops team being listed in queuetable dropdown

* refactored isMailTeamAffiliated

* removed commented out code

---------

Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>
Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>

* Reassign Correspondence Allows Reassignment over 60 Limit (#21403)

* Reassign Correspondence Allows Reassignment over 60 Limit

* Reassign Correspondence Allows Reassignment over 60 Limit

* added limit check to banner message and resolve linting error with safety operator

* remove file app/models/concerns/correspondence_controller_util.rb

---------

Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>

* Kamalam7/appeals 35469 (#21407)

* Return to queue from the Intake form

* specs for Return to queue from Intake form

* Resolved merge conflicts for Return to queue Intake form

* Lint fix in Correspondence intake file

---------

Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>

* Wmedders21/appeals 44301 (#21413)

* correspondence controller specs live in spec/requests

* Remove unused veteran endpoint

* Add request tests for user access and feature flag

* add tests for review package controller

* remove unnecessary line

* refactor test for simplecov coverage

* remove unneeded test

* add intake spec

* add controller tests

* add erroneously removed method

* Fix rubocop style

* fix selector in flaky test

* add error class to rescue

---------

Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>

* Justin/appeals 43606 (#21399)

* lining up misaligned brackets

* CorrespondencePdfFooter inline styles removed

* removing unused class and styling

* CmpDocuments.jsx styles into a stylesheet

* CorrespondenceReviewPackage.jsx styles into a stylesheet

* ReviewForm.jsx WIP

* moving css out of ReviewPackageCaseTitle

* ReviewForm.jsx styles into a stylesheet

* scss fix

* CorrespondencePdfToolBar.jsx  styles into a stylesheet

* ReviewPackageData file scss

* removing excess styling to keep textarea at application default sizing

* updated test on intake spec

* cleaned up old binding pry

---------

Co-authored-by: Dev-KRedd <khalin.redding@va.gov>
Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>
Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>

* Add unit tests (#21421)

* added completed_by_date

* APPEALS-44300 - Prior Mail test

* created approve unit test on ReassignPackageTask model.

* added tests

* added remove package tasks approve and reject methods

* Reassign Correspondence Allows Reassignment over 60 Limit (#21403)

* Reassign Correspondence Allows Reassignment over 60 Limit

* Reassign Correspondence Allows Reassignment over 60 Limit

* added limit check to banner message and resolve linting error with safety operator

* remove file app/models/concerns/correspondence_controller_util.rb

---------

Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>

* Kamalam7/appeals 35469 (#21407)

* Return to queue from the Intake form

* specs for Return to queue from Intake form

* Resolved merge conflicts for Return to queue Intake form

* Lint fix in Correspondence intake file

---------

Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>

* Wmedders21/appeals 44301 (#21413)

* correspondence controller specs live in spec/requests

* Remove unused veteran endpoint

* Add request tests for user access and feature flag

* add tests for review package controller

* remove unnecessary line

* refactor test for simplecov coverage

* remove unneeded test

* add intake spec

* add controller tests

* add erroneously removed method

* Fix rubocop style

* fix selector in flaky test

* add error class to rescue

---------

Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>

---------

Co-authored-by: KiMauVA <Ki.Mau@va.gov>
Co-authored-by: piedram <110848569+piedram@users.noreply.github.com>
Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>
Co-authored-by: Kamala Madamanchi <110078646+kamala-07@users.noreply.github.com>
Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>
Co-authored-by: Will Medders <93014155+wmedders21@users.noreply.github.com>

---------

Co-authored-by: Robert Travis Pierce <robert@roberttravispierce.com>
Co-authored-by: = <tyler.broyles@va.gov>
Co-authored-by: Christian Cain <149622375+christian-cain-bah@users.noreply.github.com>
Co-authored-by: Raymond Hughes <131811099+raymond-hughes@users.noreply.github.com>
Co-authored-by: Aiman Kayad <Akaya005@fiu.edu>
Co-authored-by: raymond-hughes <raymond.hughes2@va.gov>
Co-authored-by: Dani Coleman <60626984+dcoleman21@users.noreply.github.com>
Co-authored-by: Drew Hadley <50673809+VandelayUtd@users.noreply.github.com>
Co-authored-by: Andrew Hadley <hadley_andrew@bah.com>
Co-authored-by: Tyler Broyles <109369527+TylerBroyles@users.noreply.github.com>
Co-authored-by: Craig Reese <109101548+craigrva@users.noreply.github.com>
Co-authored-by: Isaiah Saucedo <irsaucedo5@gmail.com>
Co-authored-by: divyadasari-va <135847343+divyadasari-va@users.noreply.github.com>
Co-authored-by: Ki Mau <ki.mau@va.gov>
Co-authored-by: Will Medders <93014155+wmedders21@users.noreply.github.com>
Co-authored-by: Ryan Marshall <rnmarshall1993@gmail.com>
Co-authored-by: divyadasari-va <divya.dasari@va.gov>
Co-authored-by: Dev-KRedd <134650238+Dev-KRedd@users.noreply.github.com>
Co-authored-by: Rnmarshall93 <110805785+Rnmarshall93@users.noreply.github.com>
Co-authored-by: piedram <110848569+piedram@users.noreply.github.com>
Co-authored-by: Kamala Madamanchi <110078646+kamala-07@users.noreply.github.com>
Co-authored-by: sulak-j <95875751+sulak-j@users.noreply.github.com>
Co-authored-by: Dev-KRedd <khalin.redding@va.gov>
* consolidated backend checks to use inbound_ops_team_superuser over mail_superuser

* updated superuser namespace in the frontend
* cleaned up magic string usage

* updated cancel routing for superusers

* fixed linting issues

* added rerouting for users that cannot access a specific intake

* updated Review Package task to be the same user that was assigned the Intake

* resolved linting issues

* updated inbound ops team superuser check

* refactored intake controller test

* refactored reassign package task specs and reassignment on cancel

* refactored task specs to be more DRY

* added intake task fix to intake_form_spec

* cleaned up test failures related to intake task within intake.

* refactored related correspondence spec tests

* updated test to click correct section

* updated failing snapshots

* fixed typo on prop validations
* added migrations to refactor correspondence intake relationship to task instead of user/correspondence

* updated model relations and controller check for an open intake

* updated specs to reflect code changes.

* removed leftover pry
* draft pr

* Completing AC for ticketing for styling and error portion of page. Now doing feature test

* added ability for user to search by css id

* added feature tests for using search bar

* reverted changes in package.json

* removed added file

* removed linting error

---------

Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>
Co-authored-by: HunJerBAH <99915461+HunJerBAH@users.noreply.github.com>
divyadasari-va and others added 20 commits August 27, 2024 11:02
* WIP

* cancel_corrresponence_task WIP

* Modal Working

* Modal WIP

* modal WIP

* WIP routing

* WIP working routes can cancel function

* WIP working banner

* Redux fix WIP

* WIP

* Spec test created and passing

* Passing jest test

* created cancel action for details redux store

* created action to remove task from redux store on cancel

* Fixing rubocop tests

* Fixed errors

* Code Climate update

* Adressing comments

* Addressing Comments

* Switch Record Status + Code Clean Up

* Sucess & Error banner updated

* Code climate WIP

* Fixing failing tests

* Resolving last code climate issue

* Remove comma

---------

Co-authored-by: Christopher Aceves <christopher.aceves@va.gov>
Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>
…2560)

* WIP

* cancel_corrresponence_task WIP

* Modal Working

* Modal WIP

* modal WIP

* WIP routing

* WIP working routes can cancel function

* WIP working banner

* Redux fix WIP

* WIP

* Spec test created and passing

* APPEALS-49727 - Complete Task Modal Work

* APPEALS-49727 - Updates

* APPEALS-49727 - Working Complete Action

* APPEALS-49727 - Banner Updates

* APPEALS-49727 - Update Completed Tasks

* APPEALS -49727 - Functionality completed

* APPEALS-49727 Testing updates, Linting Cleanup, Test Data

* APPEALS - 49727 -Testing updates, Linting Cleanup, Test Data

* Linting

* APPEALS-49727 - Lint updates

* Updated Optionality for modal - Submit on empty text

* Removed unused import

* APPEALS-49727 - Removed unneeded task filters

---------

Co-authored-by: Dev-KRedd <khalin.redding@va.gov>
Co-authored-by: Christopher Aceves <christopher.aceves@va.gov>
* WIP

* cancel_corrresponence_task WIP

* Modal Working

* Modal WIP

* modal WIP

* WIP routing

* WIP working routes can cancel function

* WIP working banner

* Redux fix WIP

* #49703 - initial commit

* #49703 - added CorrespondenceChangeTaskTypeModal

* WIP

* #49703#49828 - Task type dropdown options

* #49703 #49816 - submit button behaviour

* Spec test created and passing

* test

* Passing jest test

* created cancel action for details redux store

* created action to remove task from redux store on cancel

* Fixing rubocop tests

* Fixed errors

* #49703 #54132 - success banner action

* #49703 - lint

* #49703, #55639 - update redux store with type and instructions

* #49703, #55639 - update redux store with type and instructions

* #49703, #49705 - Update backend tests

* #49703, #49705 - Update backend tests

* #49703, #54132 - Update error warning banner

* revert changes

* #49703, #49704 - Update frontend tests

* #49703 - lint

* #49703 - lint

* #49703 - addressing a lint issue

---------

Co-authored-by: Dev-KRedd <khalin.redding@va.gov>
Co-authored-by: Christopher Aceves <christopher.aceves@va.gov>
Co-authored-by: HunJerBAH <Jeremy.Hunton@va.gov>
Co-authored-by: cacevesva <109166981+cacevesva@users.noreply.github.com>
* Cancel task text

* Kicking off tests

* Changing this back
Copy link

codeclimate bot commented Aug 30, 2024

Code Climate has analyzed commit 198e27a and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

@cacevesva
Copy link
Contributor Author

closed just testing code climate

@cacevesva cacevesva closed this Aug 30, 2024
@cacevesva cacevesva deleted the caceves/APPEALS-49715-code-climate-test branch August 30, 2024 20:56
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.