-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API mismatch with reality? #148
Comments
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. |
I checked and the optionality of finishedDate is indeed not documented. Could this somehow be patched? |
Looking at the API for the pipelines GET: It seems to be all there however I noticed the fields in the API definition are:
However the response I get is:
So I'm guessing we're looking for folder, find folder at the end. But then skip everything in between, and the next field I guess the fix would be not to care for the order here. Is that possible? |
Thanks very much for the detailed report! For Case 2, as you suggest the issue is that the existing code treats I managed to repro the issue, and found that the |
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 I'll make a speculative fix here to make both of these fields optional, which should hopefully fix your scenario. |
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. |
Yes - don't post any of your data here. |
I've just published a new release |
@johnbatty Hi, I checked the response and the speculative fix on the pipelines indeed worked, the repository field is Getting an inProgress run (as well as a finished run) works, too. Thank you! |
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. |
Version in use
I'm using version
0.7.4
with the current version of Azure DevOps (which as far as I can tell is still the same API version7.1
.Case 1
When using the
pipeline_client
to get a current pipeline I'm getting errors of the sort:context: Full(Custom { kind: DataConversion, error: Error("missing field ``id``", line: 1, column: 455) }
.However looking inside the response an "id" field is present. So the error message seems wrong
Case 2
When using the
runs_client
on the same pipeline I'm getting this error:context: Full(Custom { kind: DataConversion, error: Error("missing field ``finishedDate``", line: 1, column: 1723) }
finishedDate
is indeed not part of the response. However this run isn't finished so I wouldn't expect it? I'm guessing this value should be optional and isn't.Case 3
If I choose a run that has finished the response is ok.
Summary
I guess some of the API isn't covered correctly. This is especially an issue since I need unfinished runs from the API.
The text was updated successfully, but these errors were encountered: