getting pull request: json: cannot unmarshal number Edit into Go struct field GitCommitDiffs.changeCounts of type azuredevops.VersionControlChangeType
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
I upgraded my atlantis image to 0.34.0 and now i get this error when i try to atlantis plan in my Azure Devops PullRequest. getting pull request: json: cannot unmarshal number Edit into Go struct field GitCommitDiffs.changeCounts of type azuredevops.VersionControlChangeType
Reproduction Steps
Upgrade to 0.34.0
Environment details
- Atlantis version: 0.34.0
- Deployment method: ecs/eks/helm/tf module
Hello @Froostx! I'm here to help you with any bugs or questions you might have while you wait for a human maintainer. Feel free to ask me anything!
The error you're encountering, "json: cannot unmarshal number Edit into Go struct field GitCommitDiffs.changeCounts of type azuredevops.VersionControlChangeType," suggests a type mismatch issue when Atlantis is trying to unmarshal JSON data from Azure DevOps. This issue likely arises from a change in the JSON response format or a change in the Atlantis codebase related to how it handles Azure DevOps data.
To address this issue, you can try the following steps:
-
Check for Updates or Patches: Ensure that you are using the latest version of Atlantis, as there might be a patch or update that addresses this issue.
-
Review Release Notes: Look for any release notes or documentation related to version 0.34.0 that might mention changes in how Azure DevOps data is handled. This could provide insights into the cause of the issue.
-
Inspect the Code: If you have access to the code, inspect the
GitCommitDiffsstruct and theazuredevops.VersionControlChangeTypeto understand the expected data types. This might help in identifying the mismatch. -
Modify the Code: If you are comfortable with Go, you might consider modifying the code to handle the type mismatch. This could involve changing the data type of the
changeCountsfield or implementing a custom unmarshalling function to handle the conversion. -
Revert to a Previous Version: As a temporary workaround, consider reverting to a previous version of Atlantis that did not have this issue, if feasible.
If none of these steps resolve the issue, further investigation into the specific changes in version 0.34.0 or the JSON response format from Azure DevOps might be necessary.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
I'm getting the same problem after i've upgraded from 0.33.0 to 0.34.0, i'm using Azure DevOps too. The workaround is to downgrade to 0.33.0 atlantis version
same here, downgrading to 0.33 fixes it.
We have the same issue. Downgrading fixes it, but we want to move to v0.34.0 because of #5298
Looks like problem that I described in this pull request. I tested it locally and it looks good. I'll test it on our Atlantis stack and I will prepare PR for that in a few days.
Im having the same issue. It throws that error on webhooks for PR creation. We are using atlantis plan -p <project> and atlantis apply -p <project>as a workaround as the defining the specific project seems to work(or maybe the webhook format is different for PR comments/updates).
Im using Azure DevOps and atlantis v0.34.0
Can someone verify that version v0.35.0 fixed the issue? Did not have time to test it in a new version.
When we tried it in our build it worked, just want to be sure. @MeesvanStraten @davidegiunchi @Froostx
@bub3n I upgraded from 0.34.0 -> 0.35.0, seems to work now. The only thing I noticed is that the credentials for the old Azure DevOps (
Seems like once a Pull Request is created and the credentials are stored, you can use atlantis even on PRs created previously as the credentials are already stored.
Can someone verify that version v0.35.0 fixed the issue? Did not have time to test it in a new version.
When we tried it in our build it worked, just want to be sure. @MeesvanStraten @davidegiunchi @Froostx
Upgraded to 0.35.0 and seems to work. Thanks!
Thank you for testing! :)
Confirmed that version 0.35.0 is functional in AzDo.
Can someone verify that version v0.35.0 fixed the issue? Did not have time to test it in a new version.
When we tried it in our build it worked, just want to be sure. @MeesvanStraten @davidegiunchi @Froostx
Yes, it works! thank you