feat: show plugin release status#3
Conversation
📝 WalkthroughWalkthroughMenuTube plugin adds a configurable release-check subsystem that periodically fetches and caches the latest GitHub release tag, displaying cached update status in the menu for non-git-checkout installations. Documentation, utility functions, menu rendering, dispatch command, and test controls are all updated to support this feature. ChangesRelease Update Status Checking
Sequence DiagramsequenceDiagram
participant MenuRender as Menu Render
participant UpdateCache as Release Check Cache
participant GitHubAPI as GitHub API
MenuRender->>UpdateCache: maybe_refresh_release_check
UpdateCache->>UpdateCache: check TTL and lockfile
UpdateCache->>GitHubAPI: latest_release_tag if refresh needed
GitHubAPI-->>UpdateCache: latest tag or error
UpdateCache->>UpdateCache: write_release_check_cache with status
UpdateCache-->>MenuRender: cached_latest_release_tag
MenuRender->>MenuRender: render release_status_label and color
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bin/menutube.5s.sh (1)
318-334: ⚡ Quick winDocument the lock timeout.
The 120-second lock timeout at line 328 is a magic number that determines how long to wait before allowing another release check if a previous check's lock file still exists. Consider adding a brief comment explaining this value, or making it configurable if this timeout might need adjustment.
📝 Example documentation
now="$(date +%s 2>/dev/null || printf '0')" lock_age="$(cache_mtime "${MENUTUBE_RELEASE_CHECK_CACHE}.lock")" + # Prevent concurrent checks; stale lock cleanup after 120s if [[ -n "$lock_age" && $(( now - lock_age )) -lt 120 ]]; then return fi🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bin/menutube.5s.sh` around lines 318 - 334, In maybe_refresh_release_check(), the hard-coded 120-second lock timeout (used when comparing now and lock_age) should be documented or made configurable: add a brief comment above that check explaining why 120 seconds was chosen (prevents concurrent checks and allows quick retries) and optionally introduce a configurable variable like MENUTUBE_RELEASE_CHECK_LOCK_TTL_SECONDS with a default of 120 to replace the literal; update the comparison to use that variable and ensure any default is set earlier (e.g., fall back to 120 if unset) so the behavior can be adjusted without changing code.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@bin/menutube.5s.sh`:
- Around line 318-334: In maybe_refresh_release_check(), the hard-coded
120-second lock timeout (used when comparing now and lock_age) should be
documented or made configurable: add a brief comment above that check explaining
why 120 seconds was chosen (prevents concurrent checks and allows quick retries)
and optionally introduce a configurable variable like
MENUTUBE_RELEASE_CHECK_LOCK_TTL_SECONDS with a default of 120 to replace the
literal; update the comparison to use that variable and ensure any default is
set earlier (e.g., fall back to 120 if unset) so the behavior can be adjusted
without changing code.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 843e4cc7-016d-4982-8788-143b98166ba0
📒 Files selected for processing (3)
README.mdbin/menutube.5s.shscripts/check.sh
Summary
Validation
Summary by CodeRabbit
New Features
Documentation