Skip to content

SYS-8690 base daily update check - #44

Open
mmaharjan-ccdc wants to merge 3 commits into
mainfrom
SYS-8690-auto-update
Open

SYS-8690 base daily update check#44
mmaharjan-ccdc wants to merge 3 commits into
mainfrom
SYS-8690-auto-update

Conversation

@mmaharjan-ccdc

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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().name is a file path, not a directory; using it with mkdir() can make this test flaky/fail on some platforms. Use TemporaryDirectory() 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.

Comment thread main/githooks.py Outdated
Comment thread main/githooks.py
Comment thread main/githooks.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread main/githooks.py
Comment thread main/githooks.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants