Skip to content

[BUG] ReleaseTemplateGitResource.GitCredentialId has the wrong JSON tag and never deserialises #443

Description

@NickJosevski

Description

ReleaseTemplateGitResource.GitCredentialId is tagged json:"NuGetPackageId,omitempty" — a copy-paste error. The server sends GitCredentialId, so the field never deserialises and always reads as "".

GitHubConnectionId, which the server also sends, is missing from the struct entirely.

pkg/releases/release_template_git_resource.go:12:

GitCredentialId string `json:"NuGetPackageId,omitempty"`

Steps To Reproduce

  1. Have a project with a step carrying a git dependency.
  2. client.DeploymentProcesses.GetTemplate(process, channelID, "")
  3. Read GitCredentialId off any entry in .GitResources.

Expected Behavior

GitCredentialId returns the credential ID the server sent.

Any Logs and/or Other Supporting Information

Raw response from the server:

{
  "ActionName": "Update Argo Manifests",
  "RepositoryUri": "https://github.com/.../sf2251-argo-manifests.git",
  "DefaultBranch": "main",
  "GitCredentialId": "GitCredentials-1",
  "GitHubConnectionId": null,
  "GitResourceSelectedLastRelease": { "GitRef": "refs/heads/feature-x", "GitCommit": "d65a219f..." }
}

Same call through the client:

ActionName       = "Update Argo Manifests"
RepositoryUri    = "https://github.com/.../sf2251-argo-manifests.git"
DefaultBranch    = "main"
GitCredentialId  = ""

Nothing errors — the value is silently dropped. Found while verifying #330.

Environment and/or Versions

  • Octopus Server Version: 2026.x (local)
  • Go Version: go1.22
  • go-octopusdeploy: main @ 1b925bc

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