Skip to content

Conversation

@lewing
Copy link
Member

@lewing lewing commented Feb 9, 2026

Summary

Work around dotnet/dnceng#6072 in the CI analysis skill by using the Helix \ListFiles\ endpoint instead of file URIs from the \Details\ endpoint.

Problem

The Helix work item Details API (\GET .../workitems/{id}) has two bugs in its \Files[].Uri\ values:

  1. Subdirectory flattening: Files uploaded from subdirectories (e.g. \xharness-output/logs/test/build.binlog) get URIs with only the base filename (.../files/build.binlog), so multiple distinct files with the same base name collide
  2. Unicode rejection: The /files/{name}\ endpoint validates against an ASCII-only regex, rejecting filenames containing unicode characters (e.g. CJK test directory names like \鿀蜒枛遫䡫煉)

The previous workaround reconstructed permalink URIs from the \FileName\ field, but this still routed through the broken /files/\ endpoint which rejects unicode.

Fix

Use the separate \ListFiles\ endpoint (\GET .../workitems/{id}/files) which returns direct blob storage URIs. These URIs:

  • Preserve full subdirectory paths
  • Have properly percent-encoded unicode
  • Don't route through the permalink/regex validation layer

Verified against PR #124125 CI artifacts: 53 files with unicode paths all return HTTP 200 via ListFiles blob URIs, vs broken/colliding URIs from the Details endpoint.

The Helix work item Details API returns incorrect file URIs for files
in subdirectories (path flattening) and rejects unicode characters in
filenames. The separate ListFiles endpoint returns direct blob storage
URIs that work for all filenames.

Replace the previous workaround (reconstructing permalink URIs from
FileName) with a call to ListFiles, which completely bypasses both
the subdirectory and unicode bugs.
Copilot AI review requested due to automatic review settings February 9, 2026 21:25
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 9, 2026
@lewing lewing requested a review from akoeplinger February 9, 2026 21:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the CI analysis skill’s Helix artifact retrieval to avoid broken file URIs returned by the Helix work item Details endpoint (dnceng#6072), switching to the ListFiles endpoint to obtain direct blob storage links that preserve subdirectories and support unicode filenames.

Changes:

  • Add Get-HelixWorkItemFiles to call the Helix .../workitems/{name}/files (ListFiles) endpoint.
  • Replace Files from the Details response with ListFiles results (Name/LinkFileName/Uri).
  • Update the Helix artifacts reference doc to describe the new workaround and the unicode/subdirectory issues.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/skills/ci-analysis/scripts/Get-CIStatus.ps1 Adds ListFiles retrieval and swaps the work item Files list to use blob URIs.
.github/skills/ci-analysis/references/helix-artifacts.md Updates documentation to describe the ListFiles-based workaround and the underlying Helix bug behavior.
Comments suppressed due to low confidence (1)

.github/skills/ci-analysis/scripts/Get-CIStatus.ps1:1383

  • Get-HelixWorkItemDetails builds the Details URL using $WorkItemName without URL-encoding, while Get-HelixWorkItemFiles correctly uses EscapeDataString. If a work item name contains characters that must be escaped (spaces, +, #, unicode, etc.), the Details request can fail or target the wrong resource. Encode the work item segment the same way as in Get-HelixWorkItemFiles (ideally compute once and reuse for both endpoints).

    $url = "https://helix.dot.net/api/2019-06-17/jobs/$JobId/workitems/$WorkItemName"

- helix-artifacts.md: Change {id} to {workItemName} for consistency
- Get-CIStatus.ps1: URL-encode WorkItemName in Get-HelixWorkItemDetails
  to match Get-HelixWorkItemFiles (unicode/special char safety)
@lewing
Copy link
Member Author

lewing commented Feb 9, 2026

Also opened AzDO PR #57709 to fix the server-side bug in dotnet-helix-service (dotnet/dnceng#6072). That fix passes FileName through to the permalink constructor and replaces the ASCII-only regex with a path traversal check to allow unicode.

@lewing lewing requested a review from steveisok February 9, 2026 21:52
@lewing lewing added area-skills Agent Skills and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 9, 2026
@lewing lewing enabled auto-merge (squash) February 9, 2026 22:15
@lewing lewing merged commit 482d8f9 into dotnet:main Feb 9, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-skills Agent Skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants