mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-09 07:28:05 -05:00
## Description
This change introduces a new tool for compiling local Dataform projects.
The new tool, `dataform-compile`, allows users to programmatically run
the `dataform compile` command against a project on the local
filesystem. This tool does not require a `source` and instead relies on
the `dataform` CLI being available in the server's `PATH`.
### Changes:
* Added the new tool definition in
`internal/tools/dataformcompile/dataformcompile.go`.
* The tool requires the following parameter:
* `project_dir`: The local Dataform project directory to compile.
* The tool uses `os/exec` to run the `dataform compile --json` command
and parses the resulting JSON output.
* Added a new integration test in
`internal/tools/dataformcompile/dataformcompile_test.go` which:
* Skips the test if the `dataform` CLI is not found in the `PATH`.
* Uses `dataform init` to create a temporary, minimal project for
testing.
* Verifies success, missing parameter errors, and errors from a
non-existent directory.
---
> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution
## PR Checklist
---
> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:
- [x] Make sure you reviewed
[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change
🛠️ Fixes #1469
---------
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>