From: Shane Jaroch Date: Thu, 22 Jan 2026 23:23:29 +0000 (-0500) Subject: ci: add format check, PR trigger for Coveralls; drop legacy cookie migration X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=016915f155c11c0433b54f15068aac13f354e861;p=gamesguru%2Fgetmyancestors.git ci: add format check, PR trigger for Coveralls; drop legacy cookie migration - Add 'Check Clean After Format' step to catch unformatted PRs - Add pull_request trigger so Coveralls can post PR comments - Fix legacy_cookie_file path for backward compatibility migration - Add 5min timeout to test_installation pip install --- diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b25f1d4..b26fc1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,8 @@ name: ci "on": - push: {} + push: [master, main] + pull_request: [master, main] permissions: contents: read @@ -47,6 +48,11 @@ jobs: run: make format if: runner.os == 'Linux' + - name: Check Clean After Format + if: runner.os == 'Linux' + run: | + git diff --exit-code || (echo "❌ Code not formatted. Run 'make format' locally." && exit 1) + - name: Lint run: make lint if: runner.os == 'Linux' diff --git a/getmyancestors/classes/session.py b/getmyancestors/classes/session.py index 67c5954..8b700c6 100644 --- a/getmyancestors/classes/session.py +++ b/getmyancestors/classes/session.py @@ -132,7 +132,7 @@ class GMASession(requests.Session): ) os.makedirs(cache_dir, exist_ok=True) self.db_path = os.path.join(cache_dir, "session.sqlite") - # Cookie file is now stored in cache directory too + # Cookie file is now stored in cache directory self.cookie_file = os.path.join(cache_dir, "cookies.json") self._init_db() self.check_license() @@ -291,23 +291,6 @@ class GMASession(requests.Session): except Exception as e: self.write_log("Error loading session from JSON: " + str(e)) - # 2. Legacy Migration: checking old cookie file if it exists - if os.path.exists(self.cookie_file): - try: - with open(self.cookie_file, "r", encoding="utf-8") as f: - data = json.load(f) - self._apply_session_data(data) - # We do NOT auto-save to new JSON here to respect read-only/security. - # It will save to new JSON only on next login/save_cookies call. - if self.verbose: - self.write_log( - "Session loaded (migrated) from legacy JSON: " - + self.cookie_file - ) - return True - except Exception as e: - self.write_log("Error loading legacy cookie file: " + str(e)) - return False def _apply_session_data(self, data): diff --git a/tests/test_installation.py b/tests/test_installation.py index d75a12f..0906c94 100644 --- a/tests/test_installation.py +++ b/tests/test_installation.py @@ -60,6 +60,7 @@ class TestInstallation(unittest.TestCase): text=True, cwd=self.project_root, check=True, + timeout=300, # 5 minute timeout ) # Test that the package can be imported