Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Feature: Enable use of semantic exit codes for adapted PSDSC resources

Offen
#1,380 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
powershell, rust
Bereich
devops, tooling

Rechercherichtung

Beginne mit lib/dsc-lib/src/dscresources/adapted_resource_manifest.rs und RFC0001/PR #1319, um nachzuverfolgen, wie angepasste Ressourcen Exit-Codes derzeit darstellen. Definiere den Klassen- und Manifest-Vertrag für semantische Codes, einschließlich des Standardverhaltens für 0/1, und überprüfe, dass Ressourcenoperationen einen spezifischen Fehlercode zurückgeben können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Issue-Enhancement
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:

  1. Indicate a set of exit codes and their meaning for DSC from the class implementation.
  2. Indicate a set of exit codes and their meaning for DSC from the adapted resource manifest.
  3. 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.

Vorherrschende Sprache
Rust
Sterne
543
Forks
78
Ø Merge
2 T. 6 Std.
Gemergte PRs (30 T.)
18

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PowerShell/DSC

Alle Issues in PowerShell/DSC

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.