Skip to content

Commit 19a7fe2

Browse files
docs: restructure contributing guidelines for adding new db source or tool (#1239)
## Description This PR is for re-structuring the `CONTRIBUTING.md` guide to separate the documentation for adding new database sources and adding new tools. The "Adding a New Database Source and Tool" section has been split into two distinct, standalone sections. Fixes #1158 --------- Signed-off-by: SaxenaAnushka102 <[email protected]> Co-authored-by: Averi Kitsch <[email protected]>
1 parent 54d33fb commit 19a7fe2

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,42 @@ This project follows
2525

2626
## Contribution process
2727

28-
### Code reviews
28+
> [!NOTE]
29+
> New contributions should always include both unit and integration tests.
30+
2931

3032
All submissions, including submissions by project members, require review. We
3133
use GitHub pull requests for this purpose. Consult
3234
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
3335
information on using pull requests.
3436

35-
Within 2-5 days, a reviewer will review your PR. They may approve it, or request
36-
changes. When requesting changes, reviewers should self-assign the PR to ensure
37+
### Code reviews
38+
39+
* Within 2-5 days, a reviewer will review your PR. They may approve it, or request
40+
changes.
41+
* When requesting changes, reviewers should self-assign the PR to ensure
3742
they are aware of any updates.
38-
If additional changes are needed, push additional commits to your PR branch -
39-
this helps the reviewer know which parts of the PR have changed. Commits will be
43+
* If additional changes are needed, push additional commits to your PR branch -
44+
this helps the reviewer know which parts of the PR have changed.
45+
* Commits will be
4046
squashed when merged.
41-
Please follow up with changes promptly. If a PR is awaiting changes by the
47+
* Please follow up with changes promptly.
48+
* If a PR is awaiting changes by the
4249
author for more than 10 days, maintainers may mark that PR as Draft. PRs that
4350
are inactive for more than 30 days may be closed.
4451

45-
### Adding a New Database Source and Tool
52+
## Adding a New Database Source or Tool
4653

4754
We recommend creating an
4855
[issue](https://github.com/googleapis/genai-toolbox/issues) before
4956
implementation to ensure we can accept the contribution and no duplicated work.
5057
If you have any questions, reach out on our
51-
[Discord](https://discord.gg/Dmm69peqjh) to chat directly with the team. New
52-
contributions should be added with both unit tests and integration tests.
58+
[Discord](https://discord.gg/Dmm69peqjh) to chat directly with the team.
59+
60+
> [!NOTE]
61+
> New tools can be added for [pre-existing data sources](https://github.com/googleapis/genai-toolbox/tree/main/internal/sources). However, any new database source should also include at least one new tool type.
5362
54-
#### 1. Implement the New Data Source
63+
### Adding a New Database Source
5564

5665
We recommend looking at an [example source
5766
implementation](https://github.com/googleapis/genai-toolbox/blob/main/internal/sources/postgres/postgres.go).
@@ -78,7 +87,7 @@ implementation](https://github.com/googleapis/genai-toolbox/blob/main/internal/s
7887
* **Implement `init()`** to register the new Source.
7988
* **Implement Unit Tests** in a file named `newdb_test.go`.
8089

81-
#### 2. Implement the New Tool
90+
### Adding a New Tool
8291

8392
We recommend looking at an [example tool
8493
implementation](https://github.com/googleapis/genai-toolbox/tree/main/internal/tools/postgres/postgressql).
@@ -111,7 +120,7 @@ tools.
111120
* **Implement `init()`** to register the new Tool.
112121
* **Implement Unit Tests** in a file named `newdb_test.go`.
113122

114-
#### 3. Add Integration Tests
123+
### Adding Integration Tests
115124

116125
* **Add a test file** under a new directory `tests/newdb`.
117126
* **Add pre-defined integration test suites** in the
@@ -153,7 +162,7 @@ tools.
153162
[temp-param-doc]:
154163
https://googleapis.github.io/genai-toolbox/resources/tools/#template-parameters
155164

156-
#### 4. Add Documentation
165+
### Adding Documentation
157166

158167
* **Update the documentation** to include information about your new data source
159168
and tool. This includes:
@@ -163,7 +172,7 @@ tools.
163172

164173
* **(Optional) Add samples** to the `docs/en/samples/<newdb>` directory.
165174

166-
#### (Optional) 5. Add Prebuilt Tools
175+
### (Optional) Adding Prebuilt Tools
167176

168177
You can provide developers with a set of "build-time" tools to aid common
169178
software development user journeys like viewing and creating tables/collections
@@ -177,7 +186,7 @@ and data.
177186
[internal/prebuiltconfigs/prebuiltconfigs_test.go](internal/prebuiltconfigs/prebuiltconfigs_test.go)
178187
and [cmd/root_test.go](cmd/root_test.go).
179188

180-
#### 6. Submit a Pull Request
189+
## Submitting a Pull Request
181190

182191
Submit a pull request to the repository with your changes. Be sure to include a
183192
detailed description of your changes and any requests for long term testing

0 commit comments

Comments
 (0)