Files
temporal-ai-agent/CONTRIBUTING.md
Steve Androulakis eb06cf5c8d Enhance Dev Experience and Code Quality (#41)
* Format codebase to satisfy linters

* fixing pylance and ruff-checked files

* contributing md, and type and formatting fixes

* setup file capitalization

* test fix
2025-06-01 08:54:59 -07:00

4.4 KiB

Contributing to the Temporal AI Agent Project

This document provides guidelines for contributing to temporal-ai-agent. All setup and installation instructions can be found in ./SETUP.md.

Getting Started

Code Style & Formatting

We use black for code formatting and isort for import sorting to maintain a consistent codebase.

  • Format code:
    poetry run poe format
    
    Or manually:
    poetry run black .
    poetry run isort .
    
    Please format your code before committing.

Linting & Type Checking

We use mypy for static type checking and other linters configured via poe the poet.

  • Run linters and type checks:
    poetry run poe lint
    
    Or manually for type checking:
    poetry run mypy --check-untyped-defs --namespace-packages .
    
    Ensure all linting and type checks pass before submitting a pull request.

Testing

Comprehensive testing is crucial for this project. We use pytest and Temporal's testing framework.

  • Install test dependencies (if not already done with poetry install --with dev):
    poetry install --with dev
    
  • Run all tests:
    poetry run pytest
    
  • Run tests with time-skipping (recommended for faster execution, especially in CI):
    poetry run pytest --workflow-environment=time-skipping
    

For detailed information on test categories, running specific tests, test environments, coverage, and troubleshooting, please refer to:

Ensure all tests pass before submitting a pull request.

Making Changes

Adding New Tools or Goals

If you're looking to extend the agent's capabilities:

  1. Create your tool implementation in the tools/ directory.
  2. Register your tool and associate it with relevant goals. For detailed instructions, please see:

General Code Changes

  • Follow the existing code style and patterns.
  • Ensure any new code is well-documented with comments.
  • Write new tests for new functionality or bug fixes.
  • Update existing tests if necessary.

Submitting Contributions

Pull Requests

When you're ready to submit your changes:

  1. Push your branch to the remote repository.
  2. Open a Pull Request (PR) against the main branch.
  3. Describe your changes: Clearly explain what you changed and why. Reference any related issues.
  4. Ensure tests pass: All CI checks, including tests and linters, must pass. The command poetry run pytest --workflow-environment=time-skipping is a good one to run locally.
  5. Request review: Request a review from one or more maintainers.

Reporting Bugs

If you encounter a bug, please:

  1. Search existing issues: Check if the bug has already been reported.
  2. Open a new issue: If not, create a new issue.
    • Provide a clear and descriptive title.
    • Include steps to reproduce the bug.
    • Describe the expected behavior and what actually happened.
    • Provide details about your environment (OS, Python version, Temporal server version, etc.).
    • Include any relevant logs or screenshots.

Suggesting Enhancements

We welcome suggestions for new features or improvements!

  1. Search existing issues/discussions: See if your idea has already been discussed.
  2. Open a new issue:
    • Use a clear and descriptive title.
    • Provide a detailed explanation of the enhancement and its benefits.
    • Explain the use case or problem it solves.
    • Include any potential implementation ideas if you have them.

Key Resources