Skip to content

Issue #1478 Avoid validate_legacy deprecation failure on Puppet 8#1479

Open
alex-harvey-z3q wants to merge 2 commits into
puppetlabs:mainfrom
alex-harvey-z3q:issue-1478-deprecation-failure
Open

Issue #1478 Avoid validate_legacy deprecation failure on Puppet 8#1479
alex-harvey-z3q wants to merge 2 commits into
puppetlabs:mainfrom
alex-harvey-z3q:issue-1478-deprecation-failure

Conversation

@alex-harvey-z3q

Copy link
Copy Markdown

Summary

Remove the direct deprecation() call from validate_legacy() so otherwise valid catalogs do not fail under Puppet 8 strict deprecation handling before the function performs its type assertion.

validate_legacy() remains deprecated as an API, but this change preserves its compatibility behavior for modules that still depend on it while they migrate to native Puppet data types.

This also updates the validate_legacy function specs to assert that the function no longer invokes the stdlib deprecation helper in its existing pass/fail cases.

Checklist

  • Spec tests.
  • Acceptance tests.
  • Manually verified.

…ppet 8

Do not call the deprecated stdlib deprecation function from validate_legacy.
Under Puppet 8 strict settings this can raise before validate_legacy evaluates
the supplied value, which breaks modules that still call validate_legacy.
@CLAassistant

CLAassistant commented Jul 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@alex-harvey-z3q

Copy link
Copy Markdown
Author

@CLAassistant Note that I changed my GitHub handle from alexharv074 to alex-harvey-z3q which could explain why it shows me as having not accepted the CLA. I've accepted again.

@alex-harvey-z3q

Copy link
Copy Markdown
Author

The failing build does not appear related to my PR.

@jst-cyr

jst-cyr commented Jul 16, 2026

Copy link
Copy Markdown
Member

@alex-harvey-z3q : Thanks for putting in this PR. If I'm reading your request correctly, you have a scenario where you are running on strict mode so the deprecation on validate_legacy is causing a full error on other modules.

Have you identified which module(s) in your dependency tree are still calling validate_legacy (or the older validate_* functions) directly? If it's something you maintain, updating those modules seems like the more durable fix than patching stdlib's runtime behavior. If it's a third-party module you don't control, perhaps we can get PRs in on those modules to fix their use of a deprecated function.

stdlib has had this method deprecated for three years, and the fix here would actually remove deprecation warnings for non-strict (not only strict) mode meaning it would lose the messaging to module maintainers that they need to update.

Pass false for the strict-setting flag when validate_legacy calls the
stdlib deprecation helper. This preserves the deprecation warning for
module maintainers, while preventing Puppet strict mode from turning the
warning into a hard failure before validation runs.
@alex-harvey-z3q

alex-harvey-z3q commented Jul 17, 2026

Copy link
Copy Markdown
Author

@jst-cyr Yes I see your point.

How is this updated version of the PR that keeps the validate_legacy deprecation warning, but passes false for the strict-setting flag when calling deprecation. I think that matches the pattern already used?

E.g. lib/puppet/functions/validate_legacy.rb (line 55)

I will also trace the dependency tree that is still calling validate_legacy/older validate_* functions, but hopefully this change should avoid breaking strict-mode Puppet 8 consumers while those downstream fixes make their way through?

@alex-harvey-z3q
alex-harvey-z3q deleted the issue-1478-deprecation-failure branch July 19, 2026 13:43
@alex-harvey-z3q
alex-harvey-z3q restored the issue-1478-deprecation-failure branch July 19, 2026 13:43
@smortex

smortex commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Given these functions where deprecated in 9.0.0, I would have expected them to be removed in 10.0.0 (but they have not). I really do not think that making them less "harmful" is a move in the right direction.

@alex-harvey-z3q

Copy link
Copy Markdown
Author

Given these functions where deprecated in 9.0.0, I would have expected them to be removed in 10.0.0 (but they have not). I really do not think that making them less "harmful" is a move in the right direction.

I have different expectations because this is enterprise software. I would expect enterprise software not to have bugs in it, and I would expect the maintainers of enterprise software to understand that enterprises move slowly.

@alexjfisher

Copy link
Copy Markdown
Collaborator

Given these functions where deprecated in 9.0.0, I would have expected them to be removed in 10.0.0 (but they have not). I really do not think that making them less "harmful" is a move in the right direction.

By removing the function, you make it harder for people to upgrade to newer stdlib.
By not accepting changes like this, you make it harder for people to upgrade Puppet, (or make them disable strict mode at the expense of not getting its benefits elsewhere).

@cvquesty cvquesty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@cvquesty cvquesty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm with Alex fisher... we do need to make attempts to keep the barrier lower and the file changes nominal if we can. I think it's important to realize, as mentioned, that we're all volunteers but at the same time this project exists because the puppet folks couldn't keep momentum nor get to the really necessary updates and changes in a timely fashion largely due to blast radius, being overwhelmed when there are indeed several changes that need to happen, thus they did nothing (or next to it...or moved painfully slow)

The conversation around appropriateness for a purpose is important, though. we can't prefer one over the other, and have to strike a medium balance here in that yes, we need to see these as enterprise software but at the same time, there is a mechanism to duplicate and expand on forge modules that are poor or not meeting one's needs. The validate functions have been gone for quite some time now (3 years), but this represents 10 releases. I think they can safely be let go now.

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.

6 participants