PowerShell / PowerShell/DSC

Refactor common code into crate

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

Nobody has claimed this yet.

Issue-Enhancement
Dominant language
Rust
Stars
523
Forks
75
Avg merge
3d 16h
Merged PRs (30d)
24

Description

Summary of the new feature / enhancement

There is some common code in many/all the current resources. This code should be refactored into functions and put into a create that can be reused instead of duplicated. For example, the code to check an environment variable and then prompt a user to attach a debugger.

Proposed technical implementation details (optional)
  • Create a new library crate, e.g., dsc_utils that contains common code that can be reused in many/all resource implementations.
  • Move file_lib/src/debug.rs into the new crate and update all resources that use similar code to prompt the user to attach a debugger.
  • The code used to read the pipeline into a string is another good candidate for this.

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 file_lib/src/debug.rs and locating the resource implementations with duplicated debugger-prompt or pipeline-reading code. Confirm the new crate boundary, then update the affected resources to reuse the common code. Done means the shared logic is centralized in a reusable crate rather than duplicated across resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Refactor
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.