-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add auto-update polling daemon (t231) #955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Lightweight cron-based system that checks GitHub for new releases every 10 minutes and auto-installs them via git pull --ff-only + setup.sh. - New script: auto-update-helper.sh (enable/disable/status/check/logs) - aidevops.sh: add auto-update command routing - setup.sh: offer auto-update enablement after setup complete - AGENTS.md: add Auto-Update documentation section - README.md: add auto-update to key commands and CLI reference - subagent-index.toon: register new script Safe to run while AI sessions are active. Uses mkdir-based atomic locking, stale lock detection, and skips if another update is running.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughIntroduces a new automatic update feature for aidevops with a cron-based daemon script, CLI integration, and setup flow enablement. Adds documentation, a 509-line helper script with locking and state management, CLI dispatcher updates, and post-setup auto-update prompts. Changes
Sequence DiagramssequenceDiagram
participant User
participant CLI as aidevops.sh
participant Helper as auto-update-helper.sh
participant Cron
participant Git as Git/GitHub
participant FileSystem as File System<br/>(logs/state)
User->>CLI: aidevops auto-update enable
CLI->>Helper: cmd_enable
Helper->>FileSystem: Create lock & state file
Helper->>Cron: Add cron job (10min interval)
Helper->>FileSystem: Write logs
Helper-->>User: Enabled
Cron->>Helper: Periodic invocation (check cmd)
Helper->>FileSystem: Acquire lock
Helper->>FileSystem: Read local VERSION
Helper->>Git: Fetch remote version from GitHub
alt Update Available
Helper->>Git: git fetch origin/main
Helper->>Git: git pull
Helper->>FileSystem: Execute setup.sh
Helper->>FileSystem: Update state & logs
else No Update
Helper->>FileSystem: Log check result
end
Helper->>FileSystem: Release lock
sequenceDiagram
participant User
participant Setup as setup.sh
participant Helper as auto-update-helper.sh
participant FileSystem as File System<br/>(crontab)
User->>Setup: Run setup script
Setup->>Setup: Complete installation
Setup->>FileSystem: Check if helper exists
Setup->>FileSystem: Check if cron job scheduled
alt Interactive Mode
Setup->>User: Prompt: Enable auto-update?
User->>Setup: Yes
Setup->>Helper: Execute enable command
Helper->>FileSystem: Install cron job
else Non-Interactive Mode
Setup->>Helper: Execute enable command silently
Helper->>FileSystem: Install cron job
end
Setup-->>User: Setup complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Tue Feb 10 17:44:04 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant enhancement by adding an automatic update mechanism to the Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a robust auto-update feature, which is a great addition. The new auto-update-helper.sh script is well-designed with important safety features like atomic locking and stale lock detection. The integration into the existing aidevops.sh and setup.sh scripts is also well-handled. I've found one critical issue in setup.sh where a variable is out of scope, which will prevent the auto-update from being enabled during setup. I also have a suggestion to simplify the lock-handling logic in auto-update-helper.sh to improve code clarity and maintainability.
setup.sh
Outdated
| print_success "🎉 Setup complete!" | ||
|
|
||
| # Enable auto-update if not already enabled | ||
| local auto_update_script="$target_dir/scripts/auto-update-helper.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable target_dir is not defined in the scope of the main function, as it's declared as a local variable inside deploy_aidevops_agents. This will cause the path to auto-update-helper.sh to be incorrect, and the auto-update enablement feature will be silently skipped during setup. You should use the full, known path to the script.
| local auto_update_script="$target_dir/scripts/auto-update-helper.sh" | |
| local auto_update_script="$HOME/.aidevops/agents/scripts/auto-update-helper.sh" |
| update_state "check" "$current" "version_unknown" | ||
| release_lock | ||
| trap - EXIT | ||
| return 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trap 'release_lock' EXIT on line 235 is sufficient to ensure the lock is released when the function exits. The explicit calls to release_lock and trap - EXIT before each return are redundant and make the code harder to read. Relying on the trap for all exit paths is a cleaner and more robust pattern.
This simplification can be applied to all similar early-exit points in this function.
| update_state "check" "$current" "version_unknown" | |
| release_lock | |
| trap - EXIT | |
| return 0 | |
| update_state "check" "$current" "version_unknown" | |
| return 0 |
…k releases - setup.sh: use explicit $HOME path instead of out-of-scope $target_dir - auto-update-helper.sh: remove redundant release_lock/trap calls, rely on EXIT trap for all cleanup paths
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Tue Feb 10 18:16:39 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.agents/scripts/auto-update-helper.sh:
- Around line 450-507: The cmd_help and main functions lack explicit return
statements; add explicit returns to satisfy shell guidelines: append an explicit
"return 0" (or equivalent success return) at the end of cmd_help, and modify
main to explicitly return the command result—e.g., capture the case exit status
and "return $status" or add "return 0" on normal success paths while preserving
the existing non-zero return in the default branch; reference the cmd_help and
main function blocks and the existing case branches
(enable/disable/status/check/logs/help/*) to implement this.
In `@setup.sh`:
- Around line 5104-5126: This block unconditionally enables auto-update when
cron entry is missing; guard it by checking the AIDEVOPS_AUTO_UPDATE env var
first (e.g., treat "false" or "0" as opt-out) before proceeding to the crontab
check and calling bash "$auto_update_script" enable; add the condition near the
top of the block (around auto_update_script and NON_INTERACTIVE checks) so that
if AIDEVOPS_AUTO_UPDATE is set to "false"/"0" the script skips prompting or
silently enabling auto-update and instead calls print_info or no-ops.
…etup - auto-update-helper.sh: add explicit return 0 to cmd_help and main - setup.sh: check AIDEVOPS_AUTO_UPDATE=false before enabling in setup
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Tue Feb 10 18:24:10 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
aidevops auto-update [enable|disable|status|check|logs]setup.sh(interactive asks, non-interactive enables silently)How It Works
auto-update-helper.sh checkevery 10 minutesgit pull --ff-only,setup.sh --non-interactiveFiles Changed
.agents/scripts/auto-update-helper.shaidevops.shauto-updatecommand routing + help textsetup.sh.agents/AGENTS.md.agents/subagent-index.toonREADME.mdSafety Features
git pull --ff-onlyfails safely if local changes existAIDEVOPS_AUTO_UPDATE=falseenv var overridesetup.shoraidevops updatealready runningTesting
enable(cron installed),status(shows state),check(version comparison + logging),disable(cron removed), env var overrideCloses t231
Summary by CodeRabbit
New Features
aidevops auto-updateCLI command to manage updates (enable, disable, check status)Documentation