Contributing Guidelines
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The OdooConnectorAPI is a RESTful gateway built with FastAPI designed to bridge external applications and Odoo ERP systems. These guidelines outline the technical standards, local development workflow, and security protocols required for contributors to add new features or maintain existing ones. The project emphasizes containerization via Docker and structured deployment using Helm for Kubernetes environments.
Contributors are expected to adhere to the project's dependency management, coding standards, and security reporting procedures to ensure the stability and safety of the API.
Sources: README.md:3-8, SECURITY.md:7-10
Development Environment Setup
Local development requires Python 3.8+ and Docker. The project uses a virtual environment for dependency isolation and specific linting tools to maintain code quality.
Dependency Management
Contributors must install the packages defined in requirements.txt, which includes tools for linting and testing.
| Package | Purpose |
|---|---|
fastapi | Core web framework |
odoorpc | Odoo communication library |
uvicorn | ASGI server for running the app |
flake8 | Linting and style enforcement |
pylint | Static code analysis |
tox | Test automation |
python-dotenv | Environment variable management |
Sources: requirements.txt:1-7, README.md:16-18
Local Execution Flow
The following diagram illustrates the process for setting up a local development environment.
Sources: README.md:20-43
Technical Architecture & Code Standards
API Structure
The application uses FastAPI. Contributions should follow the existing pattern of defining asynchronous endpoints and utilizing odoorpc for Odoo interaction.
@app.get("/get/partners")
async def get_partners() -> Dict[str, Any]:
"""GET endpoint to fetch partners from Odoo."""
try:
odoo = odoorpc.ODOO(ODOO_URL, port=80)
odoo.login(ODOO_DB, ODOO_USERNAME, ODOO_PASSWORD)
# ... logic for res.partner ...
Sources: app/main.py:22-41
Testing Connection Logic
Before submitting changes related to the Odoo backend, contributors should verify connectivity using the provided test scripts.
Sources: odoo/test_odoo_connection.py:5-18
Containerization and Deployment
The project supports both Docker Compose for local orchestration and Helm for Kubernetes.
Docker Configuration
Changes to the environment variable handling or service orchestration must be reflected in the docker-compose.yml file.
| Variable | Description | Default (Local) |
|---|---|---|
ODOO_URL | Hostname of the Odoo server | localhost |
ODOO_DB | Target Odoo database | mydb |
ODOO_USERNAME | Odoo user login | admin |
ODOO_PASSWORD | Odoo user password | admin |
Sources: app/main.py:11-14, docker-compose.yml:9-13
Security Reporting
Security is a high priority for datacosmos-br. Contributors who discover vulnerabilities must follow the responsible disclosure policy.
- Reporting: Email
security@datacosmos-br.orgwith a description, reproduction steps, and logs. - Disclosure: Do not publicly disclose vulnerabilities until the team has addressed the issue.
- Support: Security updates are currently provided for version
1.0.x.
Sources: SECURITY.md:3-33
Contribution Process
- Issue Tracking: Open an issue to discuss proposed changes.
- Pull Requests: Submit a pull request for review.
- Licensing: All contributions are released under the MIT License.
Sources: README.md:76-80
Summary
By following these guidelines, contributors help maintain a high-performance, container-ready API that simplifies Odoo integrations. Proper environment setup, adherence to odoorpc patterns, and strict security reporting are the foundations of this project.