Xlorep DarkHelm e539f9b0d8
Some checks failed
CICD / Build and Push CICD Images (push) Successful in 14m35s
CICD / Build CICD Image Failure Postmortem (push) Has been skipped
CICD / Dependency Audits (Informational) (push) Successful in 3m46s
CICD / Source Checks (push) Successful in 8m32s
CICD / Source Lanes Failure Postmortem (push) Has been skipped
CICD / CICD Tests Complete (push) Successful in 2s
CICD / Build Release Images (push) Failing after 3m4s
CICD / Build Tester Images (push) Successful in 37m6s
CICD / Production Images Complete (push) Failing after 8s
CICD / Runtime Black-Box Integration Tests (push) Has been skipped
CICD / End-to-End Tests (push) Has been skipped
CICD / Integration Tests Failure Postmortem (push) Has been skipped
CICD / Production Image Failures Postmortem (push) Successful in 20s
CICD / E2E Tests Failure Postmortem (push) Has been skipped
CICD / Promote Staging Images To Release (push) Has been skipped
ci: consolidate cicd workflow lanes, clean up helpers, and align CI docs (#86)
## Summary
This PR simplifies the CICD workflow by merging related lanes, reducing duplicated script logic, and keeping the same overall pipeline behavior and gates. It also updates CI documentation to match the new job topology.

## What Changed

### Workflow consolidation
- Merged base and complete CICD image publication into one producer job:
  - Build and Push CICD Images
- Merged dependency audits into one informational lane:
  - Dependency Audits (Informational)
- Merged runtime image build lanes into one release producer:
  - Build Release Images
- Merged tester image build lanes into one tester producer:
  - Build Tester Images

### Dependency/gate rewiring
- Updated downstream needs to consume merged producers.
- Kept output contracts for deployable and tester image references.
- Updated production and postmortem gates to the new job IDs.

### Cleanup/simplification
- Removed duplicate helper-function definition(s) in CICD scripts.
- Replaced a manual docker login retry loop with existing retry helper usage.
- Removed redundant shell option declarations where behavior was unchanged.
- Removed one unused E2E environment variable.

### Documentation alignment
- Updated CI architecture documentation to reflect merged workflow lanes.
- Updated troubleshooting guidance to reference current job sequencing.

## Why
- Reduce job startup overhead on self-hosted runners.
- Keep behavior consistent while lowering workflow complexity.
- Improve maintainability by removing duplicated/unused script fragments.
- Keep docs in sync with operational workflow reality.

## Validation
- Workflow file checks passed with pre-commit.
- Documentation checks passed with pre-commit (including markdownlint/prettier).
- No diagnostics/errors reported for updated workflow/docs files.

## Risk and Impact
- Low-to-medium operational risk due to job-ID/needs rewiring.
- Mitigated by preserving output keys consumed by integration and e2e lanes.
- Audit lane remains informational-only (non-blocking), same intent as before.

Co-authored-by: copilotcoder <copilotcoder@darkhelm.org>
Reviewed-on: #86
2026-07-17 17:14:00 -04:00
2025-10-18 09:14:10 -04:00
2025-10-18 09:14:10 -04:00

Plex Playlist Project

A full-stack application for managing Plex playlists with a FastAPI backend and Vue.js frontend.

Architecture

  • Backend: Python 3.14 + FastAPI + uv + ruff
  • Frontend: TypeScript + Vue.js + Vite
  • Database: PostgreSQL 16
  • Containerization: Docker + Docker Compose

Deployable Runtime Contract

Deployable image requirements are defined in:

These documents define backend/frontend runtime boundaries, startup and health behavior expectations, environment contracts, and disallowed non-runtime tooling classes in deployable artifacts.

Development Setup

Prerequisites

  • Docker and Docker Compose
  • Git
  • pre-commit (for development)

Code Quality Tools

This project uses comprehensive linting and formatting:

Backend (Python):

  • ruff - Fast Python linter and formatter
  • pyright - Type checking
  • pydoclint - Docstring linting (Google style)

Frontend (TypeScript/Vue):

  • eslint - Linting with Vue and TypeScript support
  • prettier - Code formatting
  • vue-tsc - Vue TypeScript checking
  • eslint-plugin-tsdoc - TSDoc documentation linting

Task Runner:

  • poethepoet - Unified task runner for development workflows

General:

  • pre-commit - Git hooks for automated quality checks
  • TOML formatting and validation

Unified Development with Poe

This project uses Poe the Poet for streamlined development:

# Complete setup (installs deps, starts dev environment)
poe setup

# Code quality (format, lint, type-check all code)
poe ci-quick

# Run all tests
poe test-all

# See all available tasks
poe --help

Manual Setup (Alternative)

pip install pre-commit
pre-commit install

Quick Start

Clone the repository, then choose one of these startup paths.

Unified Development

# Complete setup and start development environment
poe setup

# Or manually:
cd backend
pip install -e .
poe dev-env-start

Traditional Setup

# Backend development
cd backend
pip install -e .

# Frontend development
cd frontend
npm install
npm run dev

Docker Development

# Using Poe (recommended)
poe docker-dev-up

# Or directly
docker compose -f compose.dev.yml up --build

Production Build

poe docker-prod-up
# Or: docker compose up --build

Running in Production Mode

docker compose up --build -d

This will start:

  • PostgreSQL database on port 5432
  • FastAPI backend on port 8000
  • Vue.js frontend on port 80

Project Structure

plex-playlist/
├── backend/                 # FastAPI backend
├── frontend/               # Vue.js frontend
│   └── nginx.conf          # Nginx configuration
├── Dockerfile.backend      # Backend Docker image
├── Dockerfile.frontend     # Frontend Docker image
├── compose.yml             # Production Docker Compose
├── compose.dev.yml         # Development Docker Compose override
└── README.md

CI Operations

For Gitea Actions runner image mirror maintenance, use:

  • source scripts/gitea-actions/repair_runner_mirror.xsh
  • source scripts/gitea-actions/check_runner_images.xsh (checks ubuntu:22.04, GHCR act image, local mirror, and Renovate image)
  • source scripts/gitea-actions/collect_runner_diagnostics.xsh [since] [trace_id]

For setup-stage failures with sparse logs, use:

  • source scripts/gitea-actions/runner-prechange-capture.xsh [tail_lines]
  • source scripts/gitea-actions/diagnose_runner_startup.xsh

For full troubleshooting context, see docs/GITEA_ACTIONS_TROUBLESHOOTING.md.

Environment Variables

Backend

  • DATABASE_URL: PostgreSQL connection string
  • BACKEND_REQUIRED_PYTHON: Runtime policy baseline (3.14 default)
  • ENVIRONMENT: development or production
  • RELOAD: Enable uvicorn auto-reload (development only)

Frontend

  • No required runtime environment variables for production nginx serving

Database

The PostgreSQL database is configured with:

  • Database: plex_playlist
  • User: plex_user
  • Password: plex_password

Development Workflow

  1. Make changes to your code
  2. The development containers will automatically reload:
    • Backend: uvicorn with --reload flag
    • Frontend: Vite dev server with hot module replacement

API Documentation

When running, the FastAPI automatic documentation is available at:


Manual Setup (if not using Docker)

Backend Setup (FastAPI, Python 3.14, uv, ruff, pyright)

1. Create and activate the uv virtual environment

cd backend
uv venv .venv
source .venv/bin/activate

2. Install dependencies

uv sync --all-groups

3. Install dev tools

uv run poe format
uv run poe lint
uv run poe test

4. Project structure

  • src/backend/ - FastAPI application code
  • tests/ - Test suite
  • pyrightconfig.json - Pyright type checking config
  • pyproject.toml - Ruff, pytest, and task configuration

5. Run the development server

uv run uvicorn backend.main:app --reload --app-dir src

Frontend Setup (Vue 3, Vite, TypeScript)

1. Create the project

cd frontend
npm create vite@latest . -- --template vue-ts
npm install

Edit tsconfig.json and set:

{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noFallthroughCasesInSwitch": true
  }
}

3. Run the frontend

npm run dev

Documentation

Development & Workflow

Architecture & CI/CD

  • CI/CD Multi-stage Build
    • Docker multi-stage build strategy, architecture decisions, and performance optimizations
  • CI/CD Troubleshooting Guide
    • Comprehensive troubleshooting, optimization decisions, and performance monitoring for Docker builds and E2E testing
  • CI/CD Success Summary
    • Complete validation results and performance metrics for the optimized pipeline

Dependency Management & Automation

  • Renovate Bot Setup
    • Automated dependency updates with Renovate for Python, Node.js, and Docker dependencies

Operations & Troubleshooting

See the backend/ and frontend/ folders for more details.

Description
This is my completely remade (again) version of my daily playlist generator.
Readme 4.7 MiB
Languages
Xonsh 39.4%
Shell 28.5%
Python 19.6%
TypeScript 10.2%
JavaScript 1.9%
Other 0.4%