Skip to content

[Deprecation] Legacy Timeout Option Aliases in Facter::Core::Execution.execute #90

@silug

Description

@silug

Summary

Facter::Core::Execution.execute still accepts legacy timeout option aliases (time_limit, limit) even though only timeout is treated as valid. This is a soft deprecation signal inferred from behavior and tests.

Why This Is Soft / Inferred

There is no explicit @deprecated annotation or explicit deprecation warning string for time_limit / limit. However:

  • implementation still maps legacy keys to timeout behavior, and
  • tests label this path as when passing deprecated arguments.

Evidence

  • lib/facter/custom_facts/core/execution/base.rb:117 maps timeout as:
    • options[:timeout] || options[:time_limit] || options[:limit]
  • lib/facter/custom_facts/core/execution/base.rb:122 warns unknown keys but does not reject legacy aliases.
  • spec/custom_facts/core/execution_spec.rb:69 explicitly uses context name when passing deprecated arguments.
  • spec/custom_facts/core/execution_spec.rb:70 exercises aliases %i[time_limit limit].

Proposed Plan

  • Next major release:
    • Keep time_limit and limit behavior for compatibility.
    • Add explicit deprecation warning when either alias is used.
    • Add release-note and docs migration guidance to use timeout.
  • Subsequent major release:
    • Remove support for time_limit and limit aliases.
    • Support only timeout.

Compatibility / Risk

  • Low risk in next major release (warning only).
  • Medium risk in removal release for custom facts/plugins still using aliases.

Implementation Notes

  • In extract_options, detect alias usage before timeout calculation and log a dedicated deprecation warning.
  • Keep existing unknown-key warning behavior consistent.
  • Add tests for deprecation warning emission and one-time warning semantics if desired.

Acceptance Criteria

  • Next major release emits explicit deprecation warning for time_limit/limit usage.
  • Behavior remains backward compatible in next major release.
  • Changelog/docs include migration and removal timeline.

Follow-up Removal Issue

  • Track removal in next major once deprecation window closes.

Suggested Tests

  • Unit test: timeout: works unchanged.
  • Unit test: time_limit: and limit: still work in next major release and emit deprecation warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    deprecationThis issue pertains to an item/topic which has been deprecated

    Type

    No type

    Projects

    Status

    Deprecated

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions