From 7d20673eeae948efd02797422fec76b57943dd9e Mon Sep 17 00:00:00 2001 From: xmaksutx Date: Tue, 17 Feb 2026 23:33:44 +0100 Subject: [PATCH 1/3] Document feature branch workflow and tighten main branch protection - Require feature branches for all PRs (no direct commits to main) - Branch naming convention: NNN-short-description - Branch protection: dismiss stale reviews, require branch up-to-date - CONTRIBUTING.md: add Branching Strategy section and updated PR process Co-Authored-By: Claude Sonnet 4.6 --- CONTRIBUTING.md | 68 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 009dd57..89dc21b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,18 +74,61 @@ Pre-commit hooks run automatically on commit. To run manually: uv run pre-commit run --all-files ``` +## Branching Strategy + +**`main` is protected** — direct commits and force-pushes are blocked. All changes must go through a pull request from a feature branch. + +### Branch Naming + +Use a short numeric prefix followed by a kebab-case description: + +``` +NNN-short-description +``` + +Examples: +``` +001-sql-projection-engine +002-add-postgres-pooling +003-fix-aggregate-null-handling +``` + +### Workflow + +``` +main (protected) + └── 001-my-feature ← work here + └── commits... + └── open PR → review → merge into main +``` + +Never commit directly to `main`. Always: + +```bash +git checkout main && git pull # start from latest main +git checkout -b 042-my-feature # create feature branch +# ... make changes ... +git push -u origin 42-my-feature # push feature branch +gh pr create # open PR targeting main +``` + +Feature branches should be **rebased or merged up-to-date with `main`** before the PR can be merged (enforced by branch protection). + ## Pull Request Process -### 1. Fork and Branch +### 1. Create a Feature Branch -- Fork the repository -- Create a feature branch: `git checkout -b feature/my-feature` +```bash +git checkout main && git pull +git checkout -b NNN-short-description +``` ### 2. Make Changes - Write code following existing patterns - Add tests for new functionality - Update docstrings +- Update `CHANGELOG.md` under `[Unreleased]` - Run quality checks locally ### 3. Commit @@ -108,17 +151,22 @@ git commit -m "docs: add examples for async transactions" ### 4. Test -- Ensure all tests pass -- Verify coverage remains high -- Test against multiple Python versions if possible +- Ensure all tests pass: `uv run pytest` +- Verify no lint errors: `uv run ruff check row_query/ tests/` +- Verify formatting: `uv run ruff format --check row_query/ tests/` +- Check types: `uv run mypy row_query/` -### 5. Submit PR +### 5. Open a PR + +```bash +git push -u origin NNN-short-description +gh pr create --base main +``` -- Push to your fork -- Open pull request against `main` -- Fill out PR template +- Fill out the PR template - Wait for CI to pass - Address review comments +- Keep the branch up-to-date with `main` before merging ## Code Style Guidelines From f7e091a786ccc8134df52eee94a9872882b8cce0 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 17 Feb 2026 23:43:34 +0100 Subject: [PATCH 2/3] Update CONTRIBUTING.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 89dc21b..e9d7123 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,7 +108,7 @@ Never commit directly to `main`. Always: git checkout main && git pull # start from latest main git checkout -b 042-my-feature # create feature branch # ... make changes ... -git push -u origin 42-my-feature # push feature branch +git push -u origin 042-my-feature # push feature branch gh pr create # open PR targeting main ``` From b0ce01d13e8e4bd3ee66b69e0047111ff7d8862e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 22:44:18 +0000 Subject: [PATCH 3/3] Initial plan