Set up Python project with uv environment management and FastAPI stack. Project structure: - src/gondulf/ - Main application package - tests/ - Test suite directory - pyproject.toml - Project configuration with dependencies - README.md - Project documentation - uv.lock - Dependency lock file Dependencies configured: - FastAPI + Uvicorn for web framework - SQLAlchemy for database ORM - pytest + coverage for testing - ruff, black, mypy, flake8 for code quality - Development environment using uv direct execution model All project standards reviewed and implemented per: - /docs/standards/coding.md - /docs/standards/testing.md - /docs/standards/git.md - /docs/standards/development-environment.md - /docs/standards/versioning.md
3.6 KiB
3.6 KiB
Git Workflow Standard
Overview
This project uses trunk-based development for simplicity and continuous integration.
Branch Strategy
Main Branch
main- The primary development branch- Always in a deployable state
- Protected branch requiring review before merge
- All commits must pass CI/CD checks
Feature Development
- Work directly on
mainfor small, low-risk changes - Use short-lived feature branches for larger changes
- Feature branches live maximum 2 days before merging
Branch Naming (When Used)
fix/brief-description- Bug fixesfeature/brief-description- New featuresrefactor/brief-description- Code refactoringdocs/brief-description- Documentation only
Examples:
feature/client-registrationfix/token-expirationdocs/api-endpoints
Commit Message Format
Follow Conventional Commits specification:
<type>(<scope>): <subject>
[optional body]
[optional footer(s)]
Types
feat: New featurefix: Bug fixdocs: Documentation only changesstyle: Code style changes (formatting, missing semicolons, etc)refactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementstest: Adding or fixing testschore: Changes to build process or auxiliary tools
Scope (Optional)
Component or module affected:
auth: Authorization endpointtoken: Token endpointclient: Client registrationadmin: Administrative featuresdb: Database changesconfig: Configuration changes
Examples
feat(client): add self-registration endpoint
Implements dynamic client registration according to
RFC 7591 with rate limiting to prevent abuse.
Closes #12
fix(token): correct expiration time calculation
docs: update README with installation instructions
Pull Request Process (When Using Branches)
- Create branch from latest
main - Make changes with clear, atomic commits
- Ensure all tests pass locally
- Push branch and open pull request
- Ensure CI passes
- Request review if required
- Merge using "Squash and merge" for clean history
Merge Strategy
- Squash and merge for feature branches (maintains clean history)
- Fast-forward only for direct commits to main
- Never use merge commits (no merge bubbles)
Code Review Requirements
All code must be reviewed before merging to main:
- Self-review checklist:
- Tests pass
- Documentation updated
- No commented-out code
- No debug statements
- Follows coding standards
- Peer review for significant changes
Git Hooks (Recommended)
Pre-commit
- Run linter (e.g.,
flake8for Python) - Run formatter (e.g.,
blackfor Python) - Check for secrets/credentials
Pre-push
- Run test suite
- Verify no large files
Release Process
- Ensure all tests pass on
main - Update version in appropriate files
- Create release commit:
chore: release v{version} - Tag the commit:
git tag -a v{version} -m "Release v{version}" - Push tag:
git push origin v{version} - Create GitHub release with release notes
Rewriting History
- Never rewrite history on
main - Only use
git rebaseon local branches before pushing - Use
git commit --amendonly for unpushed commits
Large Files
- Use
.gitignoreto exclude generated files, dependencies, and build artifacts - Never commit:
- Binary files (unless absolutely necessary)
- Credentials or secrets
- Local configuration files
- IDE-specific files
- Log files
- Database files
Repository Maintenance
- Keep repository size under 100MB
- Regularly clean up merged branches
- Archive old issues and pull requests
- Maintain clear README and CONTRIBUTING files