Repository navigation
git-cliff fails to parse context it generated itself due to missing field azure_devops #1318
Description
Activity
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️
I tried replacing all occurrences of azureDevops in the JSON file with azure_devops but that did not fix it so it might be a bit more complex after all than just a mismatch between serialization and deserialization.
The line and column of the error point to the missing field being in the commit object, and indeed, compared to your .github/fixtures/test-from-context/context.json in the repository, the commit just has github, gitlab, gitea and bitbucket fields, but not azure_devops field. So it seems the error is about the one holding username and pull request data, not the azure_devops field that contains contributors only.
I assume the problem is that there is no azure_devops in commit.rs around line 485 (in the manual Serialize implementation for Commit) but Deserialize is derived (on line 97 in the same file) and so Serialize does not write it but Deserialize wants it.
I tried adding that and it fixes the error in the commit object but now I get another one, also about a missing azure_devops field so while this is part of it it is not the entire story.
Hey, thanks for reporting!
I think the solution might be making the Azure DevOps fields an
Option<T>I'll look more into this later. Feel free to submit a PR btw!
I was about to but then I noticed that it still fails so I am looking for the type that is missing that other azure_devops field.
I'm not sure what you mean. Maybe create a PR with your changes or share logs?
Well, I had one missing azure_devops error on line 58 of my context.json, then I added the above mentioned serialization of that field that was missing and now I get a very similar error on line 209 which is the closing brace of the "previous" field (a Release I think) from what I can tell but as far as I can see the code there derives Serialize and Deserialize so it shouldn't handle it differently on serialization and deserialization.
I found the second issue, Release uses
#[serde(rename_all(serialize = "camelCase"))]or in other words it renames azure_devops to azureDevops but only on serialize, not on deserialize.Can we work around this issue?
Is there an existing issue for this?
Description of the bug
I am trying to add a few variables for use in templates (in particular package.metadata.deb.revision to generate a Debian changelog) so I used the --context and --from-context options with some jq in between in my release script to add those. However, rather unexpectedly, --from-context fails due to a missing field azure_devops which I neither use in my cliff.toml, in CLI options or anywhere else.
The context.json file contains a field azureDevops in a few places so I assume there is some issue where the source code produces that but expected azure_devops when parsing.
Steps To Reproduce
azure_devops", line: 58, column: 7))Expected behavior
I would expect it to parse the context.json it just produced itself.
Screenshots / Logs
No response
Software information
Additional context
No response