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

aedara/APPEALS-27848 Fix Deprecation Warning: The success? predicate is deprecated and will be removed in Rails 6.0 #19177

Closed
wants to merge 6 commits into from

Conversation

AnandEdara
Copy link
Contributor

@AnandEdara AnandEdara commented Aug 14, 2023

Resolves APPEALS-27848

Description

Background

Deprecation Warning

DEPRECATION WARNING: The success? predicate is deprecated and will be removed in Rails 6.0. Please use successful? as provided by Rack::Response::Helpers.

Deprecation Horizon: Rails 6.0

References

See Rails commit where this deprecation was removed. It appears that only test code is affected:

Remove deprecated methods in ActionDispatch::TestResponse
#success?, missing? and error? were deprecated in Rails 5.2 in favor of #successful?, not_found? and server_error?.

Acceptance Criteria

  • Code compiles correctly

Testing Plan

  1. Go to Jira Issue/Test Plan Link or list them below

Local Development Environment

Allowed Deprecation Warning does NOT raise exception

  • From local development Rails console, manually issue a test deprecation warning
ActiveSupport::Deprecation.warn("whatever")
  • Confirm that an exception is NOT raised

Disallowed Deprecation Warning raises exception

  • From local development Rails console, manually issue the deprecation warning
ActiveSupport::Deprecation.warn("The success? predicate is deprecated and will be removed in Rails 6.0")
  • Confirm that exception DisallowedDeprecationError is raised

CI / Test Environment

Deprecation Warning is no longer emitted

  • Confirm that all relevant specs pass:
    • spec/requests/health_checks_spec.rb

UAT

  • From the caseflow UAT Rails console, manually issue the deprecation warning
ActiveSupport::Deprecation.warn("The success? predicate is deprecated and will be removed in Rails 6.0")
  • Check Sentry for Caseflow UAT and confirm that an issue for DEPRECATION WARNING: The success? predicate is deprecated and will be removed in Rails 6.0 [...] was created
  • Check Sentry for Caseflow UAT and confirm that an issue for exception DisallowedDeprecationError was NOT created
  • Check the DSVA Slack channel #appeals-deprecation-alerts and confirm that a new alert was created for DEPRECATION WARNING: The success? predicate is deprecated and will be removed in Rails 6.0 [...]

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 Aug 14, 2023

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

View more on Code Climate.

jcroteau

This comment was marked as outdated.

@jcroteau

This comment was marked as outdated.

@jcroteau

This comment was marked as resolved.

 Merging recent changes from master branch in to APPEALS-27848 branch
Adding fixed deprecation to the array RAILS_5_2_FIXED_DEPRECATION_WARNING_REGEXES
jcroteau

This comment was marked as resolved.

@jcroteau

This comment was marked as resolved.

@jcroteau jcroteau self-requested a review September 7, 2023 17:40
Copy link
Contributor

@jcroteau jcroteau left a comment

Choose a reason for hiding this comment

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

🎈

@jcroteau jcroteau mentioned this pull request Oct 11, 2023
@jcroteau jcroteau changed the title aedara/APPEALS-27848 Fix Deprecation Warning: The success? predicate is deprecated and will be removed in Rails 6.0 aedara/APPEALS-27848 Fix Deprecation Warning: The success? predicate is deprecated and will be removed in Rails 6.0 Oct 11, 2023
@jcroteau jcroteau mentioned this pull request Oct 12, 2023
@sbashamoni sbashamoni closed this Feb 15, 2024
@ThorntonMatthew ThorntonMatthew deleted the aedara/APPEALS-27848 branch August 20, 2024 12:46
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.

3 participants