Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0
Thank you for your interest in contributing to the GenAI Intelligent Document Processing accelerator! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- Development Workflow
- Pull Request Process
- Make Commands
- Coding Standards
- Documentation
- Reporting Bugs/Feature Requests
- AWS Specific Considerations
- Security issue notifications
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.
-
Prerequisites:
- Bash shell (Linux, MacOS)
- AWS CLI
- AWS SAM CLI
- Python 3.12 or later
- Docker
-
Fork and Clone the Repository:
git clone <repository-url> genaiic-idp-accelerator cd genaiic-idp-accelerator
-
Install Dependencies and test local build:
See Build Deployment Assets from Source Code
Familiarize yourself with the project structure:
config_library/: Configuration templates for different processing patternsdocs/: Documentation fileslib/idp_common_pkg/: Core functionality library for IDPnotebooks: Notebooks demonstrating use of idp_common python package.patterns/: Implementation of document processing patternssamples/: Sample documents for testingscripts/: Utility scripts for development, testing, and deploymentsrc/: Source code for the applicationlambda/: AWS Lambda functionsui/: Web UI components
-
Create a branch from
developfor your work:git checkout -b feature/your-feature-name
Use prefixes like
feature/,fix/,docs/to indicate the type of change.
- Make your changes in the appropriate files
- Keep changes focused on a single issue or feature
- Write/update tests as necessary
- Ensure code passes linting rules:
- For Python code:
ruffis configured for this project - For UI code: ESLint is configured in
src/ui/.eslintrc.json
- For Python code:
-
Local Testing:
# Run all tests with make make test # Or run tests manually: # Run Python unit tests pytest lib/idp_common_pkg/tests/ # Verify UI code passes linting checks make ui-lint # Or manually: cd src/ui/ && npm run lint
-
Integration Testing:
- Deploy your changes to a test environment
- Test with sample documents (see
samples/directory) - Verify results in output bucket and CloudWatch logs
- Update Documentation: Ensure all documentation affected by your changes is updated
- Run Tests: Verify that your changes pass all tests
- Create a Pull Request: Submit a PR with a clear description of:
- What the changes do
- Why the changes are needed
- Any relevant context or considerations
- Address Review Feedback: Be responsive to review comments and make requested changes
- Merge: Once approved, your contribution will be merged
The project uses make to simplify common development tasks. Run make or make all to execute the default lint and test workflow.
Tip: Run
make helpto see a quick reference of all available targets with descriptions, organized by category.
| Command | Description |
|---|---|
make setup |
Install all packages into your current Python environment (no venv) |
make setup-venv |
Create .venv virtual environment and install all packages into it |
| Command | Description |
|---|---|
make lint |
Run all linting: ruff, formatting, ARN partition checks, buildspec validation, UI lint, codegen check |
make fastlint |
Quick lint without UI checks |
make ruff-lint |
Run ruff linting with auto-fix |
make format |
Format Python code with ruff |
make lint-cicd |
CI/CD version — checks only, no modifications |
make validate-buildspec |
Validate AWS CodeBuild buildspec files |
make check-arn-partitions |
Check CloudFormation templates for hardcoded ARN partitions (GovCloud compatibility) |
| Command | Description |
|---|---|
make typecheck |
Run type checks with basedpyright |
make typecheck-stats |
Type checks with detailed statistics |
make typecheck-pr |
Type check only files changed vs TARGET_BRANCH (default: main) |
| Command | Description |
|---|---|
make all |
Run lint + test (default target) |
make test |
Run all tests (idp_common, cli, sdk, capacity, config library) |
make test-cli |
Run only IDP CLI tests |
make test-config-library |
Run only config library validation tests |
make test-capacity |
Run only capacity planning tests |
make test-capacity-coverage |
Run capacity planning tests with coverage report |
| Command | Description |
|---|---|
make ui-start |
Start UI dev server (requires STACK_NAME for .env generation from stack outputs) |
make ui-lint |
Run UI linting with checksum caching (skips if unchanged) |
make ui-build |
Build UI for production |
Example: Start UI with auto-configured environment:
make ui-start STACK_NAME=my-idp-stack| Command | Description |
|---|---|
make codegen |
Regenerate GraphQL types and operations |
make codegen-check |
Verify GraphQL codegen output is up-to-date |
make classes-from-bda |
Generate standard class catalog from BDA standard blueprints |
| Command | Description |
|---|---|
make commit |
Lint, test, auto-generate commit message, commit, and push |
make fastcommit |
Fast lint only, auto-generate commit message, commit, and push |
| Command | Description |
|---|---|
make version V=x.y.z |
Update version across all packages (PEP 440 validated) |
| Command | Description |
|---|---|
make docs |
Build and serve the documentation site locally |
make docs-setup |
One-time docs site setup (symlinks + npm install) |
make docs-build |
Build documentation site (no serve) |
make docs-deploy |
Deploy docs to GitHub Pages (from local build) |
| Command | Description |
|---|---|
make dsr |
Run full DSR workflow (setup → scan → optional fix) |
make dsr-setup |
Set up DSR tool |
make dsr-scan |
Run DSR security scan |
make dsr-fix |
Run DSR interactive fix |
- Python: Follow PEP 8 style guidelines
- JavaScript/TypeScript: Follow the ESLint configuration in the project
- Documentation: Update relevant documentation for any changes to functionality
- Commit Messages: Write clear, descriptive commit messages
- Versioning: Follow semantic versioning principles
- Update
README.mdwhen adding significant features - Add detailed documentation to
/docsfor new patterns or major features - Include code comments for complex logic or non-obvious implementations
- Update configuration examples if you modify the configuration structure
We welcome you to use the GitHub issue tracker to report bugs or suggest features for the GenAIIDP solution.
Important: This repository is specifically for issues related to the GenAIIDP accelerator solution, not the underlying AWS services it uses (such as Amazon Bedrock Data Automation (BDA), Amazon Bedrock Foundational Models, Amazon Bedrock Knowledge Bases, Amazon Textract, etc.).
-
For GenAIIDP Solution Issues: Use this GitHub repository
- Deployment issues with the CloudFormation templates
- Bugs in the Step Functions workflows
- Issues with the Web UI
- Requests for new document processing features specific to this solution
-
For AWS Service Issues: Contact AWS Support or relevant AWS forums
- Performance of Amazon Bedrock models
- Amazon Textract extraction quality
- Service quotas or throttling issues
- Feature requests for AWS services
We provide issue templates to make this process easier:
- Bug Report Template - Use this template when reporting a bug
- Feature Request Template - Use this template when suggesting new functionality
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. Details like these are incredibly useful:
- 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
For feature requests:
- Clearly describe the feature and its value
- Provide context on how it fits with the project's goals
- Include details on potential implementation approaches if possible
- Cost Awareness: Consider the cost implications of your changes
- Security: Follow AWS security best practices
- Region Compatibility: Ensure changes work across supported AWS regions
- Service Quotas: Be aware of AWS service quotas that may affect your implementation
- IAM Permissions: Only request the minimum necessary permissions for new functionality
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.
Thank you for contributing to the GenAI Intelligent Document Processing accelerator!