Deployment Reporting

I’m using self hosted Octopus - Download: 2020.1.15 - Octopus Deploy

I’m trying to generate a list of all production deployments, with ideally the Changes information shown on Project > Deloyments > Releases page.

My first confusion is that when I look at a project and view Releases, I definitely can’t see all the production deployments I’ve done.

I also tried the the Octopus CLI and it only came back with 44 entries despite there being 558 if I query the DeploymentHistory DB table (the number it returned seemed to be similar to what was showing under Project > Releases)

octo list-deployments --server=“https://ci.server” --apiKey=“API-CREATE_YOUR_OWN_KEY” --environment=“PRD” --number=“1000” --outputFormat=Json > OctopusDeployDeployments.json

select * from DeploymentHistory
where EnvironmentName = ‘PRD’

So I’m unsure firstly why there is that large difference between the UI and Octopus CLI versus the DeploymentHistory DB table - thoughts?

If I then focus on DeploymentHistory table, I cannot see how you would get the “Changes” list for a release? (which is displayed when you click a release on the dashboard (project/environment combination - see earlier screenshot).

https://ci.server/app#/Spaces-1/projects/myproject/deployments/releases/0.0.4500/deployments/Deployments-4329?activeTab=taskSummary

Is it simply looking at all releases between it and the previous one to that environment to create that Changes list?

Thanks in advance.

Hi @roberts1 ,

Thanks for getting in touch! It looks like what you might be seeing here is the Retention Policy for your releases in action. The database will still keep a log containing the history of deployments, but the Octopus server will delete old releases based on the settings you have defined in your Lifecycle.

What you see under the Task History from your screenshot is pulled from the database and is similar to what you would see in the Audit Logs.

Does that help?

Let me know if you have any further questions at all.

Best regards,
Daniel

Hi @Daniel_Fischer, thanks for the reply. It does sound as if the differences I’m seeing is due to the default retention policy deleting old releases (I’m assuming that’s to save on disk space?).

What it doesn’t explain is why the API is show releases rather than deployment history (seems a bit misleading?) i.e. the below returns the releases not the full deployment history

octo list-deployments --server=“https://ci.server” --apiKey=“API-CREATE_YOUR_OWN_KEY” --environment=“PRD” --number=“1000” --outputFormat=Json > OctopusDeployDeployments.json

Just curious, is it possible to view the DeploymentHistory DB records in the UI or is it just available for sql reporting etc?

Thanks for such a prompt reply.

Hi @roberts1,

Thanks for getting back. You’re correct that we remove the releases to save diskspace.

Regarding the list-deployments command you are running. This is returning data for the deployment object which is different from what you would see if you run the list-releases command. Below I have an example from my server where I have run both commands:

list-deployments:

[
  {
    "Project": {
      "Id": "Projects-2",
      "Name": "abc"
    },
    "Environment": {
      "Id": "Environments-22",
      "Name": "Prod"
    },
    "Tenant": null,
    "Channel": {
      "Id": "Channels-2",
      "Name": "Default"
    },
    "Created": "2021-02-08T10:11:32.631+10:00",
    "Version": "0.0.1",
    "Assembled": "2021-02-08T09:53:10.541+10:00",
    "PackageVersions": "",
    "ReleaseNotes": ""
  }
]

list-release. (I cropped subsequent release results for this example.)

[
  {
    "Project": {
      "Id": "Projects-2",
      "Name": "abc"
    },
    "Releases": [
      {
        "Version": "0.0.5",
        "Assembled": "2021-03-29T11:17:03.813+10:00",
        "PackageVersions": "",
        "ReleaseNotes": "",
        "GitReference": null,
        "GitCommit": null
      },

The release command shows some information about the release itself while the deployment shows some metadata about one of my deployments. It does not contain exhaustive information about the deployment but just what Octopus needs to know for that particular deployment object.

If you would like to see the Deployment History like it is displayed in the database, you can use the Audit Log feature. This feature essentially reads from the this table in the database, along with other tables, to build a complete list of actions on your Octopus server.

If you are still stuck here or have any questions at all, please don’t hesitate to let me know.

Best regards,
Daniel

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.