feat: show plugin release status#6
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds cached release-status checking and UI integration to the Agent Watch SwiftBar plugin. Configuration variables control whether release checks run and how long results are cached; a subsystem of helper functions discovers, caches, and computes release status; and the UI displays colored status alongside the plugin version with conditional update and manual check commands. ChangesRelease Update Checking Feature
Sequence Diagram(s)sequenceDiagram
participant Plugin as AgentWatchPlugin
participant Checker as maybe_refresh_release_check
participant GitHub as GitHubAPI
participant Cache as TSVCacheFile
participant Lock as LockFile
Plugin->>Checker: request latest release (on stale or manual)
Checker->>Lock: create short-lived lock
alt GitHub API available
Checker->>GitHub: GET latest release / asset URL parse
GitHub-->>Checker: latest tag
else fallback by parsing asset URL
Checker->>Checker: derive latest tag from asset URL
end
Checker->>Cache: write TSV (timestamp,status,latest_tag)
Cache-->>Plugin: cached latest_tag / status
Lock-->>Checker: remove lock
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.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@bin/agent-watch.30s.sh`:
- Around line 274-279: The tag extraction function
latest_release_tag_from_asset_url can return the literal "latest" from the
RELEASE_ASSET_URL which should be treated as an invalid fallback; modify
latest_release_tag_from_asset_url so that after extracting tag (currently into
variable tag) you check if tag is empty or equals "latest" and return non-zero
in that case (do not emit "latest"). Also apply the same validation where
AGENTWATCH_RELEASE_ASSET_URL is parsed (the logic referenced around lines
309-310) so that any "latest" result is rejected and does not produce an "update
latest available" status.
- Around line 363-368: The lock creation is race-prone because the script
overwrites "${RELEASE_CHECK_CACHE}.lock" non-atomically before spawning the
background job; change to an atomic lock-acquire pattern (e.g., create a lock
directory or use an atomic link/redirect with noclobber) and only spawn
"$PLUGIN_PATH" check-release in the background when the lock was successfully
acquired; ensure the atomic lock uses RELEASE_CHECK_CACHE (or
"${RELEASE_CHECK_CACHE}.lock") as the unique token, and release/remove the lock
when the background check-release process completes (or use a trap/cleanup on
exit) so concurrent runs won't both spawn duplicate jobs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e230dcd-8ef0-4040-8fa4-24c54203d3ce
📒 Files selected for processing (3)
README.mdbin/agent-watch.30s.shscripts/check.sh
Summary
Validation
Summary by CodeRabbit
New Features
Documentation