Use trace messaging to indicate composite resources are being ignored
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 523
- Forks
- 75
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 24
Description
Summary of the new feature / enhancement
As a configuration author using PSDSC resources in DSC, I always see debug messages with a warning prefix about "implementation detail not found" for composite resources when the adapter builds the DSC cache. The warning implies that something has gone wrong, but the actual behavior is desired and expected -
Invoke-DscResourcedoesn't work with composite resources. Instead, the adapter should emit trace messages indicating that it's not caching the composite resource because they're not supported.
The code that is causing this behavior is in the Invoke-DscCacheRefresh function in the adapter module:
Proposed technical implementation details (optional)
Define an additional check in the foreach loop to specifically discard composite resources:
$dscResourceTypeName = $dscResource.ModuleName + '/' + $dscResource.Name
if ($dscResource.ImplementedAs -eq 'Composite') {
$trace = @{
'Trace' = @(
"Skipping caching composite resource '$dscResourceTypeName'."
"Composite resources aren't supported in DSCv3."
) -join ' '
} | ConvertTo-Json -Compress
$host.ui.WriteErrorLine($trace)
continue
}
[!NOTE]
Out of scope for this issue, but the trace messages from the adapter all use theDebuglevel, when they should use the appropriate level for their message, and many of them lack sufficient context for a typical user to understand which resource the message is referring to and what the message indicates.
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 in powershell-adapter/psDscAdapter/psDscAdapter.psm1, specifically the Invoke-DscCacheRefresh function around the referenced loop. Review how composite resources are currently handled, then verify that they are skipped with trace messages stating they are not cached and are unsupported in DSCv3.】【。
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100