microsoft / microsoft/azure-devops-rust-api

deserialize error on `get_build_log` response

Open
#590 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
76
Forks
27
Avg merge
9d 20h
Merged PRs (30d)
3

Description

I am trying to get the logs of a build using get_build_log, but I get the following error:

hread 'main' panicked at Tools\pb\src\cmd_trigger.rs:222:34:
called `Result::unwrap()` on an `Err` value: Error { context: Full(Custom { kind: DataConversion, error: Error("expected value", line: 1, column: 1) }, "Failed to deserialize response:\n============================================================================== \r\nTask         : Pull Request Validation\r\nDescription  : OneBranch Policy Validation\r\nVersion      : 1.0.141099\r\nAuthor       : Microsoft Corporation\r\n============================================================================== \r\n

Looking at the Impl Response for get_build_log, it looks like its running serde_json -> String when the data in the log is not a json
https://github.com/microsoft/azure-devops-rust-api/blob/44af69f5df3cee2d05619af501c985885f0e702a/azure_devops_rust_api/src/build/mod.rs#L4580C13-L4593C14

Example output:

============================================================================== 
Task         : Pull Request Validation
Description  : OneBranch Policy Validation
Version      : 1.0.141099
Author       : Microsoft Corporation
============================================================================== 

It seems like there is something in the autogeneration that needs to be aware its not a json and therefore not run serde_json::from_slice on it?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the get_build_log response implementation in azure_devops_rust_api/src/build/mod.rs around lines 4580-4593, then inspect the panic site in Tools/pb/src/cmd_trigger.rs:222. Reproduce the response using the non-JSON build-log text shown in the issue and trace the generated deserialization path. Done means get_build_log can handle this response without a serde_json conversion error or panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.