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 is published on PyPI and can also be run directly from the repo. Use whichever invocation matches how you installed it:

  • Installed from PyPI (or pip install .): run commands with cli ...
  • Running directly from the repo without installing: use python -m cli ...

Install from PyPI

pip install bug-tracker-cli

# verify installation
cli --help

Set API_URL to point at your deployment when needed (defaults to the hosted demo), and optionally API_TOKEN if auth is enabled.

Run locally from this repo

# from the project root without installing
python -m cli --help

Project Management

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

# List projects
cli projects list

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

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

Issue Management

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

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

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

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

# Delete an issue
cli issues rm 42

Tag Management

# List tags
cli tags list

# Show tag usage statistics
cli tags list --stats

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

# Delete a tag
cli tags delete --id 5

# Clean up unused tags
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.2.tar.gz (32.6 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.2-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bug_tracker_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 32.6 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.2.tar.gz
Algorithm Hash digest
SHA256 4ef012ef71aadc2ad757dc202f1f06b61bbea337aac8c82a77fb6c690a89151d
MD5 4889fead4a07c33b4f187b05b1df7f8e
BLAKE2b-256 1379fde9047ad60a5b1ab2d1baa638848cba6875e9a40fed210a83206938c6b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bug_tracker_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e519fd97fbe93647c4987b012b2845b1ad0b840e50c5de5056b4fc4c99f1c39b
MD5 440602be52e0ca90c4a76b0fbc23b9b9
BLAKE2b-256 157ef6dd9adee58037398c7e6d185f2205787630e64f8257cbd8725f30ec8d67

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