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

Some static-analysis support #403

Open
SteveL-MSFT opened this issue Apr 12, 2024 · 1 comment
Open

Some static-analysis support #403

SteveL-MSFT opened this issue Apr 12, 2024 · 1 comment
Labels
Issue-Enhancement The issue is a feature or idea

Comments

@SteveL-MSFT
Copy link
Member

Summary of the new feature / enhancement

Instead of hitting a run-time error, it would be useful to have some static analysis be performed. I do wonder if it should be part of whatIf or separate since whatIf will already handle some of it:

  • schema validation of properties
  • dependsOn circular loops (although this is caught early on during execution)
  • [reference()] w/o explicit dependsOn
  • [resourceId()] that doesn't exist (think typo)
  • invalid functions or function arguments

Proposed technical implementation details (optional)

No response

@SteveL-MSFT SteveL-MSFT added the Issue-Enhancement The issue is a feature or idea label Apr 12, 2024
@michaeltlombardi
Copy link
Collaborator

A command for validating a configuration document (and reference manifest, honestly) would be deeply useful for users and authoring tools alike, I think.

Maybe something like:

# By path
dsc validate document --path ./myconfig.dsc.config.yaml
# From stdin, with detailed info as JSON objects
$myConfig | dsc validate document --detailed
# As above, but for manifests:
$myResource | dsc validate manifest

The JSON objects from the output could contain information that the eventual extension could use, but at the very least they would tell the author the context and message that failed validation.

Another useful eventual option would be to enable suggestions, like using newer versions of resources, or noticing you're supplying a credential without using secureString, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea
Projects
None yet
Development

No branches or pull requests

2 participants