Repository navigation
Record each run's mode and outcome; fix the 100-second download timeout - #52
Merged
Merged
Conversation
session.json now starts as run_type "provisioning" and is relabelled "skip", "baseline" or "provisioning" once the preflight decides. A failed preflight stays "provisioning". A new last-run.json in ProgramData is written atomically when the run starts (status "running") and again when the session closes. It carries the session id, run type, status, version, times, error and warning counts, and each item's name, stage, result (installed, skipped, failed) and a short error. The schema matches the macOS build. --last-run prints it as one line of at most 1000 characters for a remediation script. It prints "no run recorded" when there is none, and always exits 0 without elevation or a session directory. Package downloads used HttpClient's default 100-second timeout, which covers the whole body, so a large MSI on a slow link was cancelled mid-transfer. Downloads now stream with no overall client timeout. An attempt fails after 60 seconds without data or 30 minutes in total, and stalls, network errors and 5xx responses are retried up to three attempts. Closes #51
…time The --last-run time is UTC to the minute (2026-10-04T19:00Z). A failed preflight, or a manifest that cannot be loaded, now ends the session as "failed" rather than "partial_failure". At start, last-run.json writes end_time and duration_seconds as null rather than leaving them out. Refs #51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #51.
Run type
session.jsonstarts withrun_type: provisioning. Once the preflight decides, it is rewritten asskip,baselineorprovisioning. A failed preflight staysprovisioning.last-run.json
C:\ProgramData\ManagedBootstrap\last-run.jsonis written atomically (temporary file, then rename) when the run starts, with statusrunning, and again when the session closes. It holds the session id, run type, status, version, times, errors and warnings, and every item's name, stage, result (installed/skipped/failed) and a short error. The schema and value names match the macOS build.--last-run
Prints the record as one line of at most 1000 characters, made for a remediation script's output column:
It prints
no run recordedwhen there is no file. It always exits 0, and it runs before the elevation check and the single-instance lock, so it opens no session.Downloads
HttpClient's default 100-second
Timeoutcovers the whole response body, so a large MSI on a slow link was cancelled mid-transfer. Downloads now stream withTimeout = Infinite:Tests
LastRunTests: formatter, length cap, run-type mapping, error shortening, atomic write and read-back. 41/41 tests pass.Signed end-to-end run (x64 CLI, signed through
build.ps1, already-provisioned Windows 11 PC, local manifest)--last-runno run recorded2026-10-04T19:20Z baseline completed v2026.10.04.1218 installed=0 skipped=1 failed=02026-10-04T19:20Z provisioning failed v2026.10.04.1218 installed=0 skipped=0 failed=0... baseline partial_failure ... installed=0 skipped=1 failed=1: Stalled Download: Download stalled: no data for 60 secondsrun_type: provisioning,status: running,end_time: null,duration_seconds: null,items: [].run_type: baseline(session.json matches), with per-item results. Only failed items carryerror.