Skip to main content

CLI for interacting with the Bug Tracker API

Project description

Bug-Tracker

A comprehensive issue tracking system with both web interface and command-line interface, featuring automated tag generation and intelligent assignee suggestions.

Features

  • Web Interface: Modern, responsive web UI for managing projects, issues, and tags
  • Command Line Interface: Full CLI for automation and power users
  • Project Management: Create and organize projects with associated issues
  • Issue Tracking: Complete CRUD operations with filtering and search capabilities
  • Automated Tag Generation: AI-powered tag suggestions based on issue content
  • Smart Assignee Assignment: Intelligent assignee suggestions based on expertise and workload
  • Analytics Dashboard: Visual insights with charts
  • Tag Management: Organize and analyze tag usage across projects

Quick Start

Prerequisites

  • Python 3.8 or higher
  • Virtual environment (recommended)

Installation

  1. Clone the repository:
git clone <repository-url>
cd Bug-Tracker
  1. Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Start the web server:
uvicorn app:app --reload
  1. Open your browser and navigate to http://localhost:8000

Web Interface

The web interface provides:

  • Dashboard (/) - Overview with statistics and charts
  • Projects (/projects) - Manage projects and view associated issues
  • Issues (/issues) - Create, edit, filter, and manage issues
  • Tags (/tags) - Manage tags and view usage analytics

API Documentation

When the server is running, access the interactive API documentation:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Command Line Interface

The CLI provides full functionality for automation and scripting:

Project Management

# Create a project
python -m cli projects add --name "My Project"

# List projects
python -m cli projects list

# Update project name
python -m cli projects update --old-name "Old Name" --new-name "New Name"

# Delete a project
python -m cli projects rm --name "Project Name"

Issue Management

# Create an issue
python -m cli issues add --project-name "My Project" --title "Bug Report" --priority high --status open

# Create issue with auto-features
python -m cli issues add --project-id 1 --title "Feature Request" --priority medium --status open --auto-tags --auto-assignee

# List issues with filters
python -m cli issues list --priority high --status open
python -m cli issues list --project-name "My Project" --tags "frontend,bug"

# Update an issue
python -m cli issues update --id 42 --status closed --assignee "john_doe"

# Delete an issue
python -m cli issues rm 42

Tag Management

# List tags
python -m cli tags list

# Show tag usage statistics
python -m cli tags list --stats

# Rename a tag globally
python -m cli tags rename --old-name "frontend" --new-name "ui"

# Delete a tag
python -m cli tags delete --id 5

# Clean up unused tags
python -m cli tags cleanup

Architecture

Main project Structure

Bug-Tracker/
├── app.py                # FastAPI web application
├── config.py             # Configuration settings
├── requirements.txt      # Python dependencies
├── cli/                  # Command line interface
│   ├── main.py          # CLI commands and logic
│   └── __main__.py      # CLI entry point
├── core/                # Core business logic
│   ├── models.py        # Database models
│   ├── schemas.py       # Pydantic schemas
│   ├── db.py           # Database configuration
│   ├── validation.py   # Data validation
│   ├── automation/     # Automation features
│   │   ├── tag_generator.py      # Auto tag generation
│   │   └── assignee_suggestion.py # Smart assignee assigner
│   └── repos/          # Data access layer
│       ├── projects.py     # Project repository - handles project creation, retrieval, updates, deletion
│       ├── issues.py       # Issue repository - manages issue CRUD, filtering, tag associations, auto-assignment
│       └── tags.py         # Tag repository - tag operations, usage stats, cleanup, renaming
├── web/                 # Web interface
│   ├── api/            # REST API endpoints
│   │   ├── projects.py
│   │   ├── issues.py
│   │   └── tags.py
│   │  
│   ├── templates/      # HTML templates
│   └── static/         # CSS, JavaScript, assets
└── tests/              # Test suite

Technology Stack

  • Backend: FastAPI, SQLAlchemy, SQLite
  • Frontend: HTML5, CSS3, JavaScript, Chart.js
  • CLI: Typer
  • Testing: pytest
  • Automation Features:
    • Tag Generation: Custom keyword-based algorithms
    • Assignee Assignment: Data-driven expertise and workload analysis

Automation Features

Automatic Tag Generation

The system can automatically suggest tags based on issue content:

# Keywords are analyzed from title, description, and logs
Keywords = {
    "bug": ["error", "bug", "fail", "crash", "broken", "issue"],
    "frontend": ["ui", "frontend", "interface", "button", "form", "page"],
    "backend": ["backend", "server", "api", "database", "db"],
    "performance": ["slow", "performance", "timeout", "lag"]
}

Smart Assignee Assignment

Assignee suggestions are based on:

  • Tag expertise (success rate with specific tags)
  • Current workload (number of open issues)

Assignment logic only applies to:

  • Status: "open" (unresolved issues)
  • Priority: "high" (critical issues need immediate attention by best experts)

Database Schema

The system uses SQLite with the following main entities:

  • Projects: Container for organizing issues
  • Issues: Core tracking entity with title, description, log, summary, status, priority, assignee
  • Tags: Categorization system with many-to-many relationship to issues
  • Issue-Tag Association: Junction table for flexible tagging

API Endpoints

Projects

  • GET /projects/ - List all projects
  • POST /projects/ - Create new project
  • GET /projects/{id} - Get project details
  • PUT /projects/{id} - Update project
  • DELETE /projects/{id} - Delete project
  • GET /projects/{id}/issues - Get project issues

Issues

  • GET /issues/ - List issues (with filtering)
  • POST /issues/ - Create new issue
  • GET /issues/{id} - Get issue details
  • PUT /issues/{id} - Update issue
  • DELETE /issues/{id} - Delete issue
  • POST /issues/{id}/auto-assign - Auto-assign issue
  • POST /issues/suggest-tags - Get tag suggestions

Tags

  • GET /tags/ - List all tags
  • DELETE /tags/{id} - Delete tag
  • PATCH /tags/rename - Rename tag globally
  • DELETE /tags/cleanup - Remove unused tags
  • GET /tags/stats/usage - Get usage statistics

Testing

Run the test suite:

# Run all tests
pytest

# Run specific test categories
pytest tests/test_api_*.py      # API tests
pytest tests/test_repo_*.py     # Repository tests
pytest tests/test_cli.py        # CLI tests

Configuration

The application can be configured through environment variables or config.py:

  • DATABASE_URL: Database connection string (default: SQLite)

Development

Code Structure

  • Repository Pattern: Clean separation between business logic and data access through repository classes
  • Schema Validation: Pydantic schemas ensure data integrity
  • Error Handling: Consistent exception handling across CLI and API
  • Separation of Concerns: Clear separation between web, CLI, and core logic

Adding New Features

  1. Define data models in core/models.py
  2. Create Pydantic schemas in core/schemas.py
  3. Implement repository methods in core/repos/
  4. Add API endpoints in web/api/
  5. Add CLI commands in cli/main.py
  6. Create tests in tests/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bug_tracker_cli-0.1.0.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bug_tracker_cli-0.1.0-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file bug_tracker_cli-0.1.0.tar.gz.

File metadata

  • Download URL: bug_tracker_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for bug_tracker_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 486e74db1a05918db6e461ff3f6790320e72c1c546ad34a49d360782b45dee84
MD5 44df019105be96e581780e9b972f1324
BLAKE2b-256 038f178d70259a4d916158b20d421bab53c138d01f278fff5000b5f99a6c1d89

See more details on using hashes here.

File details

Details for the file bug_tracker_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bug_tracker_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 888dda0c84386d39e2062d1ee5d4981355c5dcbe9db3c584e2145307685bc2f8
MD5 f3d02d3e7f8eb5a8caba06092a4c1d02
BLAKE2b-256 e99ef4e7275829abcea2b304c57fe5030787f6fcf2163287c2757b69933b952e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page