Feature: Enable use of semantic exit codes for adapted PSDSC resources
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with lib/dsc-lib/src/dscresources/adapted_resource_manifest.rs and RFC0001/PR #1319 to trace how adapted resources currently represent exit codes. Define the class and manifest contract for semantic codes, including the default 0/1 behavior, and verify that resource operations can surface a specific failure code.
Written by the indexing model from the issue text.
Description
Summary of the new feature / enhancement
As a resource author implementing DSC resources as PowerShell classes,
I want to be able to provide semantic exit codes for my users,
so that my resources can fit into the semantics of DSC more correctly.
Currently, adapted PSDSC resources always return an exit code of 1 for an operational failure. There is no way for a resource implemented as a PowerShell class to:
- Indicate a set of exit codes and their meaning for DSC from the class implementation.
- Indicate a set of exit codes and their meaning for DSC from the adapted resource manifest.
- Surface that the operation is a failure and should exit with a specific code from any given resource operation.
[!NOTE]
This problem affects other adapters as well, but we only have the PowerShell adapters published.
Proposed technical implementation details (optional)
We should add an exitCodes field to the adapted resource manifest to ensure that adapted resources can propagate semantically defined exit codes to DSC and higher order tools.
I can address the specifics of how to retrieve the exit codes from a class definition in RFC0001, but I think we need a way to properly indicate a semantic exit code from within a class method. I can't see an immediately obvious way to do this without either providing a [DscOperationException] class or requiring the resource author to implement a custom exception that includes both an exit code and message that their resource class throws.
When an adapted resource doesn't provide semantic exit codes, we should treat the exit codes the same way we do for other resources (0 for success, 1 for failure). This is an opt-in enhancement for all resources, but currently adapted resource authors can't participate in these semantics.
- Dominant language
- Rust
- Stars
- 546
- Forks
- 84
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 25
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
- Read the 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 PowerShell/DSC
-
Issue-Bug Need-Review
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
PowerShell/DSC#1832 ·
Maintainers usually reply within 1 day
-
Issue-Bug Need-Review
Difficulty 1/5 Under an hour Newbie friendliness 72/100
PowerShell/DSC#1831 ·
Maintainers usually reply within 1 day
-
Area-OpenTelemetry Issue-Enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
PowerShell/DSC#1821 ·
Maintainers usually reply within 1 day
-
Issue-Enhancement Needs Triage
Difficulty 4/5 3-5 days Newbie friendliness 22/100
PowerShell/DSC#1811 ·
Maintainers usually reply within 1 day
-
Issue-Enhancement Needs Triage
Difficulty 4/5 3-5 days Newbie friendliness 30/100
PowerShell/DSC#1812 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
autofixer: follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tursodatabase/turso#12531 ·
Maintainers usually reply within 1 day
-
bug help wanted ui
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
userFRM/egui-charts#4292 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Tripstack-Corp/spyc#1352 ·
Maintainers usually reply within 1 day