Contributing to Gato-X¶
This guide explains how to contribute to the Gato-X project.
Getting Started¶
Prerequisites¶
- Python 3.10 or higher
- Git
- A GitHub account
Setting Up the Development Environment¶
- Fork the Gato-X repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/gato-x.git cd gato-x
- Set up a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install in development mode:
pip install -e .
Project Structure¶
The Gato-X codebase is organized into several modules:
gatox/cli/
: Command-line interface componentsgatox/enumerate/
: Repository and organization enumerationgatox/search/
: GitHub code search functionalitygatox/attack/
: Attack capabilitiesgatox/workflow_graph/
: Workflow analysis enginegatox/models/
: Data modelsgatox/github/
: GitHub API interactiongatox/util/
: Utility functionsgatox/configuration/
: Configuration managementgatox/caching/
: Caching and local cache managementgatox/notifications/
: Notification and webhook sending
Example Directory Tree¶
flowchart TD
CLI[cli] --> Main[main.py]
Main --> Attack[attack]
Main --> Enumerate[enumerate]
Main --> Search[search]
Main --> WorkflowGraph[workflow_graph]
Main --> Models[models]
Main --> Utils[util]
Main --> Config[configuration]
Main --> Caching[caching]
Main --> Notifications[notifications]
Development Guidelines¶
Code Style¶
- Use Black for formatting:
black gatox/
- Use ruff for linting:
ruff check
- Use isort for import sorting:
isort gatox/
- Follow PEP8 and add docstrings to all public classes and functions.
Making Changes¶
- Branch from
main
for new features or bugfixes. - Write clear, descriptive commit messages.
- Add or update tests for your changes (see Testing Guidelines).
- Run all tests before submitting a pull request.
Submitting Pull Requests¶
- Ensure your branch is up to date with
main
. - Open a pull request with a clear description of your changes.
- Reference related issues if applicable.
- Be responsive to code review feedback.
Communication¶
- Use GitHub Issues for bug reports and feature requests.
- For significant changes, open an issue to discuss before submitting a PR.
Testing¶
Running Tests¶
To run the test suite:
pytest
Adding Tests¶
When adding new features, please add appropriate tests:
- Unit tests for individual functions
- Integration tests for complex workflows
- Mock tests for GitHub API interactions
Submitting Changes¶
Pull Request Process¶
- Ensure your code follows the project's style guidelines
- Update documentation to reflect your changes
- Add or update tests as necessary
- Submit a pull request with a clear description of the changes
Proposing Significant Changes¶
If you're proposing significant changes to the tool, please open an issue first to discuss the motivation for the changes.
Documentation¶
Updating Documentation¶
When adding or modifying features, please update the relevant documentation:
- Update the README.md if necessary
- Update or add documentation in the docs/ directory
- Update command help text in the CLI code
Reporting Issues¶
If you find a bug or have a feature request:
- Check if the issue already exists in the GitHub issues
- If not, create a new issue with:
- A clear description of the problem
- Steps to reproduce
- Expected behavior
- Actual behavior
- Any relevant logs or screenshots
License¶
By contributing to Gato-X, you agree that your contributions will be licensed under the project's Apache License, Version 2.0.