Skip to content

Conversation

@Yuan325
Copy link
Contributor

@Yuan325 Yuan325 commented Jan 27, 2026

This PR introduces a significant update to the Toolbox configuration file format, which is one of the primary breaking changes required for the implementation of the Advanced Control Plane.

Summary of Changes

The configuration schema has been updated to enforce resource isolation and facilitate atomic, incremental updates.

  • Resource Isolation: Resource definitions are now separated into individual blocks, using a distinct structure for each resource type (Source, Tool, Toolset, etc.). This improves readability, management, and auditing of configuration files.
  • Field Name Modification: Internal field names have been modified to align with declarative methodologies. Specifically, the configuration now separates kind (general resource type, e.g., Source) from type (specific implementation, e.g., Postgres).

User Impact

Existing tools.yaml configuration files are now in an outdated format. Users must eventually update their files to the new YAML format.

Mitigation & Compatibility

Backward compatibility is maintained during this transition to ensure no immediate user action is required for existing files.

  • Immediate Backward Compatibility: The source code includes a pre-processing layer that automatically detects outdated configuration files (v1 format) and converts them to the new v2 format under the hood.
  • [COMING SOON] Migration Support: The new toolbox migrate subcommand will be introduced to allow users to automatically convert their old configuration files to the latest format.

Yuan325 and others added 8 commits January 26, 2026 19:43
Update source code `Kind` to `Type`. It's only changes within our code.
Changes to yaml tag (that will affect users) will be done in later PRs.

This is a breaking change since it updates telemetry's span attribute
from `source_kind` to `source_type`.

Related #817

Future updates will include: 
* Updating a preprocessing function to convert config file from v1 to v2
* Update unmarshal function for ToolsFile to convert config file (test
will fail since the yaml tag is not yet updated).
* Update yaml tag (test will pass).
Add preprocessing function during parsing of tools file to convert v2
tools file.

Related #817

Future updates will include: 
* Update unmarshal function for ToolsFile to convert config file (test
will fail since the yaml tag is not yet updated).
* Update yaml tag (test will pass).

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Averi Kitsch <akitsch@google.com>
Update `parseToolsFile()` to use the file conversion function. Update
unmarshalling function since we will be unmarshalling per-doc (separated
by `---`).

`AuthSources` will be converted to `AuthServices` during the file
conversion stage. Hence, removing it from `ToolsFile` struct. ToolsFile
v2 will not support `AuthSources`. Double checked that all docs do not
reference to `AuthSources` anymore; new users is expected to be using
`AuthServices` instead.

This PR will not pass the unit test since the updates for resources's
yaml tag will be in subsequent PRs. Breaking it down to keep review
simpler.

Related #817

Upcoming PR:
* Update yaml tag
…2348)

Update yaml tag in source and auth services from `kind` to `type`.

Test will still fail since we have not yet updated tools.
Update yaml tag in tools from `kind` to `type`.

Upcoming PRs: 
* Update config in `/tests` and `/docs`

Will resolve other unit tests failure in the final PR to keep things
simpler.
Update "kind" to "type" in `/tests` folder.
Update docs and `cmd/root_test.go`.
Fix previously failing test. During unmarshal, if the resources is not
presented, return nil instead of empty struct.

Also added a note in docs to view the configuration file v1 version.
@github-actions
Copy link
Contributor

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Yuan325, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a breaking change to the Toolbox configuration file format, refactoring it to enhance resource isolation and facilitate atomic, incremental updates. The primary change involves transitioning from a single-document YAML structure with top-level resource keys to a multi-document format where each resource is defined with explicit kind and name fields. Additionally, the kind field within resource definitions has been consistently renamed to type for better semantic clarity. A crucial aspect of this update is the inclusion of a backward compatibility layer that automatically converts older configuration files to the new format, minimizing immediate user impact. This foundational change supports the implementation of the Advanced Control Plane and improves overall configuration management.

Highlights

  • Configuration File Format Update: The Toolbox configuration file format has been significantly updated to a new multi-document YAML structure. Resource definitions (Sources, Tools, Toolsets, etc.) are now separated into individual blocks, each identified by kind and name fields, improving readability and management.
  • Field Renaming for Clarity: The internal field kind within resource definitions has been renamed to type (e.g., source.kind: postgres is now type: postgres). This change aligns with declarative methodologies, distinguishing between the general resource type (kind) and its specific implementation (type).
  • Backward Compatibility Layer: A pre-processing layer has been implemented to automatically detect and convert outdated (v1) configuration files to the new (v2) format under the hood, ensuring immediate backward compatibility for existing deployments.
  • Centralized YAML Unmarshaling: The YAML unmarshaling logic has been refactored and centralized using a new UnmarshalResourceConfig function, which handles multi-document parsing and dispatches to specific unmarshaling functions for each resource type.
  • Documentation and Examples Updated: All relevant documentation, including CONTRIBUTING.md, DEVELOPER.md, README.md, and numerous resource-specific guides, along with code examples and quickstarts, have been updated to reflect the new configuration format and field names.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR introduces a significant and breaking change to the configuration file format, moving to a more structured v2 format. The changes are extensive, touching documentation, core logic for config parsing, and tests.
The implementation of the v1-to-v2 conversion layer in cmd/root.go is well-handled, including backward compatibility for authSources. The refactoring in internal/server/config.go to a centralized UnmarshalResourceConfig function is a good improvement for handling the new multi-document format.
The documentation has been updated thoroughly across the board to reflect the new format and the kind vs type terminology change. The tests have also been updated to cover the new format and conversion logic.
I have one minor suggestion for a typo in the documentation. Overall, this is a solid and well-executed refactoring.

type: postgres-list-triggers
source: postgres-source
description: |
Lists all non-internal triggers in a database. Returns trigger name, schema name, table name, wether its enabled or disabled, timing (e.g BEFORE/AFTER of the event), the events that cause the trigger to fire such as INSERT, UPDATE, or DELETE, whether the trigger activates per ROW or per STATEMENT, the handler function executed by the trigger and full definition.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's a typo in the description. "wether" should be "whether".

Suggested change
Lists all non-internal triggers in a database. Returns trigger name, schema name, table name, wether its enabled or disabled, timing (e.g BEFORE/AFTER of the event), the events that cause the trigger to fire such as INSERT, UPDATE, or DELETE, whether the trigger activates per ROW or per STATEMENT, the handler function executed by the trigger and full definition.
Lists all non-internal triggers in a database. Returns trigger name, schema name, table name, whether its enabled or disabled, timing (e.g BEFORE/AFTER of the event), the events that cause the trigger to fire such as INSERT, UPDATE, or DELETE, whether the trigger activates per ROW or per STATEMENT, the handler function executed by the trigger and full definition.

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