Thank you for your interest in contributing to Database Modernizer Assessment! This document provides guidelines for contributing to the project.
- Code of Conduct
- Reporting Bugs/Feature Requests
- Getting Started
- Development Workflow
- Branching Strategy
- Commit Message Format
- Pull Request Process
- Code Standards
- Testing Requirements
- Documentation
- Security
- Licensing
This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opensource-codeofconduct@amazon.com with any additional questions or comments.
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can:
- A reproducible test case or series of steps
- The version of our code being used
- Any modifications you've made relevant to the bug
- Anything unusual about your environment or deployment
- Python 3.12+
- Git
- uv (Python package manager)
- Node.js 18+ (for UI development)
- AWS CLI configured with credentials (for cloud deployment)
# Clone repository
git clone https://github.com/aws-samples/sample-aws-genai-db-modernizer.git
cd sample-aws-genai-db-modernizer
# Run setup script (installs deps, pre-commit hooks, validates environment)
./scripts/setup_dev.sh
# Verify installation
uv run python scripts/run_assessment.py --file docs/examples/wordpress/wordpress-collection.jsonThe setup script will:
- Check Python 3.12+ is installed
- Install uv if not present
- Create virtual environment and install all dependencies
- Install pre-commit hooks (formatting, linting, type checking, security scanning)
- Run initial validation
Pre-commit hooks run automatically on every commit to ensure code quality:
- Black - format Python code
- isort - sort imports
- Ruff - lint Python code
- mypy - type checking
- Bandit - security scanning
- markdownlint - lint Markdown files
- Conventional Commits - validate commit message format
- General checks: YAML/JSON syntax, large files, private keys, merge conflicts
If hooks don't run after cloning, install manually:
uv run pre-commit install
uv run pre-commit install --hook-type commit-msgNote: If your PR shows failing CI scans (lint, type check, security), it most likely means you haven't installed the pre-commit hooks locally. Install them with the commands above (or run
./scripts/setup_dev.sh), fix any issues, and re-push your changes.
Before starting work, create an issue describing:
- What you want to build/fix
- Why it's needed
- Proposed approach (for larger changes)
# Fork the repo on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/sample-aws-genai-db-modernizer.git
cd sample-aws-genai-db-modernizer
# Add upstream remote
git remote add upstream https://github.com/aws-samples/sample-aws-genai-db-modernizer.git
# Create feature branch
git checkout -b feat/your-feature-name- Write code following our Code Standards
- Add tests for new functionality
- Update documentation as needed
- Run tests locally before committing
Follow our Commit Message Format. Set up the commit template to guide your messages:
git config commit.template .gitmessageThen commit as usual:
git add .
git commit -m "feat(collector): add CloudWatch metrics collection"git push origin feat/your-feature-nameThen open a Pull Request on GitHub against main.
We use a trunk-based strategy with short-lived feature branches:
| Branch Type | Naming Convention | Purpose | Base Branch |
|---|---|---|---|
| main | main |
Production-ready code | - |
| feature | feat/<description> |
New features | main |
| fix | fix/<description> |
Bug fixes | main |
| hotfix | hotfix/<description> |
Urgent production fixes | main |
| docs | docs/<description> |
Documentation updates | main |
We follow Conventional Commits specification:
<type>(<scope>): <subject>
[optional body]
[optional footer]
| Type | Description | Example |
|---|---|---|
| feat | New feature | feat(collector): add MySQL collector agent |
| fix | Bug fix | fix(api): handle connection timeout errors |
| docs | Documentation only | docs(readme): update installation instructions |
| refactor | Code refactoring | refactor(agent): simplify error handling |
| perf | Performance improvements | perf(collector): optimize schema collection |
| test | Adding or updating tests | test(collector): add contract validation tests |
| chore | Maintenance tasks | chore(deps): update boto3 to 1.29.7 |
| ci | CI/CD changes | ci(github): add contract validation workflow |
Common scopes in this project:
collector- Collector agentsanalysis- Analysis agentsreferee- Referee agentschema-design- Schema design agentsapi- API serverui- Frontend/UIcontracts- Contract models (Pydantic)infra- Infrastructure/deployment
- Use imperative mood: "add" not "added" or "adds"
- Don't end subject with period
- Limit subject line to 50 characters
- Separate subject from body with blank line
- Use body to explain what and why, not how
- Reference issues: Use "Closes #123" or "Fixes #456"
-
Update your branch
git fetch upstream git rebase upstream/main
-
Run all tests
uv run pytest tests/ -v
-
Verify linters pass (pre-commit runs these automatically on commit, but you can run manually):
uv run pre-commit run --all-files
-
Update documentation if needed
Use the same format as commit messages:
feat(collector): add MySQL collector agent with RDS support
fix(api): handle timeout errors in job status endpoint
- Small PR: < 200 lines changed (preferred)
- Medium PR: 200-500 lines changed
- Large PR: > 500 lines changed (consider splitting)
Smaller PRs are reviewed faster and merged more easily.
We follow PEP 8 enforced via pre-commit hooks. On every commit, the following run automatically:
- Black - code formatting
- isort - import sorting
- Ruff - linting
- mypy - type checking
- Bandit - security scanning
If you need to run them manually:
uv run pre-commit run --all-files- Type Hints: Use type hints for all function signatures
- Docstrings: Use Google-style docstrings for public functions
- Error Handling: Handle errors gracefully with specific exception types
- Logging: Use structured logging via
structlog - Constants: Use uppercase for module-level constants
src/
├── agents/ # Pipeline agents (collector, referee, schema_design, load_test)
├── api/ # FastAPI application and routes
├── contracts/ # Pydantic models for agent I/O
├── orchestrator/ # Pipeline orchestration (local + Step Functions)
├── skills/ # Markdown prompts for LLM behavior
├── storage/ # Artifact storage abstraction
├── tools/ # Deterministic tools
│ ├── analysis/ # Workload analysis (DynamoDB, DocumentDB, Redis, OpenSearch)
│ ├── aws/ # AWS service integrations (RDS, S3, SSM)
│ └── database/ # Database-specific tooling (MySQL, PostgreSQL)
└── ui/ # React frontend
- Unit Tests (
tests/unit/) - Test individual functions/tools - Contract Tests (
tests/contract/) - Validate Pydantic model conformance - Integration Tests (
tests/integration/) - Test agent workflows end-to-end
# Run all tests
uv run pytest tests/ -v
# Run with coverage
uv run pytest tests/ --cov=src --cov-report=html
# Run only contract tests
uv run pytest tests/contract/ -vFor end-to-end testing of the full analysis pipeline:
# Run assessment (collect through reality-check):
uv run python scripts/run_assessment.py --file docs/examples/wordpress/wordpress-collection.json
# Resume from existing job:
uv run python scripts/run_assessment.py --job-id <id> --db <name>
# Finalize reality check after LLM response:
uv run python scripts/run_assessment.py --job-id <id> --db <name> --resume-reality-checkThis runs the deterministic pipeline (Collect, Triage, Analyze, Assign, Reality Check) and stops. Schema design and synthesis require LLM reasoning and are handled separately via Claude Code slash commands or --all --llm-mode bedrock.
All contributions should include appropriate documentation:
- Docstrings - All public functions must have docstrings
- README updates - Update relevant README files for new features
- Guide updates - Update implementation guides in
docs/guides/if behavior changes
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public GitHub issue.
See the LICENSE file for our project's licensing. We will ask you to confirm the licensing of your contribution.
By contributing, you agree that your contributions will be licensed under the MIT-0 License.
Looking at the existing issues is a great way to find something to contribute on. Issues labeled good first contribution or help wanted are great places to start.
Breaking changes to contracts (src/contracts/) require special process:
- Create a proposal issue with rationale and impact analysis
- Increment the contract version
- Provide a migration guide
- Update all affected agents
See docs/contracts/agent-contracts-spec.md for details.
- General questions: Create a discussion on GitHub
- Bug reports: Use the bug report issue template
- Feature requests: Use the feature request issue template
Thank you for contributing to Database Modernizer Assessment!