-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support writing progress as JSON #614
base: main
Are you sure you want to change the base?
Conversation
$LASTEXITCODE | Should -Be 0 | ||
$lines = Get-Content $TestDrive/ErrorStream.txt | ||
$ProgressMessagesFound = $False | ||
foreach ($line in $lines) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of comparing text, since all output should be JSON, you should convert every line from json and check the object
$lines = Get-Content $TestDrive/ErrorStream.txt | ||
$ProgressMessagesFound = $False | ||
foreach ($line in $lines) { | ||
if ($line.Contains("activity")) { # if line is a progress message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, use convertfrom-json
PR Summary
Fix #592
-f, --format
argument todsc.exe
isjson
orpretty-json
.Searching for adapted resources
progress which previously was always showing 0.The structure of json progress message is following.
activity
andpercent_complete
are expected to always have value; the rest of the fields are optional.Same structure will be expected from resources when they will want to provide progress status to
dsc
(this support will be implemented soon).Dev notes:
struct DscProgressBar
which is wrapping both UI progress bar and json serialization;pub enum OutputFormat
fromdsc
todsc_lib
and updated all references.