diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 27402aa..ec81452 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -3,7 +3,9 @@ "allow": [ "WebFetch(domain:code.claude.com)", "Bash(npx @anthropic-ai/mcp-builder:*)", - "Bash(npx @modelcontextprotocol/inspector:*)" + "Bash(npx @modelcontextprotocol/inspector:*)", + "Bash(python3:*)", + "Bash(git add:*)" ], "deny": [], "ask": [] diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 5815792..1f83e73 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,21 +1,52 @@ -name: Docker Build and Test +name: Test and Build on: push: - branches: [ main ] + branches: [ main, dev ] pull_request: - branches: [ main ] + branches: [ main, dev ] jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run tests with coverage + run: | + pytest tests/ -v --cov=learning_server --cov-report=term --cov-report=xml + + - name: Upload coverage reports + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml + fail_ci_if_error: false + build: runs-on: ubuntu-latest - + needs: test + steps: - uses: actions/checkout@v3 - + - name: Build Docker image run: docker build -t obsidian-learning-extension:test . - + - name: Test Docker image run: | - docker run --rm obsidian-learning-extension:test python -c "import learning_server; print('Server imports successfully')" \ No newline at end of file + docker run --rm obsidian-learning-extension:test python -c "import learning_server; print('Server imports successfully')" + + - name: Test Docker image starts + run: | + timeout 10s docker run --rm obsidian-learning-extension:test python -c "print('Docker container works')" || true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 868f268..f51a125 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,7 @@ test_mcp_tools.py # Testing .pytest_cache/ .coverage -htmlcov/ \ No newline at end of file +coverage.xml +htmlcov/ +*.pyc +__pycache__/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e621be6..3481973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,19 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Added -- Comprehensive testing suite with 100% tool coverage -- Data directory documentation with structure examples -- Configuration examples for Claude Desktop setup -- Project analysis document with roadmap and recommendations -- Examples directory with setup guides +## [1.0.0] - 2025-11-13 + +### Added - Phase 1: Stabilization +- **Comprehensive test suite** with 43 tests achieving 85% code coverage + - 11 tests for challenge management + - 9 tests for progress tracking + - 11 tests for spaced repetition reviews + - 12 tests for AI analysis features +- **CI/CD Integration** + - Automated testing on GitHub Actions + - Coverage reporting with codecov + - Docker build verification after tests pass +- **Documentation** + - CONTRIBUTING.md with development guidelines + - Data directory documentation with structure examples + - Configuration examples for Claude Desktop setup + - Project analysis document with roadmap (ANALYSIS.md) + - Examples directory with setup guides ### Changed +- Updated GitHub Actions workflow to include testing phase - Updated .gitignore to be more specific about excluded files - Improved data privacy by excluding only JSON files in data directory +- Enhanced CI/CD to run tests before Docker builds + +### Fixed +- Test isolation using temporary directories +- Proper fixture management with pytest ### Removed -- Testing artifacts (TEST_RESULTS.md, test_mcp_tools.py) from git tracking +- Manual testing artifacts from git tracking ## [1.0.0] - 2025-11-13 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ec117ca --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,388 @@ +# Contributing to Obsidian Learning Extension + +Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to the project. + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) +- [Development Setup](#development-setup) +- [Making Changes](#making-changes) +- [Testing](#testing) +- [Submitting Changes](#submitting-changes) +- [Coding Standards](#coding-standards) +- [Project Structure](#project-structure) + +## Code of Conduct + +- Be respectful and inclusive +- Welcome newcomers and help them learn +- Focus on constructive feedback +- Respect different viewpoints and experiences +- Accept responsibility for mistakes + +## Getting Started + +1. **Fork the repository** + ```bash + # Click the 'Fork' button on GitHub + ``` + +2. **Clone your fork** + ```bash + git clone https://github.com/YOUR_USERNAME/obsidian-learning-extension.git + cd obsidian-learning-extension + ``` + +3. **Add upstream remote** + ```bash + git remote add upstream https://github.com/canoo/obsidian-learning-extension.git + ``` + +## Development Setup + +### Prerequisites + +- Python 3.11 or higher +- Docker and Docker Compose (optional, for containerized development) +- Git + +### Local Development + +1. **Create a virtual environment** + ```bash + python3 -m venv venv + source venv/bin/activate # On Windows: venv\Scripts\activate + ``` + +2. **Install dependencies** + ```bash + pip install -r requirements.txt + ``` + +3. **Run tests** + ```bash + pytest tests/ -v + ``` + +4. **Run server locally** + ```bash + python learning_server.py + ``` + +### Docker Development + +1. **Build the image** + ```bash + docker-compose build + ``` + +2. **Run the container** + ```bash + docker-compose up + ``` + +## Making Changes + +### Branch Strategy + +- `main` - Production-ready code +- `dev` - Development branch +- `feature/*` - New features +- `fix/*` - Bug fixes +- `docs/*` - Documentation updates + +### Workflow + +1. **Create a branch** + ```bash + git checkout -b feature/your-feature-name + ``` + +2. **Make your changes** + - Write code following our [coding standards](#coding-standards) + - Add tests for new functionality + - Update documentation as needed + +3. **Test your changes** + ```bash + pytest tests/ -v --cov=learning_server + ``` + +4. **Commit your changes** + ```bash + git add . + git commit -m "feat: add new feature" + ``` + +### Commit Message Convention + +We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification: + +``` +(): + + + +