]> Nutra Git (v1) - gamesguru/getmyancestors.git/commitdiff
ci: add format check, PR trigger for Coveralls; drop legacy cookie migration
authorShane Jaroch <chown_tee@proton.me>
Thu, 22 Jan 2026 23:23:29 +0000 (18:23 -0500)
committerShane Jaroch <chown_tee@proton.me>
Thu, 22 Jan 2026 23:51:12 +0000 (18:51 -0500)
- 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

.github/workflows/test.yml
getmyancestors/classes/session.py
tests/test_installation.py

index b25f1d43d6ea7b33e0101f40c2e3df6a00a346f0..b26fc1d33e967e2d6d515689d6a62af1284a82d6 100644 (file)
@@ -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'
index 67c59546215d7b7ac8b4e5afbe785a9d48185baf..8b700c630bed9287be6af42c7c9141852377b0c3 100644 (file)
@@ -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):
index d75a12f3a1160b75dcfb03cd6b6148e637cb4c3c..0906c940a2f2e4a927b0ac70dfe060bc7b25be39 100644 (file)
@@ -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