Strategy to use API to build a Deployment Tracking Matrix

I’m trying to create a dashboard like this. I’m comfortable using the APIs and willing to dump the results to a console app, web app, or CSV for Excel. So I’m just worried about the best strategy to approach the API for this information.

Comments / Questions

  • COLUMN 1: The list of projects all belong to a ProjectGroup, but it is filtered to exclude some irrelevant projects. Currently I can get those projects via repositoryForSpace.Projects.FindByNames(…) with a static string array.

  • COLUMN 2: How do get the latest release for each project. I see examples that look like repository.Projects.GetReleases(project, take: 1).Items.SingleOrDefault(). I just want validate how that works. Do the releases automatically come back in new-to-old order and take 1 is guaranteed to get the latest? Is that behavior documented somewhere?

  • COLUMNS 3+: Similarly I’m not sure how to get the latest deployment per project/environment/tenant combination. I’ve seen one example that looks like this
    repositoryForSpace.Deployments.Paginate(null, new[] { environment.Id }, page => …)
    but I don’t know how that environmentID actually acts like a filter. Is that hardcoded to only filter by environments? Or if I passed in a project.Id would it intelligently infer I want to filter by project? And since I want to filter by multiple factors, do I really just need to get a large chunky payload of projects and then manually sift and filter in memory afterwards? Or, is there a search capability where I can pass in the criteria and the filtering is done on server against the database?

At the heart of my questions is me not finding clear guidance on the strategy of pulling data. Do I pull it all down and manipulate in memory (chunky)? Do I make targeted calls pulling individualized data records with hardcoded keys (chatty)? Or does the platform support more intelligent query capabilities via the API? But my questions aren’t just generic, I am trying to build that use case I provided the visual for.

I’ve been continuing to dig into resources. This link seems super helpful.
Project coordination code samples - Octopus Deploy

This API seems to get me three quarters of the way there.

var projectDashboard = repository.Dashboards.GetDynamicDashboard(projects, environments).Items

I’m surprised that wasn’t under the API section of the Octopus documentation or under the GIT Hub examples.

Okay, the dynamic dashboard API did work for me and get me across the finish line. I do kind of wish the main Octopus “Dashboard” capability had the ability to expand the tenants across the columns like in my screenshot rather than just consolidating them into the cells requiring a drill-in.

Hey @Matt.Poland , welcome to the forum and thanks for your post!

Sorry we didn’t get any information back to you sooner, but I’m glad to see you’ve worked out what you need for your use case.

I’m going to try and answer some of the questions that came up during your search to hopefully help solidify any of the work you’ve completed.

  • The GET endpoint for releases does return them in descending recency, so taking the first one will always get your most recent release.

  • As far as pulling all into memory vs paginating responses, that’s very context dependent. As a general recommendation, we advise avoiding the “Retrieve all” type endpoints unless you are certain it’s a small amount of data and that the workload won’t have scale issues as your instance continues to grow. Several of our endpoints support paginating like you found in the documentation example, and that’s generally the best of both worlds - a little chattier than pulling all of the data, but restrained to a set page amount per call to not overwhelm the caller.

  • Thank you for pointing out the project code samples! To be completely honest, I don’t know that I’ve ever seen that page - I’ll work with my team to get that moved or replicated underneath the other API documentation, that certainly is an odd structure. EDIT - this has been addressed, and the page contents have been added here as well - Coordinating Multiple Projects

And finally - tenants on the dashboard overview. This is a request we’ve heard previously, and I believe there’s been some general discovery around improving tenancy within Octopus, but there are no hard dates or committed work (and nothing on the public roadmap). If you’d like, we do collect product feedback in UserVoice, where it can be voted on and allows us to see popular requests from product users.

Again, sorry for not responding sooner, but I’m glad you got the data you needed for your dashboard! Please don’t hesitate to reach out if you have additional questions or run into any issues as you continue building this out, we’re more than happy to help.