Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .vscode/schemas/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"Kind": { "$ref": "#/$defs/ProjectKind" },
"SupportedPlatformOS": { "$ref": "#/$defs/ProjectSupportedPlatformOS" },
"IsRust": { "$ref": "#/$defs/ProjectIsRust" },
"RustPackageName": { "$ref": "#/$defs/ProjectRustPackageName" },
"TestOnly": { "$ref": "#/$defs/ProjectTestOnly" },
"SkipTest": { "$ref": "#/$defs/ProjectSkipTest" },
"ClippyUnclean": { "$ref": "#/$defs/ProjectClippyUnclean" },
Expand Down Expand Up @@ -70,6 +71,7 @@
"Kind": { "$ref": "#/$defs/ProjectKind" },
"SupportedPlatformOS": { "$ref": "#/$defs/ProjectSupportedPlatformOS" },
"IsRust": { "$ref": "#/$defs/ProjectIsRust" },
"RustPackageName": { "$ref": "#/$defs/ProjectRustPackageName" },
"TestOnly": { "$ref": "#/$defs/ProjectTestOnly" },
"SkipTest": { "$ref": "#/$defs/ProjectSkipTest" },
"ClippyUnclean": { "$ref": "#/$defs/ProjectClippyUnclean" },
Expand Down Expand Up @@ -190,6 +192,11 @@
"title": "Is Rust Crate",
"markdownDescription": "Indicates whether the project is a Rust crate."
},
"ProjectRustPackageName": {
"type": "string",
"title": "Rust package name",
"markdownDescription": "Defines the name of the rust project for the `-p` option on cargo commands."
},
"ProjectTestOnly": {
"type": "boolean",
"default": false,
Expand Down
39 changes: 15 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ tempfile = { version = "3.27" }
# dsc, dsc-lib, registry, dsc-lib-registry, sshdconfig
thiserror = { version = "2.0" }
# dsc, dsc-lib, dsc-bicep-ext
tokio = { version = "1.50" }
tokio = { version = "1.51" }
# dsc-bicep-ext
tokio-stream = { version = "0.1" }
# dsc
Expand Down
9 changes: 5 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ process {
Install-Clippy -UseCFS:$UseCFS -Architecture $Architecture @VerboseParam
}

if (!$SkipBuild -and !$SkipLinkCheck -and $IsWindows) {
Write-BuildProgress @progressParams -Status "Ensuring Windows C++ build tools are available"
Install-WindowsCPlusPlusBuildTools @VerboseParam
}

if (-not ($SkipBuild -and $Test -and $ExcludeRustTests)) {
Write-BuildProgress @progressParams -Status 'Ensuring Protobuf is available'
Install-Protobuf @VerboseParam
Expand All @@ -212,10 +217,6 @@ process {
}
}

if (!$SkipBuild -and !$SkipLinkCheck -and $IsWindows) {
Write-BuildProgress @progressParams -Status "Ensuring Windows C++ build tools are available"
Install-WindowsCPlusPlusBuildTools @VerboseParam
}
#endregion Setup

if (!$SkipBuild) {
Expand Down
8 changes: 3 additions & 5 deletions dsc-bicep-ext/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl BicepExtension for BicepExtensionService {
resource: Some(proto::Resource {
r#type: resource_type,
api_version: version,
identifiers: identifiers,
identifiers,
properties: result.actual_state.to_string(),
status: None,
}),
Expand Down Expand Up @@ -270,7 +270,7 @@ impl BicepExtension for BicepExtensionService {
resource: Some(proto::Resource {
r#type: resource_type,
api_version: version,
identifiers: identifiers,
identifiers,
properties: "{}".to_string(),
status: None,
}),
Expand Down Expand Up @@ -367,9 +367,7 @@ async fn run_server(
impl Connected for NamedPipeConnection {
type ConnectInfo = ();

fn connect_info(&self) -> Self::ConnectInfo {
()
}
fn connect_info(&self) -> Self::ConnectInfo {}
}

impl AsyncRead for NamedPipeConnection {
Expand Down
2 changes: 1 addition & 1 deletion dsc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dsc"
version = "3.2.0-preview.14"
version = "3.2.0-rc.1"
edition = "2024"

[dependencies]
Expand Down
5 changes: 2 additions & 3 deletions dsc/src/resource_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pub fn get(dsc: &mut DscManager, resource_type: &FullyQualifiedTypeName, version

match resource.get(input) {
Ok(result) => {
if let GetResult::Resource(response) = &result {
if format == Some(&GetOutputFormat::PassThrough) {
if let GetResult::Resource(response) = &result
&& format == Some(&GetOutputFormat::PassThrough) {
let json = match serde_json::to_string(&response.actual_state) {
Ok(json) => json,
Err(err) => {
Expand All @@ -46,7 +46,6 @@ pub fn get(dsc: &mut DscManager, resource_type: &FullyQualifiedTypeName, version
write_object(&json, Some(&OutputFormat::Json), false);
return;
}
}

// convert to json
let json = match serde_json::to_string(&result) {
Expand Down
10 changes: 4 additions & 6 deletions dsc/src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,8 @@ pub fn config(subcommand: &ConfigSubCommand, parameters: &Option<String>, mounte

configurator.context.dsc_version = Some(env!("CARGO_PKG_VERSION").to_string());

if let ConfigSubCommand::Set { what_if , .. } = subcommand {
if *what_if {
configurator.context.execution_type = ExecutionKind::WhatIf;
}
if let ConfigSubCommand::Set { what_if , .. } = subcommand && *what_if {
configurator.context.execution_type = ExecutionKind::WhatIf;
}

let parameters: Option<serde_json::Value> = match if new_parameters.is_some() {
Expand Down Expand Up @@ -499,7 +497,7 @@ pub fn validate_config(config: &Configuration, progress_format: ProgressFormat)
let type_name = &FullyQualifiedTypeName::parse(type_name)?;
let require_version = resource_block["requireVersion"]
.as_str()
.map(|r| ResourceVersionReq::parse(r))
.map(ResourceVersionReq::parse)
.transpose()?;
resource_types.push(DiscoveryFilter::new(type_name, require_version, None));
}
Expand All @@ -512,7 +510,7 @@ pub fn validate_config(config: &Configuration, progress_format: ProgressFormat)
let type_name = &FullyQualifiedTypeName::parse(type_name)?;
let require_version = resource_block["requireVersion"]
.as_str()
.map(|r| ResourceVersionReq::parse(r))
.map(ResourceVersionReq::parse)
.transpose()?;

trace!("{} '{}'", t!("subcommand.validatingResource"), resource_block["name"].as_str().unwrap_or_default());
Expand Down
22 changes: 10 additions & 12 deletions dsc/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,18 +350,16 @@ pub fn enable_tracing(trace_level_arg: Option<&TraceLevel>, trace_format_arg: Op
}

// override with DSC_TRACE_LEVEL env var if permitted
if tracing_setting.allow_override {
if let Ok(level) = env::var(DSC_TRACE_LEVEL) {
tracing_setting.level = match level.to_ascii_uppercase().as_str() {
"ERROR" => TraceLevel::Error,
"WARN" => TraceLevel::Warn,
"INFO" => TraceLevel::Info,
"DEBUG" => TraceLevel::Debug,
"TRACE" => TraceLevel::Trace,
_ => {
warn!("{}: '{level}'", t!("util.invalidTraceLevel"));
TraceLevel::Warn
}
if tracing_setting.allow_override && let Ok(level) = env::var(DSC_TRACE_LEVEL) {
tracing_setting.level = match level.to_ascii_uppercase().as_str() {
"ERROR" => TraceLevel::Error,
"WARN" => TraceLevel::Warn,
"INFO" => TraceLevel::Info,
"DEBUG" => TraceLevel::Debug,
"TRACE" => TraceLevel::Trace,
_ => {
warn!("{}: '{level}'", t!("util.invalidTraceLevel"));
TraceLevel::Warn
}
}
}
Expand Down
Loading
Loading