puppetlabs / puppetlabs/puppet-resource_api

Logging for unmanaged resources

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

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
27
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Use Case

The Resource API should not make odious validations when using its formatting logging methods.

See also https://github.com/puppetlabs/puppet-specifications/blob/master/language/resource-api/README.md#logging-for-unmanaged-instances

Describe the Solution You Would Like

The formatting logging methods should not validate titles passed in. Instead any title (simple string, or composite namevar hash) should be accepted and properly rendered.

Additional Context

See the following code-locations for needing a fix.

https://github.com/puppetlabs/puppet-resource_api/blob/35e024e628a238e14a49e105893d70bc3022575e/lib/puppet/resource_api/base_context.rb#L110
https://github.com/puppetlabs/puppet-resource_api/blob/35e024e628a238e14a49e105893d70bc3022575e/lib/puppet/resource_api/base_context.rb#L115
https://github.com/puppetlabs/puppet-resource_api/blob/35e024e628a238e14a49e105893d70bc3022575e/lib/puppet/resource_api/base_context.rb#L152-L158

This was originally https://tickets.puppetlabs.com/browse/PDK-534

Contributor guide

Open the 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.

Research direction

Read the referenced Resource API logging specification first, then inspect lib/puppet/resource_api/base_context.rb at lines 110, 115, and 152-158. Trace how the formatting logging methods validate titles, including simple strings and composite namevar hashes. Done means both title forms are accepted and rendered without the unwanted validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.