Description
DeploymentProcessService.Get discards the errors from uritemplates.Parse and template.Expand. When a Project has an unpopulated Links map, Parse("") succeeds, Expand returns "", and the GET resolves to the API root — which unmarshals cleanly into a zero-valued DeploymentProcess.
The call returns a non-nil process and a nil error, so a caller has no way to tell it failed.
pkg/deployments/deployment_process_service.go:43:
template, _ := uritemplates.Parse(project.Links["DeploymentProcess"])
path, _ := template.Expand(map[string]interface{}{"gitRef": gitRef})
Same pattern in GetDeploymentProcessByGitRef (:166), GetTemplate (:63) and GetDeploymentProcessTemplate (:199).
Steps To Reproduce
- Build a version-controlled
projects.Project that wasn't fetched from the API, so Links is empty.
client.DeploymentProcesses.Get(project, "main")
Expected Behavior
An error naming the missing link, rather than a successful-looking empty result.
Any Logs and/or Other Supporting Information
Get(project with empty Links) -> err=<nil>
returned ID="" Steps=0 SpaceID="" Version=0
Found while verifying #114. Same class as #442 and #443 — client-side mapping failing quietly instead of erroring.
Environment and/or Versions
- Octopus Server Version: 2026.x (local)
- Go Version: go1.22
- go-octopusdeploy:
main @ 1b925bc
Description
DeploymentProcessService.Getdiscards the errors fromuritemplates.Parseandtemplate.Expand. When aProjecthas an unpopulatedLinksmap,Parse("")succeeds,Expandreturns"", and the GET resolves to the API root — which unmarshals cleanly into a zero-valuedDeploymentProcess.The call returns a non-nil process and a nil error, so a caller has no way to tell it failed.
pkg/deployments/deployment_process_service.go:43:Same pattern in
GetDeploymentProcessByGitRef(:166),GetTemplate(:63) andGetDeploymentProcessTemplate(:199).Steps To Reproduce
projects.Projectthat wasn't fetched from the API, soLinksis empty.client.DeploymentProcesses.Get(project, "main")Expected Behavior
An error naming the missing link, rather than a successful-looking empty result.
Any Logs and/or Other Supporting Information
Found while verifying #114. Same class as #442 and #443 — client-side mapping failing quietly instead of erroring.
Environment and/or Versions
main@ 1b925bc