Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements Feature 021: Configuration Environment Variable Consolidation, which migrates from a split INI/env configuration model to a unified env-first JSON-based approach. This prepares the codebase for the upcoming Orchestrator API integration while maintaining backward compatibility.
Key Changes:
- Implements env-first configuration with JSON environment variables (STORAGE_PATHS, PUBLISHERS, EMAIL_SERVER, etc.)
- Adds comprehensive JSON parsing infrastructure with security features (secret redaction, validation)
- Maintains backward compatibility with INI-based configuration through fallback logic with deprecation warnings
Reviewed changes
Copilot reviewed 54 out of 54 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
publisher_v2/src/publisher_v2/config/loader.py |
Core implementation: JSON parsing helpers, env var loaders, precedence logic, deprecation warnings |
publisher_v2/src/publisher_v2/web/service.py |
Updated to make CONFIG_PATH optional when env vars are set |
publisher_v2/tests/config/* |
New comprehensive test suite for JSON helpers, env loaders, and integration tests |
publisher_v2/tests/conftest.py |
Enhanced test isolation with env var clearing and dotenv patching |
publisher_v2/tests/web/* |
Updated web tests for new config loading behavior |
publisher_v2/tests/test_config_*.py |
Updated existing config tests to clear env-first vars |
dotenv.v2.example |
New comprehensive env-first configuration template |
docs_v2/05_Configuration/CONFIGURATION.md |
Updated with env-first documentation and migration guide |
docs_v2/08_Features/021_* |
Complete feature documentation including design, stories, QA reviews |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| username=cp.get("Instagram", "name"), | ||
| password=os.environ.get("INSTA_PASSWORD", ""), | ||
| session_file="instasession.json", | ||
| publishers_source = "PUBLISHERS" |
There was a problem hiding this comment.
Variable publishers_source is not used.
| else: | ||
| # Fallback to INI [Content] toggles | ||
| ini_sections_used.append("Content") | ||
| publishers_source = "INI" |
There was a problem hiding this comment.
Variable publishers_source is not used.
| import os | ||
| from pathlib import Path | ||
| from typing import Any, Dict | ||
| from typing import Any, Dict, Optional |
There was a problem hiding this comment.
Import of 'Any' is not used.
Import of 'Dict' is not used.
| import pytest | ||
|
|
||
| from publisher_v2.config.loader import load_application_config | ||
| from publisher_v2.core.exceptions import ConfigurationError |
There was a problem hiding this comment.
Import of 'ConfigurationError' is not used.
Summary
Implements Feature 021: Configuration Environment Variable Consolidation.
Key changes
docs_v2/08_Features/021_config_env_consolidation/.dotenv.v2.example, updates todocs_v2/05_Configuration/CONFIGURATION.md).publisher_v2/src/publisher_v2/config/loader.pyand small web integration adjustments.publisher_v2/tests/config/.Testing
publisher_v2/tests/config/*plus small updates in existing tests.Notes
feature21.