SYS-8690 base daily update check - #44
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new unit tests use NamedTemporaryFile().name as a directory path (can fail/flap), and the update cache currently writes an untracked file into the repo root by default.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a non-blocking “new release available” notification to the native git hooks, with a 24-hour cache and opt-out via Git config, and documents the behavior in the README.
Changes:
- Implement a cached GitHub “latest release” check and print an informational update notice during commits.
- Add unit tests for version parsing, opt-out behavior, caching behavior, and notification output.
- Document automatic update notifications and how to disable them.
File summaries
| File | Description |
|---|---|
| README.md | Documents the new automatic update notification behavior and opt-out setting. |
| main/githooks.py | Implements the update check + caching, adds tests, and runs the check at the start of the commit hook. |
Review details
Suppressed comments (1)
main/githooks.py:1385
- Same issue as above:
NamedTemporaryFile().nameis a file path, not a directory; using it withmkdir()can make this test flaky/fail on some platforms. UseTemporaryDirectory()instead.
temp_dir = NamedTemporaryFile().name
temp_path = Path(temp_dir)
temp_path.mkdir(parents=True, exist_ok=True)
try:
with patch('githooks._get_hooks_repo_dir', return_value=temp_path):
with patch('sys.stdout', new=StringIO()) as tmp_stdout:
check_for_updates()
self.assertEqual('', tmp_stdout.getvalue())
finally:
if (temp_path / '.update_cache.json').exists():
(temp_path / '.update_cache.json').unlink()
temp_path.rmdir()
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
The update-cache location/TTL logic has edge cases that can cause repeated network calls and create an untracked cache file in worktree-style repos, which should be corrected before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
README.md:97
- The README claims the update check happens “at most once every 24 hours”, but the hook can perform more frequent checks (e.g., if the cache file can’t be persisted or when retries happen). Either soften this wording or document the conditions under which it may check more often.
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
No description provided.