Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit warning if executable in resource manifest can't be found #688

Merged
merged 4 commits into from
Mar 14, 2025

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

  • Update build script to not copy WindowsPowerShell resource manifest on non-Windows, creates noise for testing
  • During resource discovery when loading the manifest, validate that the executable specified for the operation can be found otherwise emit a warning message
  • Remove outdated comment that get is always supported

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enhances resource discovery by validating that executables specified in the resource manifest are available, emitting a warning if they're not found.

  • Added a new function (verify_executable) to check executable presence for various operations.
  • Updated Cargo.toml to include the which dependency.
  • Updated locale files with a new warning message for missing executables.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

File Description
dsc_lib/src/discovery/command_discovery.rs Added executable validation via verify_executable for each resource operation and integrated SchemaKind handling
dsc_lib/Cargo.toml Added the which dependency to support executable lookup
dsc_lib/locales/en-us.toml Added a new locale message 'executableNotFound' for warning messages
Comments suppressed due to low confidence (1)

dsc_lib/src/discovery/command_discovery.rs:592

  • Consider adding unit tests for 'verify_executable' to ensure that the warning is correctly emitted when an executable is not found.
fn verify_executable(resource: &str, operation: &str, executable: &str) {
@SteveL-MSFT SteveL-MSFT added this to the 3.1-Approved milestone Mar 13, 2025
@SteveL-MSFT SteveL-MSFT force-pushed the validate-resource-exe branch from 8054fef to 57f0501 Compare March 14, 2025 17:59

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Tess Gauthier <tgauth@bu.edu>
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Mar 14, 2025
Merged via the queue into PowerShell:main with commit de15a96 Mar 14, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the validate-resource-exe branch March 14, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants