microsoft / microsoft/azure-devops-go-api

GetReleaseDefinition fails when using scheduled days

Open
#92 1 comment 0 reactions 0 assignees View on GitHub

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:
bilde

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.