puppetlabs / puppetlabs/puppet-resource_api

implement refreshonly for all types

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

Nobody has claimed this yet.

enhancement
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.