Skip to content

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 10, 2026

Summary

  • Adds a lightweight cron-based auto-update system that checks GitHub for new aidevops releases every 10 minutes and auto-installs them
  • New CLI command: aidevops auto-update [enable|disable|status|check|logs]
  • Offered during setup.sh (interactive asks, non-interactive enables silently)

How It Works

  1. Cron runs auto-update-helper.sh check every 10 minutes
  2. Checks GitHub API for latest VERSION (not CDN-cached)
  3. If newer version found: acquires lock, git pull --ff-only, setup.sh --non-interactive
  4. Safe to run while AI sessions are active
  5. Skips if another update is already in progress

Files Changed

File Change
.agents/scripts/auto-update-helper.sh New script (~524 lines)
aidevops.sh Added auto-update command routing + help text
setup.sh Offer auto-update enablement after setup complete
.agents/AGENTS.md Added Auto-Update documentation section
.agents/subagent-index.toon Registered new script
README.md Added auto-update to key commands and CLI reference

Safety Features

  • mkdir-based atomic locking (POSIX-safe, prevents concurrent updates)
  • Stale lock detection (PID check + 5-minute age timeout)
  • git pull --ff-only fails safely if local changes exist
  • AIDEVOPS_AUTO_UPDATE=false env var override
  • Skips if setup.sh or aidevops update already running
  • 6 requests/hour (well within GitHub's 60/hr unauthenticated limit)

Testing

  • ShellCheck: zero violations
  • Tested: enable (cron installed), status (shows state), check (version comparison + logging), disable (cron removed), env var override
  • Linters: no new violations introduced

Closes t231

Summary by CodeRabbit

  • New Features

    • Automatic update polling daemon that periodically checks for new releases
    • New aidevops auto-update CLI command to manage updates (enable, disable, check status)
    • Setup now offers to enable automatic updates by default
  • Documentation

    • Added comprehensive Auto-Update guide covering setup, commands, and configuration options

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.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Walkthrough

Introduces 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

Cohort / File(s) Summary
Documentation
.agents/AGENTS.md, README.md, .agents/subagent-index.toon
Added Auto-Update feature documentation, CLI command reference, and script index entry for the new auto-update-helper.sh daemon.
Auto-Update Implementation
.agents/scripts/auto-update-helper.sh
New 509-line Bash daemon for polling releases, managing cron scheduling, acquiring locks, fetching remote versions, executing updates, persisting state to JSON, and logging to ~/.aidevops/logs/auto-update.log. Includes commands: enable, disable, status, check, logs, help.
CLI Integration
aidevops.sh
Added new top-level command auto-update (alias autoupdate) that dispatches to the auto-update-helper script with fallback paths and error handling.
Setup Flow
setup.sh
Integrated post-setup auto-update enablement with interactive (prompt user) and non-interactive (enable silently) modes; checks if helper exists and cron job not already scheduled before enabling.

Sequence Diagrams

sequenceDiagram
    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
Loading
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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Poem

🤖 A daemon awakes at dawn's first light,
Polling GitHub through each night,
When updates arrive, it pulls with grace,
Keeping aidevops current in every place! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add auto-update polling daemon (t231)' accurately describes the main change—introducing a cron-based auto-update system that polls GitHub for releases.
Docstring Coverage ✅ Passed Docstring coverage is 80.95% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/auto-update-daemon

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 36 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 10 17:44:02 UTC 2026: Code review monitoring started
Tue Feb 10 17:44:02 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 36

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 36
  • VULNERABILITIES: 0

Generated on: Tue Feb 10 17:44:04 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 aidevops framework. This system ensures that the application remains up-to-date with the latest releases from GitHub by periodically checking for new versions and performing silent installations. The implementation includes robust error handling and safety measures to prevent conflicts and data loss during updates, providing a seamless and reliable experience for users.

Highlights

  • New Auto-Update System: Introduced a lightweight, cron-based auto-update daemon that checks GitHub for new aidevops releases every 10 minutes and automatically installs them.
  • New CLI Command: Added a new aidevops auto-update command with subcommands for enable, disable, status, check, and logs to manage the auto-update feature.
  • Setup Integration: The setup.sh script now offers to enable the auto-update system interactively or silently enables it in non-interactive mode.
  • Robustness and Safety: Implemented safety features including mkdir-based atomic locking, stale lock detection, git pull --ff-only for safe updates, and environment variable overrides to prevent concurrent updates and handle local changes.
Changelog
  • .agents/AGENTS.md
    • Added a new 'Auto-Update' section detailing the feature, its CLI commands, and configuration options.
  • .agents/scripts/auto-update-helper.sh
    • Added a new shell script to manage the auto-update process, including cron job management, version checking, locking, and update execution.
  • .agents/subagent-index.toon
    • Registered the new auto-update-helper.sh script within the subagent index.
  • README.md
    • Updated the key commands list to include aidevops auto-update.
    • Added aidevops auto-update to the CLI reference section.
  • aidevops.sh
    • Integrated the auto-update command into the main aidevops CLI, routing calls to the new helper script.
    • Updated the help text to include information about the new auto-update command and its subcommands.
  • setup.sh
    • Modified the script to prompt users to enable auto-update after initial setup, or enable it silently in non-interactive mode.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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"

Choose a reason for hiding this comment

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

critical

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.

Suggested change
local auto_update_script="$target_dir/scripts/auto-update-helper.sh"
local auto_update_script="$HOME/.aidevops/agents/scripts/auto-update-helper.sh"

Comment on lines 245 to 248
update_state "check" "$current" "version_unknown"
release_lock
trap - EXIT
return 0

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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
@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 36 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 10 18:16:36 UTC 2026: Code review monitoring started
Tue Feb 10 18:16:36 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 36

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 36
  • VULNERABILITIES: 0

Generated on: Tue Feb 10 18:16:39 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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
@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 36 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 10 18:24:07 UTC 2026: Code review monitoring started
Tue Feb 10 18:24:08 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 36

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 36
  • VULNERABILITIES: 0

Generated on: Tue Feb 10 18:24:10 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit 5b506c1 into main Feb 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant