Skip to content

Fix containment of java::config - #609

Merged
span786 merged 1 commit into
puppetlabs:mainfrom
alexjfisher:fix_containment
Sep 30, 2026
Merged

span786 merged 1 commit into
puppetlabs:mainfrom
alexjfisher:fix_containment

Conversation

@alexjfisher

Copy link
Copy Markdown
Contributor

In 0dcd91b the anchor pattern was removed, but not replaced with anything and thus broke the containment of java::config. This restores the original behaviour by using contain.

As noted in the code comment, the declaration remains in the same place in the code as evaluation order is important. java::config is a private class and relies on variables from the base class's scope having been set before it is evaluated.

Also see #543 (comment)

@alexjfisher
alexjfisher requested review from a team and bastelfreak as code owners April 9, 2025 13:30
@skyamgarp

skyamgarp commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor

@alexjfisher , Can you please rebase with main?

In 0dcd91b the `anchor` pattern was
removed, but not replaced with anything and thus broke the containment
of `java::config`.  This restores the original behaviour by using
`contain`.

As noted in the code comment, the declaration remains in the same place
in the code as evaluation order is important.  `java::config` is a
private class and relies on variables from the base class's scope having
been set before it is evaluated.
@alexjfisher

Copy link
Copy Markdown
Contributor Author

@alexjfisher , Can you please rebase with main?

Done!

@jst-cyr

jst-cyr commented Jun 30, 2026

Copy link
Copy Markdown
Member

@amitkarsale : This looks like changes are approved and we have no conflicts with base branch. Are we able to merge this up? Do we have any other tests that are needed?

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The containment regression needs automated coverage, and the new comment contains a typo.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
What changed in this PR

Restores containment and ordering of the private java::config class.

Changes:

  • Contains java::config within java.
  • Ensures Java packages precede configuration.
File Description
manifests/​init.pp Restores configuration containment and ordering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread manifests/init.pp
}
-> class { 'java::config': }

contain java::config # NB evalutation order is important here as the config class relies on variables from the base class having been set before it's evaluated.
Comment thread manifests/init.pp
}
-> class { 'java::config': }

contain java::config # NB evalutation order is important here as the config class relies on variables from the base class having been set before it's evaluated.
@span786
span786 merged commit 248fa7a into puppetlabs:main Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants