Skip to content

Commit a094508

Browse files
kuntalghoshKuntal Ghosh
andauthored
Add AGENTS.md development guide (#4704)
Add a development guide covering repository structure, build/test commands, and PR checklist to improve developer onboarding and AI-assisted development workflows. Task: BABEL-6428 Signed-off-by: Kuntal Ghosh <kuntalgh@amazon.com> Co-authored-by: Kuntal Ghosh <kuntalgh@amazon.com>
1 parent 6ef74be commit a094508

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

AGENTS.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Babelfish Extensions - Development Guide
2+
3+
## Repository Structure
4+
5+
```
6+
babelfish_extensions/
7+
├── contrib/
8+
│ ├── babelfishpg_tsql/ # T-SQL language support
9+
│ ├── babelfishpg_tds/ # TDS protocol support
10+
│ ├── babelfishpg_common/ # Shared data types (geometry, geography, money, etc.)
11+
│ ├── babelfishpg_money/ # money type
12+
│ └── babelfishpg_unit/ # Unit testing framework
13+
├── test/
14+
│ ├── JDBC/input/ # Primary T-SQL test files
15+
│ ├── JDBC/expected/ # Expected output files
16+
│ ├── python/ # Python driver tests + isolation tests (.spec)
17+
│ ├── dotnet/ # .NET driver tests
18+
│ └── odbc/ # ODBC driver tests
19+
└── dev-tools.sh # Developer build and test script
20+
```
21+
22+
## Build and Test
23+
24+
All commands run from the workspace root (parent of both `babelfish_extensions` and `postgresql_modified_for_babelfish`).
25+
26+
### First-time setup
27+
```bash
28+
./babelfish_extensions/dev-tools.sh initpg # Build PostgreSQL engine
29+
./babelfish_extensions/dev-tools.sh initdb # Initialize data directory
30+
./babelfish_extensions/dev-tools.sh initbbf # Initialize Babelfish
31+
```
32+
33+
### Daily development
34+
```bash
35+
./babelfish_extensions/dev-tools.sh buildbbf # Build extensions + restart DB
36+
./babelfish_extensions/dev-tools.sh buildall # Build PG + extensions + restart DB
37+
./babelfish_extensions/dev-tools.sh run_pgindent # Format code (required before PR)
38+
```
39+
40+
### Running tests
41+
```bash
42+
./babelfish_extensions/dev-tools.sh test normal # All JDBC tests (multi-db)
43+
./babelfish_extensions/dev-tools.sh test normal single-db # Single-db mode
44+
./babelfish_extensions/dev-tools.sh test upgrade multi-db test/JDBC/upgrade/15_11 # Upgrade tests
45+
```
46+
47+
### Upgrade testing
48+
```bash
49+
./babelfish_extensions/dev-tools.sh minor_version_upgrade SOURCE_WS # ALTER EXTENSION UPDATE
50+
./babelfish_extensions/dev-tools.sh pg_upgrade SOURCE_WS TARGET_WS # Major version upgrade
51+
```
52+
53+
## PR Checklist
54+
55+
- [ ] `run_pgindent` applied
56+
- [ ] `test normal` passes in both multi-db and single-db modes
57+
- [ ] Upgrade tests pass if DDL or catalog changed
58+
- [ ] `test/python/expected/upgrade_validation/expected_dependency.out` updated if new functions added
59+
- [ ] PR description includes JIRA link, change summary, test scenarios covered, breaking changes
60+
- [ ] Two senior engineer approvals obtained

0 commit comments

Comments
 (0)