jleechanorg-pr-automation 0.1.1__py3-none-any.whl → 0.2.45__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. jleechanorg_pr_automation/STORAGE_STATE_TESTING_PROTOCOL.md +326 -0
  2. jleechanorg_pr_automation/__init__.py +64 -9
  3. jleechanorg_pr_automation/automation_safety_manager.py +306 -95
  4. jleechanorg_pr_automation/automation_safety_wrapper.py +13 -19
  5. jleechanorg_pr_automation/automation_utils.py +87 -65
  6. jleechanorg_pr_automation/check_codex_comment.py +7 -1
  7. jleechanorg_pr_automation/codex_branch_updater.py +21 -9
  8. jleechanorg_pr_automation/codex_config.py +70 -3
  9. jleechanorg_pr_automation/jleechanorg_pr_monitor.py +1954 -234
  10. jleechanorg_pr_automation/logging_utils.py +86 -0
  11. jleechanorg_pr_automation/openai_automation/__init__.py +3 -0
  12. jleechanorg_pr_automation/openai_automation/codex_github_mentions.py +1111 -0
  13. jleechanorg_pr_automation/openai_automation/debug_page_content.py +88 -0
  14. jleechanorg_pr_automation/openai_automation/oracle_cli.py +364 -0
  15. jleechanorg_pr_automation/openai_automation/test_auth_restoration.py +244 -0
  16. jleechanorg_pr_automation/openai_automation/test_codex_comprehensive.py +355 -0
  17. jleechanorg_pr_automation/openai_automation/test_codex_integration.py +254 -0
  18. jleechanorg_pr_automation/orchestrated_pr_runner.py +516 -0
  19. jleechanorg_pr_automation/tests/__init__.py +0 -0
  20. jleechanorg_pr_automation/tests/test_actionable_counting_matrix.py +84 -86
  21. jleechanorg_pr_automation/tests/test_attempt_limit_logic.py +124 -0
  22. jleechanorg_pr_automation/tests/test_automation_marker_functions.py +175 -0
  23. jleechanorg_pr_automation/tests/test_automation_over_running_reproduction.py +9 -11
  24. jleechanorg_pr_automation/tests/test_automation_safety_limits.py +91 -79
  25. jleechanorg_pr_automation/tests/test_automation_safety_manager_comprehensive.py +53 -53
  26. jleechanorg_pr_automation/tests/test_codex_actor_matching.py +1 -1
  27. jleechanorg_pr_automation/tests/test_fixpr_prompt.py +54 -0
  28. jleechanorg_pr_automation/tests/test_fixpr_return_value.py +140 -0
  29. jleechanorg_pr_automation/tests/test_graphql_error_handling.py +26 -26
  30. jleechanorg_pr_automation/tests/test_model_parameter.py +317 -0
  31. jleechanorg_pr_automation/tests/test_orchestrated_pr_runner.py +697 -0
  32. jleechanorg_pr_automation/tests/test_packaging_integration.py +127 -0
  33. jleechanorg_pr_automation/tests/test_pr_filtering_matrix.py +246 -193
  34. jleechanorg_pr_automation/tests/test_pr_monitor_eligibility.py +354 -0
  35. jleechanorg_pr_automation/tests/test_pr_targeting.py +102 -7
  36. jleechanorg_pr_automation/tests/test_version_consistency.py +51 -0
  37. jleechanorg_pr_automation/tests/test_workflow_specific_limits.py +202 -0
  38. jleechanorg_pr_automation/tests/test_workspace_dispatch_missing_dir.py +119 -0
  39. jleechanorg_pr_automation/utils.py +81 -56
  40. jleechanorg_pr_automation-0.2.45.dist-info/METADATA +864 -0
  41. jleechanorg_pr_automation-0.2.45.dist-info/RECORD +45 -0
  42. jleechanorg_pr_automation-0.1.1.dist-info/METADATA +0 -222
  43. jleechanorg_pr_automation-0.1.1.dist-info/RECORD +0 -23
  44. {jleechanorg_pr_automation-0.1.1.dist-info → jleechanorg_pr_automation-0.2.45.dist-info}/WHEEL +0 -0
  45. {jleechanorg_pr_automation-0.1.1.dist-info → jleechanorg_pr_automation-0.2.45.dist-info}/entry_points.txt +0 -0
  46. {jleechanorg_pr_automation-0.1.1.dist-info → jleechanorg_pr_automation-0.2.45.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,86 @@
1
+ """Centralized logging utilities for automation components.
2
+
3
+ This module provides standardized logging setup to eliminate code duplication
4
+ across the automation package. All logging configuration should use this module.
5
+
6
+ Consolidates implementations previously scattered across:
7
+ - utils.py
8
+ - automation_utils.py
9
+ - automation_safety_wrapper.py
10
+ - openai_automation/codex_github_mentions.py
11
+ """
12
+
13
+ import logging
14
+ import os
15
+ from pathlib import Path
16
+ from typing import Optional
17
+
18
+
19
+ def setup_logging(
20
+ name: str,
21
+ level: int = logging.INFO,
22
+ log_file: Optional[str] = None,
23
+ log_dir: Optional[Path] = None
24
+ ) -> logging.Logger:
25
+ """Standardized logging setup for automation components.
26
+
27
+ Args:
28
+ name: Logger name (typically __name__ of calling module)
29
+ level: Logging level (default: INFO)
30
+ log_file: Optional specific log file path
31
+ log_dir: Optional log directory (creates default filename if set)
32
+
33
+ Returns:
34
+ Configured logger instance
35
+
36
+ Examples:
37
+ # Basic usage
38
+ logger = setup_logging(__name__)
39
+
40
+ # With specific log file
41
+ logger = setup_logging(__name__, log_file="/tmp/mylog.log")
42
+
43
+ # With log directory (auto-generates filename)
44
+ logger = setup_logging(__name__, log_dir=Path("/tmp/logs"))
45
+ """
46
+ logger = logging.getLogger(name)
47
+
48
+ # Avoid duplicate handlers
49
+ if logger.handlers:
50
+ return logger
51
+
52
+ logger.setLevel(level)
53
+
54
+ # Create formatter
55
+ formatter = logging.Formatter(
56
+ "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
57
+ )
58
+
59
+ # Console handler
60
+ console_handler = logging.StreamHandler()
61
+ console_handler.setFormatter(formatter)
62
+ logger.addHandler(console_handler)
63
+
64
+ # File handler setup
65
+ if log_file:
66
+ # Explicit log file specified
67
+ os.makedirs(os.path.dirname(log_file), exist_ok=True)
68
+ file_handler = logging.FileHandler(log_file)
69
+ file_handler.setFormatter(formatter)
70
+ logger.addHandler(file_handler)
71
+ elif log_dir:
72
+ # Log directory specified - create default filename
73
+ log_dir.mkdir(parents=True, exist_ok=True)
74
+ log_filename = f"{name.replace('.', '_')}.log"
75
+ log_path = log_dir / log_filename
76
+ file_handler = logging.FileHandler(log_path)
77
+ file_handler.setFormatter(formatter)
78
+ logger.addHandler(file_handler)
79
+
80
+ return logger
81
+
82
+
83
+ # Backward compatibility aliases for common usage patterns
84
+ def get_logger(name: str, **kwargs) -> logging.Logger:
85
+ """Alias for setup_logging() for backward compatibility."""
86
+ return setup_logging(name, **kwargs)
@@ -0,0 +1,3 @@
1
+ """OpenAI automation module for Codex GitHub Mentions processing."""
2
+
3
+ __all__ = ["codex_github_mentions"]