Remove Foreman deprecations for 5.0 in develop (core, plugins)

Hi Foreman developers and plugin maintainers,

As part of the Foreman 5.0 branching process (branched 2026-08-11), it’s time to remove the deprecations that have reached their deadline from develop — following on from the 3.19 cleanup.

Core Foreman

These have passed their deadline and should be removed:

Long overdue (3.3–3.4):

Since 3.12:

Since 3.18:

API deprecations without an explicit deadline (worth a look too):

All verified against develop on 2026-08-18.

Plugins

I checked all 49 plugins in the plugin overview for Foreman::Deprecation usage. Five have deprecated code worth a look:

  • foreman_ansible — 4 API deprecations (import/obsolete on roles and variables, dating to 2021), all pointing at sync instead
  • foreman_googleemail and project compute-resource params (now loaded automatically from the JSON credential file)
  • foreman_puppet — legacy environment_* / puppetclass_* / config_group_* host & hostgroup params, plus the old /api/v2/* routes now served under /foreman_puppet/api/v2/*
  • foreman_remote_execution — the job template /export endpoint (superseded by core’s own export endpoint)
  • foreman_statistics — the old /api/v2/statistics and /api/v2/trends endpoints (moved under /foreman_statistics)

None of these carry an explicit version deadline, so it’s each plugin’s call whether to remove them now — flagging them so they’re on your radar. foreman-tasks has no outstanding deprecations. The remaining 44 plugins have no Foreman::Deprecation usage at all.

How to help

Search your own plugin with:

grep -rE "deprecation_warning" --include="*.rb" .
  • Core contributors: remove the deprecated code and its warning, update callers, adjust tests, open a PR against develop.
  • Plugin maintainers: decide whether the deprecations above are safe to remove for your plugin, and check whether your plugin depends on any of the core methods being removed here.

Thanks for helping keep develop clean!

3 Likes

Taking few easy ones:

It was a trap! HELP ME!!! :slight_smile:

Okay, almost all plugins still use at least one of the deprecated methods. I am gonna file those PRs, link them to the Core PR so we can merge Core only when all the plugins are merged.

3 Likes

Thanks for taking the time and putting this together @ogajduse !

As I am a big fan of cleaning things up, here is a start:

I opened a PR for foreman_puppet to remove everything that has been around since the Puppet was extracted from core. I have not yet looked into FAM and hammer and whether those need adjustments. But since the ‘new’ routes and parameters have been around for a while, we might be lucky.

As for core, I have opened Fixes #39520 - Remove deprecated compute_resource endpoints by nadjaheitmann · Pull Request #11090 · theforeman/foreman · GitHub some time ago to remove deprecated storage domain and storage pod params. It needs a hammer companion to restore the functionality that disappears when the parameters are gone: Refs #39520 - Replace deprecated compute_resource endpoint commands by nadjaheitmann · Pull Request #659 · theforeman/hammer-cli-foreman · GitHub

1 Like