Comments (10)
Thanks very much for the detailed report!
For Case 2, as you suggest the issue is that the existing code treats Run::finishedDate
as a required field. This was actually due to configuration in my spec patcher to try and eliminate some of the Option wrappers in returned structs. See here for more details. It had worked in my previous testing, but that was just because I hadn't tested with an InProgress
run!
#6
I managed to repro the issue, and found that the result
field is also missing when the status is InProgress
, so have also made that optional.
from azure-devops-rust-api.
I've just published a new release 0.7.5
that I think should fix both of your issues (assuming that my speculative fix works).
Please try it out and let me know.
from azure-devops-rust-api.
@johnbatty Hi, I checked the response and the speculative fix on the pipelines indeed worked, the repository field is repository: Repository { id: None, type_: Some("gitHubEnterprise") }
, I'm guessing this only happens with non-azure repos or something other that's unusual.
Getting an inProgress run (as well as a finished run) works, too.
Thank you!
from azure-devops-rust-api.
Great news. I suspected that the Repository might look like that, and would explain why I hadn't seen it (I've only tested with pipelines that refer to ADO repos).
Please continue to raise any other issues you find.
from azure-devops-rust-api.
I think Case #2 could be solved by replacing this diff in src/pipelines/models.rs:436
- #[serde(rename = "finishedDate", with = "crate::date_time::rfc3339")]
- pub finished_date: time::OffsetDateTime,
+ #[serde(rename = "finishedDate", with = "crate::date_time::rfc3339", skip_serializing_if = "Option::is_none")]
+ pub finished_date: Option<time::OffsetDateTime>,
However since this crate is auto-generated I won't add a PR.
from azure-devops-rust-api.
I checked and the optionality of finishedDate is indeed not documented. Could this somehow be patched?
from azure-devops-rust-api.
Looking at the API for the pipelines GET:
https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/get?view=azure-devops-rest-7.1
It seems to be all there however I noticed the fields in the API definition are:
- _links
- configuration
- folder
- id
- name
- revision
- url
However the response I get is:
- _links
- configuration
- url
- id
- revision
- name
- folder
So I'm guessing we're looking for folder, find folder at the end. But then skip everything in between, and the next field id
can't be found.
I guess the fix would be not to care for the order here. Is that possible?
from azure-devops-rust-api.
For Case 1, the issue is not field ordering - the code is fine with the fields in any order.
Given the information that you have provided, I think the issue is with an id
field elsewhere in the nested structs. Looking at the definitions, I see that the configuration
field is of type PipelineConfiguration
, and that has a repository
field of type Repository
that has id
and type
fields which are currently required. I am guessing that in your scenario the id
must be missing from this value (possibly the type
too?). It would be good if you could confirm, if you can still repro and look at the data.
I'll make a speculative fix here to make both of these fields optional, which should hopefully fix your scenario.
from azure-devops-rust-api.
For case 1 I can check on Monday, I'm not sure what the output was, I just didn't want to post the full response here, but I could add a redacted response maybe.
from azure-devops-rust-api.
Yes - don't post any of your data here.
When you get the error, you should get the response data on the console. It will be a long single line. The error message gives you a location where the issue is, e.g. Error("missing field id
", line: 1, column: 455). You should be able to copy/paste the data into an editor and look at that column position. It should be at the end of the object that is missing the id field. You might be able to figure out which structure field it is (in particular, whether it is the repository
field).
from azure-devops-rust-api.
Related Issues (20)
- Listing work item queries fails with a response parsing failure
- Add support for continuation tokens HOT 4
- ADO_ORGANIZATION format? Run example: `cargo run --example build_list --features="build"` (A potentially dangerous Request.Path value was detected from the client ) HOT 5
- question: is there a way to trigger a rerun for a certain build? HOT 3
- Need to be able to handle date-time fields with invalid RFC3339 value (0001-01-01T00:00:00) HOT 2
- Removing Option wrappers from `GitPullRequest` breaks pull request create HOT 1
- auth-required set to true for feeds scoped to a public project which prevents unauthenticated download
- Add support for Azure DevOps throttling/rate limiting HOT 1
- git::commits::get_changes(...) response parsing fails HOT 4
- Missing git operation get_vsts_info_by_remote_url
- download universal artifacts HOT 4
- Error in Return Type in Get Items Batch API Call HOT 1
- Need better diagnostics when deserialization fails
- Failure parsing build list response
- date-time parameters are not formatted as RFC3339
- deserialize is failing in Distributed task due to null value in variableGroupProjectReferences HOT 2
- Extension deserialization fails due to flags fields HOT 3
- `release::releases::get_logs()` returns unprintable/garbled string HOT 3
- `git::items::list` `recursion_level` should be an enum rather than a String HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-devops-rust-api.