Skip to content

Commit c4ec16a

Browse files
author
Andrew
authored
Merge branch 'main' into errors_warnings
2 parents d4939b1 + 36478f1 commit c4ec16a

File tree

8 files changed

+165
-24
lines changed

8 files changed

+165
-24
lines changed

CODE_OF_CONDUCT.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct][conduct-code].
4+
For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [[email protected]][conduct-email] with any additional questions or comments.
5+
6+
[conduct-code]: https://opensource.microsoft.com/codeofconduct/
7+
[conduct-FAQ]: https://opensource.microsoft.com/codeofconduct/faq/
8+
[conduct-email]: mailto:[email protected]

CONTRIBUTING.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Contributing to DSC
2+
3+
We welcome and appreciate contributions from the community.
4+
There are many ways to become involved with DSC:
5+
including filing issues,
6+
joining in design conversations,
7+
and writing and improving documentation.
8+
Please read the rest of this document to ensure a smooth contribution process.
9+
10+
## Intro to Git and GitHub
11+
12+
* Make sure you have a [GitHub account](https://github.com/signup/free).
13+
* Learning GitHub:
14+
* GitHub Help: [Good Resources for Learning Git and GitHub][https://help.github.com/articles/good-resources-for-learning-git-and-github/]
15+
* [GitHub Flow Guide](https://guides.github.com/introduction/flow/):
16+
step-by-step instructions of GitHub Flow
17+
18+
## Contributing to Issues
19+
20+
* Check if the issue you are going to file already exists in our [GitHub issues](https://github.com/powershell/DSC/).
21+
* If you can't find your issue already,
22+
[open a new issue](https://github.com/PowerShell/DSC/issues/new/choose),
23+
making sure to follow the directions as best you can.
24+
25+
## Contributing to Documentation
26+
27+
### Contributing to documentation related to DSC
28+
29+
Please see the [PowerShell-Docs-DSC](https://github.com/MicrosoftDocs/PowerShell-Docs-DSC/) repository for details.
30+
31+
### Contributing to documentation related to maintaining or contributing to the DSC project
32+
33+
* When writing Markdown documentation, use [semantic linefeeds](https://rhodesmill.org/brandon/2012/one-sentence-per-line/).
34+
In most cases, it means "one clause/idea per line".
35+
* Otherwise, these issues should be treated like any other issue in this repository.
36+
37+
#### Spellchecking documentation
38+
39+
Documentation is spellchecked. We use the
40+
[textlint](https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule) command-line tool,
41+
which can be run in interactive mode to correct typos.
42+
43+
To run the spellchecker, follow these steps:
44+
45+
* install [Node.js](https://nodejs.org/en/) (v10 or up)
46+
* install [textlint](https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule) by
47+
`npm install -g textlint textlint-rule-terminology`
48+
* run `textlint --rule terminology <changedFileName>`,
49+
adding `--fix` will accept all the recommendations.
50+
51+
If you need to add a term or disable checking part of a file see the [configuration sections of the rule](https://github.com/sapegin/textlint-rule-terminology).
52+
53+
#### Checking links in documentation
54+
55+
Documentation is link-checked. We make use of the
56+
`markdown-link-check` command-line tool,
57+
which can be run to see if any links are dead.
58+
59+
To run the link-checker, follow these steps:
60+
61+
* install [Node.js](https://nodejs.org/en/) (v10 or up)
62+
* install `markdown-link-check` by
63+
`npm install -g [email protected]`
64+
* run `find . \*.md -exec markdown-link-check {} \;`
65+
66+
## Code of Conduct Enforcement
67+
68+
Reports of abuse will be reviewed by the PS-Committee and if it has been determined that violations of the
69+
Code of Conduct has occurred, then a temporary ban may be imposed.
70+
The duration of the temporary ban will depend on the impact and/or severity of the infraction.
71+
This can vary from 1 day, a few days, a week, and up to 30 days.
72+
Repeat offenses may result in a permanent ban from the PowerShell org.

README.md

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,63 @@
11
# DSCv3
22

3-
[NOTICE] This repo is currently NOT accepting contributions and is public and Open Source to show progress. Once we are at a feature complete state, we can start taking contributions.
4-
5-
## High level design goals
6-
7-
- Cross-platform and Open Source
8-
- Bring your own agent
9-
- No LCM support
10-
- Azure Guest Config, Azure Automanaged VM, WinGet partners as orchestration agents
11-
- Author resources in PowerShell or any language
12-
- Need to be executable from command-line
13-
- Still supporting script based and class based resources
14-
- Native `dsc` command removes dependency on PowerShell
15-
- Able to invoke PowerShell based resources (Windows PowerShell or PowerShell 7 runtimes)
16-
- Move from MOF to JSON
17-
- End users can author configuration in YAML or JSON and apply them using `dsc` command
3+
> [!NOTE]
4+
> This repo isn't accepting code contributions. It's public and open source to show progress and
5+
> enable feedback. Once we're at a feature complete state, we can start taking code contributions.
6+
7+
## What's DSCv3?
8+
9+
DSCv3 is the latest iteration of Microsoft's Desired State Configuration platform. DSCv3 is an open
10+
source command line application that abstracts the management of software components declaratively
11+
and idempotently. DSCv3 runs on Linux, macOS, and Windows without any external dependencies.
12+
13+
With DSCv3, you can:
14+
15+
- Author resources to manage your systems in any language
16+
- Invoke individual resources
17+
- Create configuration documents that define the desired state of a system
18+
19+
### Differences from PowerShell DSC
20+
21+
DSCv3 differs from PowerShell DSC in a few important ways:
22+
23+
- DSCv3 doesn't depend on PowerShell. You can use DSCv3 without PowerShell installed and manage
24+
resources written in bash, python, C#, Go, or any other language.
25+
- DSCv3 doesn't include a local configuration manager. DSCv3 is invoked as a command. It doesn't
26+
run as a service.
27+
- Non-PowerShell resources define their schemas with JSON files, not MOF files.
28+
- Configuration documents are defined in JSON or YAML files, not PowerShell script files.
29+
30+
Importantly, while DSCv3 represents a major change to the DSC platform, DSCv3 is able to invoke
31+
PowerShell DSC Resources, including script-based and class-based DSC Resources, as they exist today. The
32+
configuration documents aren't compatible, but all published PowerShell DSC Resources are. You can
33+
use PowerShell DSC resources in DSCv3 with both Windows PowerShell and PowerShell.
34+
35+
## Installing DSCv3
36+
37+
To install DSC v3:
38+
39+
1. Download the [latest release from this repository][01].
40+
1. Expand the release archive.
41+
1. Add the folder containing the expanded archive contents to the `PATH`.
42+
43+
## Expore DSCv3
44+
45+
If you're new to DSC or configuration management, we recommend reviewing the [documentation][02].
46+
47+
If you're already familiar with DSC or just want to start experimenting with v3, we recommend
48+
reviewing the [Samples repository][03] and the accompanying [tutorial site][04].
49+
50+
## Integrating with DSCv3
51+
52+
DSCv3 is a platform tool that abstracts the concerns for defining and invoking resources. Higher
53+
order tools, like Azure Machine Configuration, Azure Automanaged VM, and WinGet are early partners
54+
for DSCv3 as orchestration agents.
55+
56+
DSCv3 uses JSON schemas to define the structure of resources, configuration documents, and the
57+
outputs that DSCv3 returns. These schemas make it easier to integrate DSCv3 with other tools,
58+
because they standardize and document how to interface with DSCv3.
59+
60+
[01]: https://github.com/PowerShell/DSC/releases/latest
61+
[02]: https://learn.microsoft.com/powershell/dsc/overview?view=dsc-3.0&preserve-view=true
62+
[03]: https://github.com/PowerShell/DSC-Samples
63+
[04]: https://powershell.github.io/DSC-Samples

SECURITY.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Security Vulnerabilities
2+
3+
Security issues are treated very seriously and will, by default,
4+
takes precedence over other considerations including usability, performance,
5+
etc... Best effort will be used to mitigate side effects of a security
6+
change, but DSC must be secure by default.
7+
8+
## Reporting a security vulnerability
9+
10+
If you believe that there is a security vulnerability in DSC,
11+
it **must** be reported using [https://aka.ms/secure-at](https://aka.ms/secure-at) to allow for [Coordinated Vulnerability Disclosure](https://technet.microsoft.com/security/dn467923).
12+
**Only** file an issue, if [MSRC](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue?rtc=1) has confirmed filing an issue is appropriate.

dsc_lib/src/discovery/command_discovery.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use crate::dscresources::dscresource::{DscResource, ImplementedAs};
66
use crate::dscresources::resource_manifest::ResourceManifest;
77
use crate::dscresources::command_resource::invoke_command;
88
use crate::dscerror::{DscError, StreamMessage, StreamMessageType};
9-
use std::collections::HashMap;
9+
use std::collections::BTreeMap;
1010
use std::env;
1111
use std::fs::File;
1212
use std::io::BufReader;
1313
use std::path::Path;
1414

1515
pub struct CommandDiscovery {
16-
pub resources: HashMap<String, DscResource>,
16+
pub resources: BTreeMap<String, DscResource>,
1717
provider_resources: Vec<String>,
1818
initialization_messages: Vec<StreamMessage>,
1919
initialized: bool,
@@ -22,7 +22,7 @@ pub struct CommandDiscovery {
2222
impl CommandDiscovery {
2323
pub fn new() -> CommandDiscovery {
2424
CommandDiscovery {
25-
resources: HashMap::new(),
25+
resources: BTreeMap::new(),
2626
provider_resources: Vec::new(),
2727
initialization_messages: Vec::new(),
2828
initialized: false,

powershellgroup/powershellgroup.resource.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ if ($Operation -eq 'List')
5555
#$m = gmo PSDesiredStateConfiguration
5656
#$r += @{"DebugInfo"=@{"ModuleVersion"=$m.Version.ToString();"ModulePath"=$m.Path;"PSVersion"=$PSVersionTable.PSVersion.ToString();"PSPath"=$PSHome}}
5757
#$r[0] | ConvertTo-Json -Compress -Depth 3
58-
5958
foreach ($r in $DscResources)
6059
{
60+
if ($r.ImplementedAs -eq "Binary")
61+
{
62+
continue
63+
}
64+
6165
$version_string = "";
6266
if ($r.Version) { $version_string = $r.Version.ToString() }
6367
$author_string = "";
6468
if ($r.author) { $author_string = $r.CompanyName.ToString() }
65-
6669
$moduleName = "";
6770
if ($r.ModuleName) { $moduleName = $r.ModuleName }
6871
elseif ($r.ParentPath) { $moduleName = Split-Path $r.ParentPath | Split-Path | Split-Path -Leaf }

test_group_resource/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
match args.subcommand {
1515
SubCommand::List => {
1616
let resource1 = DscResource {
17-
type_name: "TestResource1".to_string(),
17+
type_name: "Test/TestResource1".to_string(),
1818
version: "1.0.0".to_string(),
1919
description: Some("This is a test resource.".to_string()),
2020
implemented_as: ImplementedAs::Custom("TestResource".to_string()),
@@ -28,7 +28,7 @@ fn main() {
2828
}).unwrap()),
2929
};
3030
let resource2 = DscResource {
31-
type_name: "TestResource2".to_string(),
31+
type_name: "Test/TestResource2".to_string(),
3232
version: "1.0.1".to_string(),
3333
description: Some("This is a test resource.".to_string()),
3434
implemented_as: ImplementedAs::Custom("TestResource".to_string()),

test_group_resource/tests/provider.tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ Describe 'Resource provider tests' {
77

88
$out = dsc resource list *testresource* | ConvertFrom-Json | Sort-Object -Property type
99
$out.Count | Should -Be 2
10-
$out[0].type | Should -BeExactly 'TestResource1'
10+
$out[0].type | Should -BeExactly 'Test/TestResource1'
1111
$out[0].version | Should -Be '1.0.0'
1212
$out[0].path | Should -BeExactly 'test_resource1'
1313
$out[0].implementedas | Should -BeExactly 'TestResource'
1414
$out[0].requires | Should -BeExactly 'Test/TestGroup'
15-
$out[1].type | Should -BeExactly 'TestResource2'
15+
$out[1].type | Should -BeExactly 'Test/TestResource2'
1616
$out[1].version | Should -Be '1.0.1'
1717
$out[1].path | Should -BeExactly 'test_resource2'
1818
$out[1].implementedas | Should -BeExactly 'TestResource'

0 commit comments

Comments
 (0)