Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Report profile, check and source file in puppet lookup --explain

Open
#141 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
ruby
Domain
devops

Research direction

Start with compliance_engine::enforcement and the Data#hiera path, including the early cache_has_key return, then read how context.explain is used. Add read-only source reporting for profiles, check IDs, and source files without changing Data#hiera's return value, and ensure both initial and cached lookups appear in --explain while normal compiles avoid the work.

Written by the indexing model from the issue text.

Description

When a value comes from compliance data, puppet lookup --explain <key> should say where it came from. Today compliance_engine::enforcement never calls context.explain, so the trace shows the backend and the value with no context. Its log messages go to the Puppet log (--debug) instead.

This matters more as modules ship simp:defaults profiles. Every module adds its own checks.yaml to that one profile, sometimes with several confined checks per parameter, so "which check set this value?" is hard to answer.

Originally requested in simp/pupmod-simp-compliance_markup#200, from a training session.

Proposed approach

  • For each value, report the profile, the check ID(s) and the source file(s). A deep-merged value can have more than one source.
  • Add a separate read-only method (e.g. Data#hiera_sources(profiles)). Leave Data#hiera's return value as it is, since the CLI and other callers use it.
  • Call it only inside context.explain { ... }. Puppet only runs that block when an explanation was requested, so normal compiles pay nothing.
  • Values served from the lookup cache (enforcement.rb, the early cache_has_key return) need the same explanation, not only the first lookup.
Dominant language
Ruby
Stars
2
Forks
1
Avg merge
7d 20h
Merged PRs (30d)
2

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from simp/rubygem-simp-compliance_engine

All issues in simp/rubygem-simp-compliance_engine

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.