Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Problem and change

Describe the concrete problem and resulting behavior. Link an issue if applicable.

## Validation

List the commands or manual checks run and their results. Explain checks not run.

## Review checklist

- [ ] The branch targets the current default branch and preserves unrelated work.
- [ ] Documentation and configuration match the implemented behavior.
- [ ] Tests cover changed behavior where appropriate.
- [ ] No credentials, personal records, or client data are included.
- [ ] Deployment, migration, dependency, and rollback implications are documented where relevant.
3 changes: 3 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ jobs:
- name: Import smoke test
run: python -c "import app; import engine.pipeline; import engine.lead_scraper; import engine.followup_engine; import engine.social_manager"

- name: Import regression tests
run: python -m unittest discover -s tests -v

- name: Check required configuration files
run: python -c "from pathlib import Path; assert Path('.env.example').exists(); assert Path('README.md').exists(); assert Path('SECURITY.md').exists(); assert Path('CONTRIBUTING.md').exists()"
6 changes: 3 additions & 3 deletions engine/followup_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
from typing import Optional, List, Dict, Tuple, Any

# Ensure we can import from pipeline.py
try:
if __package__:
from .pipeline import load_and_validate_env, detect_smtp_provider, is_valid_email
else:
from pipeline import load_and_validate_env, detect_smtp_provider, is_valid_email
except ImportError:
sys.exit("❌ Could not import from pipeline.py. Make sure pipeline.py is in the same directory.")

# ════════════════════════════════════════════════════════════════════════════════
# LOGGING SETUP
Expand Down
22 changes: 22 additions & 0 deletions tests/test_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Import regression tests; never run outbound sales workflows."""
import subprocess
import sys
import unittest
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]


class ImportTests(unittest.TestCase):
def check_import(self, code):
result = subprocess.run([sys.executable, "-c", code], cwd=ROOT,
capture_output=True, text=True, timeout=30, check=False)
self.assertEqual(result.returncode, 0, result.stderr or result.stdout)

def test_package_import(self):
self.check_import("from engine import followup_engine, pipeline; "
"assert followup_engine.is_valid_email is pipeline.is_valid_email")

def test_script_import(self):
self.check_import("import sys, runpy; sys.path.insert(0, 'engine'); "
"runpy.run_path('engine/followup_engine.py', run_name='import_check')")
Loading