Skip to content

[BUG] DeploymentProcessService.Get returns an empty process and a nil error when the project's Links are unpopulated #444

Description

@NickJosevski

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

  1. Build a version-controlled projects.Project that wasn't fetched from the API, so Links is empty.
  2. 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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions