puppetlabs / puppetlabs/puppet-resource_api
implement refreshonly for all types
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 27
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Use Case
refreshonly is useful in some edge-cases to ensure that resources are only managed in a particular situation. It is awkward to implement in the core API and impossible in a Resource API provider.
See ini_setting.rb#L132 for a simple, but broken implementation example
Describe the Solution You Would Like
See resource_api.rb#L382 for a start to implement it.
likely should look like this:
def flush
real_flush unless refresh_only
end
def refresh
real_flush if refresh_only
end
with the current flush's contents moved to {{real_flush}}, and the refreshonly attribute getting automatically defined, and all the bells and whistles of actually properly building this instead of a jira sketch.
Describe Alternatives You've Considered
This could also be implemented as a basic feature for all types in core puppet.
Additional Context
Originally filed as https://tickets.puppetlabs.com/browse/PDK-1217
Contributor 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.
Research direction
Start by reading resource_api.rb around line 382 and compare it with the refreshonly example in ini_setting.rb around line 132. Trace how flush and refresh are handled for Resource API types, then define completion as refreshonly being automatically available and correctly controlling whether changes are applied across all types, including the documented edge cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100