Skip to content

fix: error when a deployment process link cannot be resolved - #446

Draft
NickJosevski wants to merge 1 commit into
mainfrom
fix/444-deployment-process-missing-links
Draft

fix: error when a deployment process link cannot be resolved#446
NickJosevski wants to merge 1 commit into
mainfrom
fix/444-deployment-process-missing-links

Conversation

@NickJosevski

Copy link
Copy Markdown
Contributor

Get, GetTemplate, GetDeploymentProcessByGitRef and GetDeploymentProcessTemplate all discarded the errors from uritemplates.Parse and template.Expand. When a Project or DeploymentProcess has an unpopulated Links map, Parse("") succeeds, Expand returns "", and the GET resolves to the API root — which unmarshals cleanly into a zero-valued resource. The caller got a non-nil result and a nil error.

Adds an expandLink helper that errors when the link is absent, matching the existing wording in ProjectService.ConvertToVcs.

Verified live:

Get(no links):         err=the state of the input project is not valid; cannot resolve DeploymentProcess link
GetTemplate(no links): err=the state of the input deploymentProcess is not valid; cannot resolve Template link

Happy paths unchanged against a real instance — CaC with an explicit gitRef, CaC with the default-branch fallback, non-CaC, the newclient equivalent, and GetTemplate all still return their processes. New tests fail without the source change.

Fixes #444

🤖 Generated with Claude Code

Get, GetTemplate, GetDeploymentProcessByGitRef and
GetDeploymentProcessTemplate discarded the errors from Parse and Expand.
An unpopulated Links map produced an empty path that resolved to the API
root and unmarshalled into a zero-valued resource, returning a nil error.

Fixes #444

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant