Skip to content

Commit b533eb2

Browse files
authored
chore: add developer instructions (#41)
1 parent 0ab1449 commit b533eb2

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed

DEVELOPER.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# DEVELOPER.md
2+
3+
This document provides instructions for setting up your development environment
4+
and contributing to the Cloud SQL for PostgreSQL Gemini CLI Extension project.
5+
6+
## Prerequisites
7+
8+
Before you begin, ensure you have the following:
9+
10+
1. **Gemini CLI:** Install the Gemini CLI version v0.6.0 or above. Installation
11+
instructions can be found on the official Gemini CLI documentation. You can
12+
verify your version by running `gemini --version`.
13+
2. **Cloud SQL for PostgreSQL Instance:** For testing data plane tools, you will need access to an active Cloud SQL for PostgreSQL
14+
instance.
15+
16+
## Developing the Extension
17+
18+
### Running from Local Source
19+
20+
The core logic for this extension is handled by a pre-built `toolbox` binary. The development process involves installing the extension locally into the Gemini CLI to test changes.
21+
22+
1. **Clone the Repository:**
23+
24+
```bash
25+
git clone https://github.com/gemini-cli-extensions/cloud-sql-postgresql.git
26+
cd cloud-sql-postgresql
27+
```
28+
29+
2. **Download the Toolbox Binary:** The required version of the `toolbox` binary
30+
is specified in `toolbox_version.txt`. Download it for your platform.
31+
32+
```bash
33+
# Read the required version
34+
VERSION=$(cat toolbox_version.txt)
35+
36+
# Example for macOS/amd64
37+
curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/darwin/amd64/toolbox
38+
chmod +x toolbox
39+
```
40+
Adjust the URL for your operating system (`linux/amd64`, `darwin/arm64`, `windows/amd64`).
41+
42+
3. **Install the Extension Locally:** Use the Gemini CLI to install the
43+
extension from your local directory.
44+
45+
```bash
46+
gemini extensions install .
47+
gemini extensions link .
48+
```
49+
The CLI will prompt you to confirm the installation. Accept it to proceed.
50+
51+
4. **Testing Changes:** After installation, start the Gemini CLI (`gemini`).
52+
You can now interact with the `cloud-sql-postgresql` tools to manually test your changes
53+
against your connected database.
54+
55+
## Testing
56+
57+
### Automated Presubmit Checks
58+
59+
A GitHub Actions workflow (`.github/workflows/presubmit-tests.yml`) is triggered
60+
for every pull request. This workflow primarily verifies that the extension can
61+
be successfully installed by the Gemini CLI.
62+
63+
Currently, there are no automated unit or integration test suites
64+
within this repository. All functional testing must be performed manually. All tools
65+
are currently tested in the [MCP Toolbox GitHub](https://github.com/googleapis/genai-toolbox).
66+
67+
### Other GitHub Checks
68+
69+
* **License Header Check:** A workflow ensures all necessary files contain the
70+
proper license header.
71+
* **Conventional Commits:** This repository uses
72+
[Release Please](https://github.com/googleapis/release-please) to manage
73+
releases. Your commit messages must adhere to the
74+
[Conventional Commits](https://www.conventionalcommits.org/) specification.
75+
* **Dependency Updates:** [Renovate](https://github.com/apps/forking-renovate)
76+
is configured to automatically create pull requests for dependency updates.
77+
78+
## Building the Extension
79+
80+
The "build" process for this extension involves packaging the extension's
81+
metadata files (`gemini-extension.json`, `cloud-sql-postgresql.md`, `LICENSE`) along with the
82+
pre-built `toolbox` binary into platform-specific archives (`.tar.gz` or `.zip`).
83+
84+
This process is handled automatically by the
85+
[`package-and-upload-assets.yml`](.github/workflows/package-and-upload-assets.yml)
86+
GitHub Actions workflow when a new release is created. Manual building is not
87+
required.
88+
89+
## Maintainer Information
90+
91+
### Team
92+
93+
The primary maintainers for this repository are defined in the
94+
[`.github/CODEOWNERS`](.github/CODEOWNERS) file:
95+
96+
* `@gemini-cli-extensions/senseai-eco`
97+
* `@gemini-cli-extensions/cloud-sql-postgresql-maintainers`
98+
99+
### Releasing
100+
101+
The release process is automated using `release-please`.
102+
103+
1. **Release PR:** When commits with conventional commit headers (e.g., `feat:`,
104+
`fix:`) are merged into the `main` branch, `release-please` will
105+
automatically create or update a "Release PR".
106+
2. **Merge Release PR:** A maintainer approves and merges the Release PR. This
107+
action triggers `release-please` to create a new GitHub tag and a
108+
corresponding GitHub Release.
109+
3. **Package and Upload:** The new release triggers the
110+
`package-and-upload-assets.yml` workflow. This workflow builds the
111+
platform-specific extension archives and uploads them as assets to the
112+
GitHub Release.

0 commit comments

Comments
 (0)