fetch-vcpkg-ci-logs
Fetch vcpkg Azure DevOps metadata, failed-step logs, and selected artifacts. Use for acquiring CI evidence, not diagnosing or reporting regressions; use analyze-ci-failures for those tasks. Skip when supplied logs are sufficient.
Fetch vcpkg CI Logs
First read and follow .\.github\skills\shared\azure-vcpkg-ci-notes.md. For endpoint shapes, artifact
naming, and ZIP layout, see references/azure-devops-api.md.
Prerequisites
- PowerShell with network access. The
vcpkg/publicAzure DevOps project is anonymously readable, so no Azure credentials are needed. - GitHub access (
ghCLI or the GitHub MCP server) — required only to resolve a PR number to its head SHA and check runs.
Inputs
An Azure build URL/ID or microsoft/vcpkg PR URL/number, optionally narrowed by job ID, triplet, port, or artifact.
Workflow
-
Resolve the build ID from the Azure URL or the PR head SHA's check runs. Preserve
jobIdorj. -
Fetch metadata, timeline, and artifacts in parallel.
-
Fetch failed-step logs first by directly invoking:
& '.\.github\skills\shared\Get-VcpkgAzureFailureLogs.ps1' -BuildId <id> & '.\.github\skills\shared\Get-VcpkgAzureFailureLogs.ps1' -PrNumber <pr> [-JobId <job>]Save its raw output as
failed-step-logs.txt. Ensure every failedValidate version filestimeline record is included; if the helper omits one, fetch its exactlog.urland append the raw body. -
Unless only step logs were requested, download relevant
failure logs for {triplet}ZIPs from each artifact'sresource.downloadUrl. Narrow by the requested job, triplet, or port; fetch other artifacts only when requested. Skipfile lists for {triplet}unless asked. -
Extract each ZIP into
artifacts/{triplet}/. Keep only the ZIPs that were requested, and record any download or extraction failure with the artifact name and URL instead of retrying indefinitely. -
Return the save location, build ID/status, Azure and PR URLs, PR title/author for PR builds, failed jobs/triplets, and errors.
Downloading Rules
- Download ZIPs with
Invoke-WebRequest -UseBasicParsingor curl.web_fetchcannot download binary content. - Artifacts are
PipelineArtifact, notContainer; useresource.downloadUrldirectly. The Container API does not work for them. - Each ZIP contains one top-level folder named exactly
failure logs for {triplet}, with one subdirectory per failing port.
Storage
Store evidence under the session folder provided in the environment context, never relative to the repository working directory:
{session-folder}/files/ci-failure-logs/build-{buildId}/
├── metadata.json
├── timeline.json
├── artifacts.json
├── failed-step-logs.txt
└── artifacts/{triplet}/
Prefer the narrowest sufficient scope. Record artifact names and download errors. Do not diagnose failures.
microsoft/vcpkg · MIT · Revision a1cae005c39b
Be the first to comment
Share what worked or leave a question for the creator.