Releases: devsmish/BookByteStore
Release list
Release v0.4.6: Add GitHub Actions CI workflow and explicit Ruff linter configuration
🛠️ Feature Enhancements & CI/CD
Automated GitHub Actions Pipeline: Introduced .github/workflows/ci.yml to automatically run code quality and test assertions on every push and pull request to main.
Database-Free Pipeline Execution: Configured CI jobs to run in-memory against fake repositories and mocks, ensuring lightning-fast execution without requiring live MySQL or MongoDB service containers.
🔒 Code Quality & Standards
Explicit Ruff Linter Rules: Created pyproject.toml with explicit rule selection (E for pycodestyle errors, F for Pyflakes logic flaws, I for isort import ordering), eliminating reliance on default tool configurations.
Full Changelog: v0.4.5...v0.4.6
Release v0.4.5: Add Docker Compose setup for MySQL and MongoDB with unified root .env configuration
🔍 Feature Enhancements
Docker Infrastructure: Introduced docker-compose.yml orchestrating containerized mysql (relational store for books, users, purchases) and mongodb (search query logs) services.
Persistent Disk Storage: Configured host path volume mounts storing database data directly at D:\DB for transparent local data management.
Database Setup Automation: Created initialization scripts in docker/ that automatically provision MySQL read and edit user accounts using values from environment variables.
🔒 Security & Access Control
Unified Environment Single-Source: Configured Docker Compose to read variables directly from the repository root .env file, eliminating credential duplication between Docker services and application settings.
Root Password Governance: Extended .env.example with MYSQL_ROOT_PASSWORD and MONGO_ROOT_PASSWORD variables to secure container root access.
Full Changelog: v0.4.4...v0.4.5
Release v0.4.4: Add pytest suite with fake repositories and SQL contract verification
🧪 Testing & Quality Assurance
Automated Pytest Framework: Introduced pytest.ini and requirements-dev.txt to establish an automated testing workflow replacing ad-hoc terminal verification scripts.
SQL-Faithful Fake Repositories: Created reusable test fixtures in tests/conftest.py that enforce database-level semantics including deleted_at IS NULL filtering and stock >= quantity availability checks.
Service Layer Unit Tests: Implemented complete test suites for AuthService, PurchaseService, AdminService, and CatalogService, including explicit verification that user purchase history remains fully rendered post book soft-deletion.
Financial Logic Verification: Added test_money.py validating parse_money() two-decimal precision, ROUND_HALF_UP rounding rules, and invalid string handling.
🛡️ SQL Contract Assertions & Security
Mocked Connection Query Asserts: Added unit tests for BookRepository, UserRepository, and PurchaseRepository on mocked pymysql connections to assert exact SQL syntax (guarding against accidental omission of soft-delete filters).
Authentic Bcrypt Execution: Configured test_user_repository.py to run against real bcrypt.hashpw and bcrypt.checkpw logic to guarantee real-world password security compliance.
Full Changelog: v0.4.3...v0.4.4
Release v0.4.3: Implement soft delete for books to preserve purchase history integrity
🛠️ Feature Enhancements & Data Integrity
Soft Delete for Books: Replaced hard DELETE queries with soft deletion (deleted_at DATETIME NULL), preventing physical row removals and ensuring historical purchase logs (JOIN purchases + books) remain intact.
Catalog Query Isolation: Updated BookRepository queries (get_all, search, get_by_id, update, decrease_stock) to filter against deleted_at IS NULL, hiding soft-deleted items from user browsing and purchasing.
Admin Book Restoration: Introduced get_deleted() and restore() in BookRepository and AdminService, adding 5. Restore deleted book to the admin menu for auditing and restoring soft-deleted titles.
Upsert Isolation on Import: Standardized file import (upsert_by_title_author) to ignore soft-deleted records, creating new active entries rather than modifying deleted rows.
⚠️ Schema & Migration Requirements
Database Migration: Added ALTER TABLE books ADD COLUMN IF NOT EXISTS deleted_at DATETIME NULL DEFAULT NULL to database.py. Requires MySQL ≥ 8.0.29 or MariaDB ≥ 10.0.2.
Full Changelog: v0.4.2...v0.4.3
Release v0.4.2 - Structured Application Logging & Global Exception Handling
🛠️ Feature Enhancements & Observability
Structured Application Logging: Integrated standard logging across services/ and database.py to record domain events, operational state changes, and database errors.
Log Rotation & Configuration: Added RotatingFileHandler support (1 MB max size, 3 backup files) driven by .env variables (LOG_FILE, LOG_LEVEL) and added log files to .gitignore.
Global Crash Diagnostics: Added top-level unhandled exception capture in main.py using logger.exception() to record full stack traces upon application failure.
🛡️ Error Handling & Auditing
Complete Purchase Failure Auditing: Fixed a logging gap where pre-transaction out-of-stock validation checks failed silently in logs; both pre-transaction and in-transaction stock failures are now recorded.
CLI Output Separation: Restricted console log output strictly to WARNING level and above, preserving clean user-facing CLI menus rendered via user_interface/ print() functions.
Full Changelog: v0.4.1...v0.4.2
Release: v0.4.1 - Decimal Precision & Safe Financial Handling
🛠️ Refactoring & Precision Enhancements
Decimal Monetary Handling: Replaced legacy float() input parsing across all 5 entry points with a centralized parse_money() utility. Enforces ROUND_HALF_UP rounding to match MySQL DECIMAL(10,2) column schemas and prevents runtime TypeError when performing operations on pymysql values.
Domain Model Typing: Updated domain models (Book.price, User.balance, Purchase.price, Purchase.total) to strictly enforce Decimal types across application layers.
🛡️ Import & Error Handling
Fault-Tolerant File Import: Standardized import file parsing to silently skip rows containing unparseable price values (e.g., "not_a_price"), ensuring corrupt data rows do not interrupt batch import operations.
Full Changelog: v0.4.0...v0.4.1
Release v0.4.0 - OOP Architecture Overhaul, Services & Repositories
🔍 Feature Enhancements
- **OOP Architecture Overhaul: Refactored core entities (
Book,User,Purchase) to dataclasses inmodels.py. Introduced repository classes (BookRepository,UserRepository,PurchaseRepository) underbookstore_modules/db/to encapsulate database queries and connection handling. - **Dedicated Service Layer: Extracted domain operations into pure business services (
AuthService,CatalogService,PurchaseService,AdminService,SearchLogRepository) underbookstore_modules/services/free of console I/O side effects. - **Decoupled User Interface: Isolated all
input()andprint()calls into dedicated CLI presentation components (ConsoleApp,UserMenu,AdminMenu) underbookstore_modules/user_interface/.
🔒 Security & Access Control
- **Restricted File Ingestion: Moved the bulk book import feature (
import_from_file) from the unauthenticated public menu toAdminService/AdminMenu, ensuring bulk database writes require administrative privileges.
⚠️ Breaking Changes
- **Exception-Driven Business Logic: Replaced console
print()error statements inside business workflows with domain exceptions inheriting fromBookstoreError(UsernameTakenError,InsufficientStockError,BookNotFoundError, etc.). - **Refactored Entry Point: Updated
main.pyto instantiate repositories, services, andConsoleAppvia dependency injection instead of invoking top-level procedural functions.
Full Changelog: v0.3.1...v0.4.0
Release v0.3.1 - User Balance Top-Up
💰 Feature Enhancements
- User Balance Top-Up: Integrated
increase_balance()andget_balance()indb/users.pyalongsidetop_up_balance()inservices/bookstore.pyto allow users to add funds directly to their account. - CLI Menu Update: Added Option
6. Top up balanceto the main user menu.
🔄 Menu & UI Structure
- Option Renumbering: Shifted Option
6. Admin panelto Option7. Admin panelto accommodate the top-up feature.
Full Changelog: v0.3.0...v0.3.1
Release v0.3.0 - Real Book Search, Purchase History & Env-Based Admin Panel
🔍 Feature Enhancements
-
**Real Book Search: Updated db/books.py:search_books() with SQL LIKE filtering against titles and authors. Integrated
-
**services/bookstore.py:search_books() to return matching book records while preserving search query logging to MongoDB.
-
**Purchase History: Introduced db/purchases.py:get_user_purchases() joining purchases and books tables to show purchase date, book
-
**details, quantity, and total cost. Added Option 5. Purchase history to the CLI menu.
🔒 Security & Access Control
-
**Environment-Based Admin Panel: Managed admin privileges strictly via an ADMIN_USERNAMES list in .env to prevent security risks
-
**associated with database flags or registration-time role selection.
-
**Dynamic Menu & CRUD Operations: Automatically grants Option 6. Admin panel (supporting book Add/Edit/Delete actions) only if the * **logged-in user matches an entry in ADMIN_USERNAMES.
⚠️ Breaking Changes
- **Authentication Signature Update: Updated auth.login() to return a (user_id, username) tuple instead of only user_id to enable
- **username-based permission evaluation across the application.
Full Changelog: v0.2.0...v0.3.0
Release v0.2.0 - Password Hashing, DB Resilience & GitHub Templates
🔒 Security Enhancements
- Password Hashing: Integrated
bcrypt(hashpw/checkpw) to ensure passwords are never stored or evaluated in plaintext. - Input Validation: Added strict validation checks to reject empty username and password fields during registration.
🛠️ Reliability & Error Handling
- Database Resilience: Added a custom
DatabaseConnectionErrorindatabase.pyto catchpymysqlandPyMongoErrorexceptions, displaying user-friendly messages instead of raw tracebacks. - Multi-DB Configuration: Standardized
.envparsing for read/edit MySQL split architectures.
⚙️ Developer Experience
- Repository Templates: Added
.github/ISSUE_TEMPLATE/task.mdand.github/PULL_REQUEST_TEMPLATE.mdto standardize team contributions.
Full Changelog: v0.1.0...v0.2.0