Skip to content

refactor(env): Phase 5 - Migrate media tier to env-tier-media anchor - #353

Closed
POWERFULMOVES wants to merge 1 commit into
mainfrom
env-consolidation-media-tier
Closed

POWERFULMOVES wants to merge 1 commit into
mainfrom
env-consolidation-media-tier

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Dec 24, 2025

Copy link
Copy Markdown
Owner

Summary

Phase 5 of the 6-tier environment consolidation. Migrates 10 media services from legacy x-env-legacy pattern to <<: *env-tier-media anchor.

Services Migrated

  • ultimate-tts-studio - TTS synthesis engine
  • flute-gateway - Voice communication layer
  • ffmpeg-whisper - Media transcription
  • media-video - Video analysis (YOLO)
  • media-audio - Audio analysis
  • channel-monitor - YouTube channel watcher
  • invidious - YouTube proxy
  • invidious-companion - Invidious helper
  • grayjay-plugin-host - Streaming plugin host
  • grayjay-server - Streaming server

Security Improvement

Media tier services now only receive:

  • MinIO credentials (for media storage)
  • NATS URL (for event bus)
  • Whisper/YOLO model configs
  • Invidious keys
  • NO external LLM API keys

Files Changed

  • pmoves/docker-compose.yml - Migrated 10 services
  • pmoves/env.tier-media.example - Created with media-specific vars

Testing

cd pmoves && docker compose config > /dev/null && echo "Valid"

Related PRs

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Simplified service environment configuration management through consolidated settings.
  • Documentation

    • Added media tier environment configuration template with service defaults and examples.

✏️ Tip: You can customize this high-level summary in your review settings.

Migrates 10 media services from legacy env_file to tier-based anchor:
- ultimate-tts-studio
- flute-gateway
- ffmpeg-whisper
- media-video
- media-audio
- channel-monitor
- invidious
- invidious-companion
- grayjay-plugin-host
- grayjay-server

Also creates env.tier-media.example with media-specific vars.
Media tier services handle audio/video processing and connect to
internal storage (MinIO) and message bus (NATS), but should NOT
have direct access to external LLM API keys.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Dec 24, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This change consolidates environment variable loading in the Docker Compose configuration by replacing individual per-service env_file declarations with a shared tier-based anchor merge (<<: *env-tier-media) across multiple services. A new example environment configuration file is introduced defining media tier settings.

Changes

Cohort / File(s) Summary
Docker Compose environment consolidation
pmoves/docker-compose.yml
13+ services updated: ultimate-tts-studio, flute-gateway, invidious-companion, invidious, grayjay-plugin-host, grayjay-server, channel-monitor, pmoves-yt, invidious-companion-proxy, and duplicated service instances. All env_file array declarations removed and replaced with <<: *env-tier-media anchor merge for streamlined environment configuration.
New media tier example configuration
pmoves/env.tier-media.example
New file introducing media tier environment variables: MinIO storage settings, NATS URL, Whisper transcription options, YOLO media analysis configuration, TTS settings, Supabase integration, Channel Monitor ingestion, Invidious keys, and Grayjay URLs. Includes inline comments and placeholder guidance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Environment anchors, unified and neat,
No more scattered env_file repeats!
Tier-based merges make configs so sweet,
Where secrets blend together complete.
Media tier ready, the circle is round! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes summary of changes, testing command, and related PR context, but lacks documented Testing section output and most required checklist items. Provide actual test output from the docker compose config validation and complete the required checklist items (CHIT Contract Check, contract updates, documentation, and review coordination).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: migrating media services to a new environment anchor pattern in Phase 5 of the consolidation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch env-consolidation-media-tier

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pmoves/docker-compose.yml (1)

33-38: Review anchor pattern application, but reconsider expanded profile usage against coding guidelines.

The 11 media tier services have been correctly migrated to use the x-env-tier-media anchor pattern, and env.tier-media.example exists. However, the services use multiple custom profiles (orchestration, agents, yt, invidious, grayjay, gpu, tts) that extend beyond the coding guideline specifying only Compose profiles data and workers should be used. Either align the profiles with the guideline or update the guideline to document the extended profile strategy.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 332258c and 0533b63.

📒 Files selected for processing (2)
  • pmoves/docker-compose.yml
  • pmoves/env.tier-media.example
🧰 Additional context used
📓 Path-based instructions (1)
pmoves/**/docker-compose.yml

📄 CodeRabbit inference engine (pmoves/AGENTS.md)

Use Compose profiles (data, workers) to scope what runs locally in docker-compose.yml

Files:

  • pmoves/docker-compose.yml
🧠 Learnings (5)
📚 Learning: 2025-12-07T11:03:53.415Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/AGENTS.md:0-0
Timestamp: 2025-12-07T11:03:53.415Z
Learning: Applies to pmoves/**/docker-compose.yml : Use Compose profiles (`data`, `workers`) to scope what runs locally in docker-compose.yml

Applied to files:

  • pmoves/docker-compose.yml
📚 Learning: 2025-12-15T12:03:17.291Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T12:03:17.291Z
Learning: Applies to pmoves/env.shared.example : Copy env.shared.example → env.shared and fill in secrets; never commit real secrets in env.shared

Applied to files:

  • pmoves/env.tier-media.example
📚 Learning: 2025-12-07T11:03:53.415Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/AGENTS.md:0-0
Timestamp: 2025-12-07T11:03:53.415Z
Learning: Applies to pmoves/docs/PMOVES.AI PLANS/{JELLYFIN_BRIDGE_INTEGRATION.md,JELLYFIN_BACKFILL_PLAN.md,Enhanced Media Stack with Advanced AudioVideo Analysis/**} : Jellyfin integration runbooks live under `pmoves/docs/PMOVES.AI PLANS/` (see `JELLYFIN_BRIDGE_INTEGRATION.md`, `JELLYFIN_BACKFILL_PLAN.md`, and `Enhanced Media Stack with Advanced AudioVideo Analysis/`)

Applied to files:

  • pmoves/env.tier-media.example
📚 Learning: 2025-12-07T11:03:53.415Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/AGENTS.md:0-0
Timestamp: 2025-12-07T11:03:53.415Z
Learning: Applies to pmoves/**/environment.yml : Preferred Python: Conda 3.11+ (env name: `PMOVES.AI` or `pmoves-ai`); use `environment.yml` at repo root for setup

Applied to files:

  • pmoves/env.tier-media.example
📚 Learning: 2025-12-07T11:03:07.638Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-07T11:03:07.638Z
Learning: Applies to **/pmoves/**/*{qwen,gemma,audio,summary}*.py : Integrate Qwen2-Audio provider and add Gemma summaries to PMOVES.YT endpoints

Applied to files:

  • pmoves/env.tier-media.example
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (python)
🔇 Additional comments (5)
pmoves/env.tier-media.example (2)

1-18: LGTM! Clear security boundaries and credential handling.

The header clearly documents that media tier services do not receive external LLM API keys, and MinIO credentials are properly marked as REQUIRED with instructions to populate from env.tier-data.

Based on learnings, this follows the established pattern: copy env.tier-media.example → env.tier-media and fill in secrets; never commit real secrets.


1-6: Documentation inconsistency: 11 services migrated, not 10.

The header lists 11 services including pmoves-yt, but the PR summary states "migrated 10 media services" and omits pmoves-yt from the list. The code correctly migrates all 11 services.

pmoves/docker-compose.yml (3)

33-38: LGTM! Media tier anchor correctly isolates credentials.

The anchor definition follows the established tier-based pattern and ensures media services receive only media-specific credentials (MinIO, NATS, Whisper, Invidious keys) without access to external LLM API keys stored in env-tier-llm.


412-412: LGTM! Services correctly migrated to media tier anchor.

Services ultimate-tts-studio, flute-gateway, ffmpeg-whisper, media-video, and media-audio are properly migrated to use the shared *env-tier-media anchor while maintaining their inline environment configurations.

Also applies to: 449-449, 527-527, 553-553, 578-578


602-602: LGTM! Remaining media services successfully migrated.

Services pmoves-yt, channel-monitor, invidious-companion, invidious, grayjay-plugin-host, and grayjay-server are correctly migrated to the media tier anchor pattern, completing the Phase 5 consolidation.

Also applies to: 640-640, 1324-1324, 1348-1348, 1391-1391, 1406-1406

Comment on lines +45 to +49
# ---------------------------------------------------------------------------
# Supabase (internal)
# ---------------------------------------------------------------------------
SUPABASE_URL=http://supabase_kong_PMOVES.AI:8000
SUPABASE_SERVICE_ROLE_KEY=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Mark SUPABASE_SERVICE_ROLE_KEY as REQUIRED.

Line 49 defines SUPABASE_SERVICE_ROLE_KEY but doesn't mark it as REQUIRED, unlike MinIO credentials (lines 16-17) and Invidious keys (lines 61-62). Services like flute-gateway reference this variable, so it should be marked to prevent runtime failures.

🔎 Proposed fix
 SUPABASE_URL=http://supabase_kong_PMOVES.AI:8000
-SUPABASE_SERVICE_ROLE_KEY=
+SUPABASE_SERVICE_ROLE_KEY=  # REQUIRED: Set from env.tier-data or env.tier-api
🤖 Prompt for AI Agents
In pmoves/env.tier-media.example around lines 45 to 49,
SUPABASE_SERVICE_ROLE_KEY is declared but not marked as REQUIRED; update the
file so SUPABASE_SERVICE_ROLE_KEY is explicitly labeled REQUIRED (consistent
with the MinIO and Invidious entries) — add a comment or suffix "REQUIRED" on
the SUPABASE_SERVICE_ROLE_KEY line and/or include a placeholder value comment to
indicate it must be provided by deployers.

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Superseded by #354 which includes all remaining tier migrations

@POWERFULMOVES
POWERFULMOVES deleted the env-consolidation-media-tier branch March 7, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant