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

remove featuretoggle useAMAActivationDate #19542

Closed
wants to merge 14 commits into from

Conversation

pamatyatake2
Copy link
Contributor

@pamatyatake2 pamatyatake2 commented Sep 21, 2023

Resolves Appeals-4974

Description

Removes - use AmaActivationDate Feature toggle.

Acceptance Criteria

  • Code compiles correctly
  • All rspec test should pass
  • if receipt date is old than 2019-02-19 then it should prompt error message during intake process.

Testing Plan

  1. Login as BVAIntake user
  2. Try intaking 10182 form
  3. set value of Receipt date to be 01/01/2019
  4. Validation error saying -" Receipt date cannot be prior to 02/19/2019" should be visible. when you click on 'Continue to next step'
  5. try step 1 to 4 for HRL and SC
  6. try changing the claimant to 'Claimant not listed' and this error should still be present.
  • 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?

@codeclimate
Copy link

codeclimate bot commented Sep 21, 2023

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

View more on Code Climate.

@pamatyatake2 pamatyatake2 marked this pull request as ready for review September 22, 2023 13:26
@pamatyatake2 pamatyatake2 added ART: VHA Team: Titan A development team for the VHA business line Stakeholder: VHA Functionality associated with Veterans Health Administration workflows/feature requests labels Sep 22, 2023
Copy link
Contributor

@TylerBroyles TylerBroyles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright I'm done with the first pass. I left some comments. I noticed that there are still several reducers and other spots in redux where the feature toggle is still being referenced. The only one that I am unsure about is the form context and the yup validation for the ramp refiling, but I think all the others can be removed like you already have done. Let me know what you think.

@@ -95,7 +95,7 @@ def asyncable_user
end

def ama_activation_date
if intake && FeatureToggle.enabled?(:use_ama_activation_date, user: intake.user)
if intake
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this else block ever be reached now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, i do not think so

@@ -350,7 +350,7 @@ export const formatIssuesBySection = (issues) => {
);
};

export const formatAddedIssues = (issues = [], useAmaActivationDate = false) => {
export const formatAddedIssues = (issues = [], useAmaActivationDate = true) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only see one place where this is being used and it's based on the feature toggle so my guess is that we can just remove the useAmaActivationDate param.

If it's always true then that means the next line can be

const amaActivationDate = new Date(DATES.AMA_ACTIVATION);

fill_in "What is the Receipt Date of this form?", with: "01/01/2019"
within_fieldset("Is the claimant someone other than the Veteran?") do
find("label", text: "Yes", match: :prefer_exact).click
end
find("label", text: "Claimant not listed", match: :prefer_exact).click
find("label", text: "Bob Vance", match: :prefer_exact).click
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this have to be updated for your changes? It's not apparent to me at first glance since this test used to enable the feature toggle so there should be no behavior change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was failing before for some validation reason. after i fixed that validation i forgot to revert this change.

@@ -44,8 +44,8 @@
end

step "EPs use the updated Veteran name" do
Fakes::BGSService.get_veteran_record(veteran.file_number)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to fix a different test failure or was this related to the feature toggle somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, test failure. for some reason it was feature toggle removing was causing this step to fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't see why this would be happening unless it was related to the Timecop.freeze(post_ramp_start_date) moving from 2017 to the ama activiation date of 2019.

@@ -60,7 +60,7 @@
context "processed in Caseflow" do
let(:benefit_type) { "education" }

it { is_expected.to be_truthy }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the supplemental claim spec fail now because of the date change. I think instead of switching these two values it would be better to adjust the timecop value to be after the 2019 ama activation date.
Something like this

Timecop.freeze(Time.utc(2020, 4, 24, 12, 0, 0))

and later down on like 206 something like that

let(:receipt_date) { Time.new("2021", "03", "01").utc }

If you wanted to capture both states. You could also create a new context block with timecop set to the original date and only check those two fields to verify that they are false/falsey. I think the intent of these two test files are to simulate valid claim reviews.

Copy link
Contributor

@TylerBroyles TylerBroyles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. There's a couple of code climate issues left to fix, but that's about all I notice.

else
Constants::DATES["AMA_ACTIVATION_TEST"].to_date
end
Constants::DATES["AMA_ACTIVATION"].to_date
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing a code climate issue now since it doesn't use any instance data. You could remove the method and just use Constants::DATES["AMA_ACTIVATION"].to_date in the two places I see this method being used. As far as I can tell it is only being referenced once in request issues and once in this file. There's also another definition that is exactly the same in the base_contestable_issues_controller file.

You could also pull it out into a module and include it in the decision review and base contestable issues controller files.

@@ -44,8 +44,8 @@
end

step "EPs use the updated Veteran name" do
Fakes::BGSService.get_veteran_record(veteran.file_number)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't see why this would be happening unless it was related to the Timecop.freeze(post_ramp_start_date) moving from 2017 to the ama activiation date of 2019.

@pamatyatake2
Copy link
Contributor Author

Closing this out since the feature toggle is not always being used and ticket is blocked

@ThorntonMatthew ThorntonMatthew deleted the pamatya/APPEALS-4974-useAmaActivationDate branch September 10, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ART: VHA Stakeholder: VHA Functionality associated with Veterans Health Administration workflows/feature requests Team: Titan A development team for the VHA business line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants