Bug #10539

Referencing a class does not validate until it is consume in a `require` like metaparameter

Added by John Eikenberry 7 months ago. Updated 14 days ago.

Status:Accepted Start date:11/03/2011
Priority:High Due date:
Assignee:Daniel Pittman % Done:

0%

Category:language
Target version:2.7.x
Affected Puppet version:2.7.6 Branch:
Keywords:
Votes: 0

Description

From the original report:

I had a typo in my require default line which didn’t raise any sort of error until I added to a specific resource. That is I had $require = Class["apps::postgres::multi"] when there was no such class (the class was named apps::postgresql::multi) and this did not raise an error.

I found the typo when I had an ordering issue and tried adding the require => Class["apps::postgres::multi"] to a specific resource and this generated the error “err: Failed to apply catalog: Could not find dependency Class …”.

It should generate the ‘could not find dependency’ error for the default.

I have verified this: assigning a reference to a type does absolutely not validation in Puppet 2.7, including when the content is consumed in some cases:

$foo = Class["foo"]
$bar = Banana["bar"]  # note: no such type!
notice("hello, $foo, from your little $bar")

Instead, the referenced type and entity should be validated during compilation, so that a clear error occurs when you reference a non-existent anything – not just when that value would be consumed in a way that dereferences the dependency.

History

Updated by Daniel Pittman 5 months ago

  • Subject changed from require metaparameter default does not raise an error to Referencing a class does not validate until it is consume in a `require` like metaparameter
  • Description updated (diff)
  • Category set to language
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Randall Hansen

Randall, this is assigned to you because the key priority decision is around the UX failure here, I think. Can you work out what priority this has, and what it targets, please?

Updated by Randall Hansen 3 months ago

  • Status changed from Needs Decision to Accepted
  • Priority changed from Normal to High
  • Target version set to 2.7.11

Updated by Randall Hansen 3 months ago

  • Assignee changed from Randall Hansen to Daniel Pittman

Updated by Matthaus Litteken 14 days ago

  • Target version changed from 2.7.11 to 2.7.x

Also available in: Atom PDF