Skip to content

git-cliff fails to parse context it generated itself due to missing field azure_devops #1318

Description

@taladar

Is there an existing issue for this?

  • I have searched the existing issues

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

  1. git cliff ... --context --output context.json
  2. git cliff ... --from-context context.json
  3. Get error like JsonError(Error("missing field 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

  • Operating system: Gentoo Linux
  • Rust version: 1.92.0
  • Project version: 2.11.0

Additional context

No response

Activity

  1. welcome commented on Dec 16, 2025

    @welcome

    Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

  2. taladar commented on Dec 16, 2025

    @taladar
    ContributorAuthor

    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.

  3. taladar commented on Dec 16, 2025

    @taladar
    ContributorAuthor

    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.

  4. taladar commented on Dec 16, 2025

    @taladar
    ContributorAuthor

    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.

  5. taladar commented on Dec 17, 2025

    @taladar
    ContributorAuthor

    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.

  6. orhun commented on Dec 17, 2025

    @orhun
    Owner

    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!

  7. taladar commented on Dec 17, 2025

    @taladar
    ContributorAuthor

    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.

  8. orhun commented on Dec 17, 2025

    @orhun
    Owner

    I'm not sure what you mean. Maybe create a PR with your changes or share logs?

  9. taladar commented on Dec 17, 2025

    @taladar
    ContributorAuthor

    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.

  10. taladar commented on Dec 17, 2025

    @taladar
    ContributorAuthor

    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.

  11. ManuelSchneid3r commented on Dec 31, 2025

    @ManuelSchneid3r

    Can we work around this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions