Project

General

Profile

Feature #18691

Add as_deprecation_tracker to prevent use of deprecated features

Added by Dominic Cleal over 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

The as_deprecation_tracker gem is designed to monitor ActiveSupport deprecation calls during tests and prevent new code triggering deprecation warnings by maintaining a whitelist. This will be important when upgrading Rails so regressions aren't introduced.

The whitelist is similar to the idea of a RuboCop TODO file where deprecation warnings that are known to be triggered by the application can be listed, keyed by the deprecation warning message. This can also be restricted to certain files, so known deprecations can be permitted in existing code while not permitting the deprecation to be added in another file. New deprecation warnings then raise exceptions in tests.

Some leeway needs to be given to plugins to allow their code to call deprecated code in both Rails and Foreman unless they specify their own whitelist.

Associated revisions

Revision 0fd467c8 (diff)
Added by Dominic Cleal over 4 years ago

fixes #18691 - add as_deprecation_tracker to test environment

Causes test failures if any new deprecation warnings are triggered by
changes in Foreman. Plugin code is automatically whitelisted unless it
supplies its own ASDT whitelist configuration, so developers can opt-in.

Warnings are now hidden in production as they're only relevant in
development or test environments.

History

#1 Updated by The Foreman Bot over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4340 added

#2 Updated by Dominic Cleal over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 209

Also available in: Atom PDF