Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Issue Tracker

A FastAPI-based issue tracking system supporting users, labels, comments, bulk operations, history tracking, and optimistic concurrency control.

Features

  • Create, update, list, filter, bulk update, import from CSV, and view timeline/history for issues
  • Assign and update labels for issues (many-to-many)
  • Assign issues to users (unique email, versioning for concurrency)
  • Add and list comments per issue
  • Bulk update status and labels for multiple issues
  • Track all changes to issues via timeline endpoint
  • Validation for required fields, version conflicts, uniqueness, and format
  • Comprehensive test suite for all major features and edge cases
  • Alembic migrations for schema management

Setup

  1. Clone the repository
  2. Create and activate a virtual environment
    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install dependencies
    pip install -r app/requirements.txt
    
  4. Configure the database
    • Set DATABASE_URL in app/.env to your database connection string (used by the app)
    • Set the database URL in alembic.ini under the sqlalchemy.url field (used by Alembic migrations):
      sqlalchemy.url = postgresql+psycopg2://username:password@localhost:5432/issue_tracker_db
    • Run Alembic migrations if needed:
      alembic upgrade head
      

Running the App

uvicorn app.main:app --reload

API Endpoints

Issues

  • POST /issues/ — Create a new issue
  • GET /issues/ — List all issues (filter by status, assignee)
  • GET /issues/{id} — Get a specific issue
  • PATCH /issues/{id} — Update issue fields (title, description, status, assignee, labels, version)
  • POST /issues/bulk-status — Bulk update status/labels for multiple issues
  • GET /issues/{id}/timeline — Get issue history/events
  • POST /issues/import — Import issues from CSV

Labels

  • Managed via issue PATCH and bulk update endpoints

Users

  • Assign issues to users
  • Unique email constraint
  • Version field for concurrency control

Comments

  • POST /issues/{issue_id}/comments — Add a comment to an issue

Reports

  • GET /report/top-assignees — List top assignees by issue count
  • GET /report/latency — Get average resolution time for closed issues

Models

  • Issue: id, title, description, status, assignee_id, version, created_at, updated_at, resolved_at, labels
  • Label: id, name
  • User: id, name, email, version
  • Comment: id, body, author_id, issue_id, created_at
  • IssueEvent: id, issue_id, field, old_value, new_value, created_at

Testing

Run all tests:

pytest app/tests/

Tests cover creation, update, bulk update, timeline, validation, labels, assignee, listing, filtering, and edge cases.

Usage Notes

  • Always provide the latest version when updating issues or users.
  • Use bulk endpoints for mass updates.
  • Timeline endpoint shows all changes to an issue.
  • All endpoints return detailed error messages for invalid input or conflicts.
  • Labels and assignees are managed via PATCH and bulk endpoints.
  • Timeline/history is available for audit and debugging.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages