Skip to content

Feature 021: Configuration environment variable consolidation#38

Merged
dhirmadi merged 1 commit into
mainfrom
feature21
Dec 23, 2025
Merged

Feature 021: Configuration environment variable consolidation#38
dhirmadi merged 1 commit into
mainfrom
feature21

Conversation

@dhirmadi
Copy link
Copy Markdown
Owner

Summary

Implements Feature 021: Configuration Environment Variable Consolidation.

Key changes

  • Adds Feature 021 design/feature/story docs (including QA + review writeups) under docs_v2/08_Features/021_config_env_consolidation/.
  • Adds/updates consolidated environment variable documentation (dotenv.v2.example, updates to docs_v2/05_Configuration/CONFIGURATION.md).
  • Implements env-var + JSON helper infrastructure in publisher_v2/src/publisher_v2/config/loader.py and small web integration adjustments.
  • Adds substantial test coverage for loader env/json helpers and integration tests under publisher_v2/tests/config/.

Testing

  • New tests: publisher_v2/tests/config/* plus small updates in existing tests.

Notes

  • Single consolidated commit on feature21.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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"
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Variable publishers_source is not used.

Copilot uses AI. Check for mistakes.
else:
# Fallback to INI [Content] toggles
ini_sections_used.append("Content")
publishers_source = "INI"
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Variable publishers_source is not used.

Copilot uses AI. Check for mistakes.
import os
from pathlib import Path
from typing import Any, Dict
from typing import Any, Dict, Optional
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Import of 'Any' is not used.
Import of 'Dict' is not used.

Copilot uses AI. Check for mistakes.
import pytest

from publisher_v2.config.loader import load_application_config
from publisher_v2.core.exceptions import ConfigurationError
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

Import of 'ConfigurationError' is not used.

Copilot uses AI. Check for mistakes.
@dhirmadi dhirmadi merged commit 519d16f into main Dec 23, 2025
13 checks passed
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.

2 participants