microsoft / microsoft/azure-devops-go-api
GetReleaseDefinition fails when using scheduled days
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 223
- Forks
- 92
- PR merge metrics
- No merged PRs in 30d
Description
When using this config in Azure DevOps:

We get this error:
"json: cannot unmarshal number into Go struct field ReleaseSchedule.environments.schedules.daysToRelease of type release.ScheduleDays"
Returned from:
releaseDefinitionObject, err := releaseClient.GetReleaseDefinition(ctx,
getReleaseDefinitionArgs)
if err != nil {
log.Fatal(err)
}
Its this function that is throwing the error: https://github.com/microsoft/azure-devops-go-api/blob/09c8cad426a653fc76cdbfb915d3d11114b4d8e8/azuredevops/client.go#L295
And it is used by the function: https://github.com/microsoft/azure-devops-go-api/blob/09c8cad426a653fc76cdbfb915d3d11114b4d8e8/azuredevops/release/client.go#L682
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the unmarshal path in azuredevops/client.go and the GetReleaseDefinition call in azuredevops/release/client.go. Reproduce the scheduled-days response, then compare its daysToRelease value with the release.ScheduleDays type. Done means GetReleaseDefinition handles this Azure DevOps configuration without the reported unmarshal error and has regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100