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

Feature/appeals 22218 27036 #19292

Merged
merged 50 commits into from
Aug 29, 2023
Merged

Conversation

mikefinneran
Copy link
Contributor

Resolves https://jira.devops.va.gov/browse/APPEALS-22218

Description

  • Add metrics table
  • Add error handling on all REST calls in ApiUtils.js
  • Add metric recording to MetricsService

Acceptance Criteria

  • Code compiles correctly

Testing Plan

  1. Go to #{jira issue 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 (Presentationa) 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?

zurbergram and others added 30 commits June 7, 2023 09:24
* add catch to get document call

* Update documentViewer.js

* generic error handling and custom error handling

* Update ApiUtil.js

* send error logs to backend

* Update Metrics.js

* add uuid to error logging

* add metrics table

* revert

* send metrics to backend

* store metrics in table

* update info for javascript metrics

* cleanup

* add source parameter

* add ability to mark as performance

* add feature toggle

* log_controller unit test and fixes

* Update schema.rb

* Update schema.rb

* Update metric.rb

* more and fix unit tests

* update metrics table for new fields and update ApiUtils error handling

* update Metric.js for usage

* record metrics from MetricsService

* Update documentViewer.js

* Update metrics_service.rb

* metric_service fixes

* fixing issues

* can view metrics on demo

* Update dashboard_controller.rb

* reduce to 7 days, newest first

* Update dashboard_controller.rb

* 1 day at a time

* add indexes
* new frontend metrics setup

* improve loading screen metric

* record metrics for searching within a document

* update feature toggle

* add in feature toggles

* Update show.html.erb
* adds feature toggle

* adds feature toggle to reader pdfpage which renders readertext document id, type and render time

* refactors uuid

* fixes file prop

---------

Co-authored-by: Matt Roth <[email protected]>
)

* APPEALS-23487: Add additional metrics for browser captured error

* Added metricsBrowserError feature toggle

* Added date time and duration metrics
* APPEALS-23475. Record Successhandling in the metrics

* Added successhandling on other HTTP methods and some refactor

* Added feature toggle- metricsLogRestSuccess

* APPEALS-23475. Test case for success handling

* reverting changes

---------

Co-authored-by: SHarshain <[email protected]>
* Update PdfPage.jsx

* Update Metrics.js

* Update PdfPage.jsx
* Added PDFJS page and text getting/storing metrics

* Add toggle feature for PDFJS page and text metrics

* Adjusted metrics and feature toggle naming

* Remove unused props pass

* Revert "Added PDFJS page and text getting/storing metrics"

This reverts commit ac6513e.
* Added browser error feature toggle to all pages

* Revert changes I did not make

* Revert change made in metric model

---------

Co-authored-by: Matt Roth <[email protected]>
* First draft

* ready

* Add meterics capture for PDFJS document loading - Remove dev debugging code

* Remove test code for v2.0 (not in use)

* Revert test code for v2.0

* Restore v2.0 docviewer

* Fix variable issue

* Fix variable type issue

---------

Co-authored-by: Christopher Detlef <[email protected]>
zurbergram and others added 20 commits June 29, 2023 14:51
* enabled_metric?

* update caseflow-commons

* update caseflow-commons

* fix jslint, issues, add feature toggle to retrieving PDF, wrap error and success metrics with feature toggle
* added newrelic ignore helper

* minor tweak

---------

Co-authored-by: SHarshain <[email protected]>
* remove all slack channels other than appeals-job-alerts

* Update slack_service.rb

* Add 508 ARIA label for screen readers in CF Help

* Schema check in

* Update enable_features_dev.rb

* APPEALS-17497: MST & PACT Special issues identification

* optimized participant contentions method to return contentions to cut down on BGS calls

* added feature toggle guard clause for bgs calls for ratings

* hid pact and mst check behind toggles

* added caching to BGS contention call

* updated feature toggles to include current user

* adding logging for BGS contention calls

* added 24 hr caching and commented out toggle for bgs call

* APPEALS-17497: MST & PACT Special issues identification

* optimized participant contentions method to return contentions to cut down on BGS calls

* added feature toggle guard clause for bgs calls for ratings

* hid pact and mst check behind toggles

* added caching to BGS contention call

* updated feature toggles to include current user

* adding logging for BGS contention calls

* added 24 hr caching and commented out toggle for bgs call

* hid blue water and burn pit behind mst/pact toggle

* added toggle for mst on special issues list

* routed judge/attorney decisions to special issues pending on mst pact toggle

* updated back button routing and special issues showing on decisions for ama appeals

* hid mst pact special issues banner behind feature toggles

* HunJerBAH APPEALS-26881: Reject Unknown Attributes in RatingDecisions Hash (#19072)

* added handling for unknown attributes being added into rating decision hash

* updated paren grouping

* Update open_hearing_tasks_without_active_descendants_checker_spec.rb

* allow slack notifications in uat

* Add ro-colocated examples

* Fix ro-colocated request body

* add exception handling to audit remove script

* Change address_line_1 to nullable: true

* Add migration

* Allow audit table entry for address_line_1 to have null val

* test update to yarn dependency cache keys

* Take setup-node for a spin

* Revert "Take setup-node for a spin"

This reverts commit 337ea0a.

* Add a spec

* Fix whitespace

* Remove flipper tables

* unskip test (#19076)

Co-authored-by: Craig Reese <[email protected]>

* hotfix/APPEALS-27124 Updated MailRequestValidator and VbmsDistributionDestination spec for derived destinations

* updated deserialize method to check on rating decision model for attributes in hash

* Add class checks for ro-colocated?

* Craig/test yarn cache (#19096)

modify .github/workflows/workflow.yml

* exclude db/scripts in codeclimate (#19103)

* Revert "APPEALS-17497: MST & PACT Special issues identification"

* Use case

* remove z-index

* add z-index

* Update webdrivers

* Revert "Update webdrivers"

This reverts commit 7cd71cd.

* Test wait

* Reverse test update

* test adding assertion (#19127)

* test adding assertion

* added assertion to more tests

* add concurrency to workflow.yml (#19136)

* add concurrency to workflow.yml

---------

Co-authored-by: Matt Roth <[email protected]>
Co-authored-by: Matt Roth <[email protected]>
Co-authored-by: AimanK <[email protected]>
Co-authored-by: Aiman Kayad <[email protected]>
Co-authored-by: raymond-hughes <[email protected]>
Co-authored-by: youfoundmanesh <[email protected]>
Co-authored-by: HunJerBAH <[email protected]>
Co-authored-by: HunJerBAH <[email protected]>
Co-authored-by: Matthew Thornton <[email protected]>
Co-authored-by: kristeja <[email protected]>
Co-authored-by: kristeja <[email protected]>
Co-authored-by: Craig Reese <[email protected]>
Co-authored-by: Matthew Thornton <[email protected]>
Co-authored-by: Clay Sheppard <[email protected]>
Co-authored-by: Craig Reese <[email protected]>
Co-authored-by: Jeff Marks <[email protected]>
Co-authored-by: Raymond Hughes <[email protected]>
Co-authored-by: SHarshain <[email protected]>
Co-authored-by: Chris-Martine <[email protected]>
Co-authored-by: kshiflett88 <[email protected]>
…port/test-updates

clear user session after each test (#19254)
@mikefinneran mikefinneran merged commit b4a28da into uat/FY23Q4.4.0 Aug 29, 2023
1 of 15 checks passed
@ThorntonMatthew ThorntonMatthew deleted the feature/APPEALS-22218-27036 branch August 20, 2024 12:42
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.

10 participants