Skip to content

Conversation

andrewabest
Copy link
Contributor

@andrewabest andrewabest commented Sep 26, 2025

This PR introduces a tool for inspecting Octopus variables.

An Octopus project can have variables that come in from a number of sources:

  • The project variables
  • Library variable set variables for
  • Tenant variables for the specific project
  • Tenant variables from library variable sets

We have an existing tool for retrieving tenant variables.

This tool complements that tool and provides functionality for retrieving project variables.

It retrieves project variables, along with library variable set variables for any linked variable sets.

This is particularly useful when combined with the deployment process tool, as it allows LLMs to drill down to discover misconfigurations or missing configurations, which are typical when iterating on your pipeline.

@andrewabest andrewabest force-pushed the andrewb/variables-tool branch from 85e2715 to 1c6ba23 Compare October 1, 2025 01:51
@andrewabest andrewabest changed the title [Draft] Variables tool Project variables tool Oct 1, 2025
@andrewabest andrewabest marked this pull request as ready for review October 1, 2025 02:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new tool for inspecting Octopus Deploy project variables, complementing the existing tenant variables tool. The tool retrieves both project variables and library variable set variables for a given project, with support for config-as-code projects that store variables in Git.

  • Adds a new get_variables tool that fetches project and library variable set variables
  • Implements support for both database-stored and Git-stored variables in config-as-code projects
  • Provides comprehensive type definitions for Octopus Deploy variable resources

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/tools/index.ts Registers the new getVariables tool module
src/tools/getVariables.ts Implements the complete project variables tool with API integration and type definitions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

};
} else {
// For database projects, get variables directly
resource = await apiClient.get<VariableSetResource>(`/api/spaces/${spaceId}/variables/${project.VariableSetId}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API paths should start with ~/ so they can work with virtual folders

Comment on lines +260 to +261
variableSet: allVariableSetsMap[lvs.VariableSetId],
libraryVariableSet: lvs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add an explanation for the model as to what variable sets and library variable sets are and their relationship with each other or is it already well understood from the response structure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the model really needs to know about that, unless we want it to be able to modify them afterwards. Its more about evaluating the variables available to a project.

Copy link
Contributor

@egorpavlikhin egorpavlikhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just perhaps we could expand on the tool description to better describe the relationship between project / variable sets and library variable sets.

@andrewabest andrewabest merged commit 4c7d1f2 into main Oct 1, 2025
1 check passed
@andrewabest andrewabest deleted the andrewb/variables-tool branch October 1, 2025 05:14
andrewabest pushed a commit that referenced this pull request Oct 1, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.3.0](v0.2.5...v0.3.0)
(2025-10-01)


### Features

* Project variables tool
([#41](#41))
([4c7d1f2](4c7d1f2))


### Bug Fixes

* Change log file path to match entry point instead of node folder
([#44](#44))
([206b6ca](206b6ca))
* Fix SBOM build
([#42](#42))
([9500aa4](9500aa4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.

2 participants