Report profile, check and source file in puppet lookup --explain
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 62/100
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)). LeaveData#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 earlycache_has_keyreturn) 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
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simp/rubygem-simp-compliance_engine
-
sce-schema.json: missing properties that live SCE data uses (id, benchmark_version, notes, oval-ids)Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
simp/rubygem-simp-compliance_engine#138 · 1 comment ·
-
Malformed check data raises NoMethodError out of mapping?/hiera/fragments instead of being handledOpen
Difficulty 3/5 1-2 days Newbie friendliness 72/100
simp/rubygem-simp-compliance_engine#137 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
simp/rubygem-simp-compliance_engine#136 · 1 comment ·
All issues in simp/rubygem-simp-compliance_engine
Similar issues
-
Lint/NoReturnInMemoization flags `return` in local variable `||=` and `&&=` assignmentsPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Shopify/ruby-style-guide#815 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
zerocracy/judges-action#2849 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bigbluebutton/bigbluebutton#26166 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
TarteelAI/quranic-universal-library#916 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day