fix(ado): detect ADO sign-in HTML response in list and report auth error#1044
Merged
Conversation
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jamesadevine
June 15, 2026 22:03
View session
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.
Summary
ado-aw listfailed withFailed to parse definitions response as JSON ... the PAT is invalid or expiredeven when authenticating via the Azure CLI. ADO serves its AAD sign-in HTML page with a203 Non-Authoritative Informationstatus; because203is a 2xx,is_success()passed and the JSON parser then choked on HTML, producing a misleading, PAT-specific error.Changes (
src/ado/mod.rs):looks_like_ado_signin(status, content_type, body)— flags the sign-in response via203status,text/htmlcontent type, or an HTML body.ado_signin_error(auth)— auth-method-specific guidance: ****** CLI) advisesaz login+ org/project access; PAT advises regenerating the token.list_definitions— checks the response before JSON parsing and returns the accurate auth error instead of a parse failure.Scope is limited to the reported
listpath; the helper is reusable for the other JSON-parsing call sites insrc/ado/mod.rsas a follow-up.Test plan
cargo test --bin ado-aw ado::(90 pass, including 5 new detection tests)cargo clippy --all-targets --all-features(clean)