OctopusDeploy / go-octopusdeploy

| Public | Go API Client for Octopus Deploy :octopus:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to query Branches, Tags, Commits on a version controlled project

borland opened this issue · comments

The octopus server responds with the following for a version controlled project

  "IsVersionControlled": true,
  "PersistenceSettings": {
    "Type": "VersionControlled",
    "Url": "https://github.com/borland/octopus-gha-test1",
    "Credentials": {
      "Type": "Reference",
      "Id": "GitCredentials-1"
    },
    "DefaultBranch": "main",
    "BasePath": ".octopus",
    "ConversionState": {
      "VariablesAreInGit": false
    }
  },
  "Links": {
    "Self": "/api/Spaces-1/projects/Projects-1/{gitRef}",
    "Variables": "/api/Spaces-1/variables/variableset-Projects-1",
    "Releases": "/api/Spaces-1/projects/Projects-1/releases{/version}{?skip,take,searchByVersion}",
    "Channels": "/api/Spaces-1/projects/Projects-1/channels{/id}{?skip,take,partialName}",
    "Triggers": "/api/Spaces-1/projects/Projects-1/triggers{?skip,take,partialName,triggerActionType,triggerActionCategory,runbooks}",
    "ScheduledTriggers": "/api/Spaces-1/projects/Projects-1/triggers/scheduled{?skip,take,partialName,ids}",
    "OrderChannels": "/api/Spaces-1/projects/Projects-1/channels/order",
    "Progression": "/api/Spaces-1/projects/Projects-1/progression{?aggregate}",
    "RunbookTaskRunDashboardItemsTemplate": "/api/Spaces-1/progression/runbooks/taskRuns{?skip,take,ids,projectIds,runbookIds,environmentIds,tenantIds,taskIds}",
    "DeploymentProcess": "/api/Spaces-1/projects/Projects-1/{gitRef}/deploymentprocesses",
    "DeploymentSettings": "/api/Spaces-1/projects/Projects-1/{gitRef}/deploymentsettings",
    "Web": "/app#/Spaces-1/projects/Projects-1",
    "Logo": "/api/Spaces-1/projects/Projects-1/logo?cb=2022.3.7462",
    "Metadata": "/api/Spaces-1/projects/Projects-1/metadata",
    "Runbooks": "/api/Spaces-1/projects/Projects-1/runbooks{?skip,take,partialName}",
    "RunbookSnapshots": "/api/Spaces-1/projects/Projects-1/runbookSnapshots{/name}{?skip,take,searchByName}",
    "Summary": "/api/Spaces-1/projects/Projects-1/{gitRef}/summary",
    "GitConnectionTest": "/api/Spaces-1/projects/Projects-1/git/connectivity-test",
    "InsightsMetrics": "/api/Spaces-1/projects/Projects-1/insights/metrics{?projectId,channelId,environmentId,tenantId,tenantFilter,timeRange,granularity,timeZone}",
    "Branches": "/api/Spaces-1/projects/Projects-1/git/branches{/name}{?skip,take,searchByName,refresh}",
    "Tags": "/api/Spaces-1/projects/Projects-1/git/tags{/name}{?skip,take,searchByName,refresh}",
    "Commits": "/api/Spaces-1/projects/Projects-1/git/commits{/hash}{?skip,take,refresh}",
    "RepositoryModified": "/api/Spaces-1/projects/Projects-1/git/modified",
    "ValidateGitRef": "/api/Spaces-1/projects/Projects-1/git/validate"
  }

Of note: the Branches/Tags links if followed return a list of branches/tags in the git repository. These are useful if you want to prompt the user to select a git ref for creating a release in a version controlled project.
The CLI is building this feature at the moment.

The API Client doesn't appear to have any support for these links, or the payload that would be returned when following them.