Skip to content

feat(supervisor): add automatic release at batch milestones (t128.10)#460

Merged
marcusquinn merged 1 commit intomainfrom
feature/t128.10
Feb 7, 2026
Merged

feat(supervisor): add automatic release at batch milestones (t128.10)#460
marcusquinn merged 1 commit intomainfrom
feature/t128.10

Conversation

@marcusquinn
Copy link
Copy Markdown
Owner

Summary

  • Add release_on_complete flag and release_type to supervisor batches, enabling automatic version-manager.sh release when all tasks in a batch reach terminal states
  • New cmd_release command for manual trigger, enable/disable, and dry-run support
  • Schema migration for existing databases, zero ShellCheck violations, full test coverage

Changes

Schema (supervisor-helper.sh)

  • batches.release_on_complete (INTEGER, default 0) - flag to enable auto-release
  • batches.release_type (TEXT, default 'patch', CHECK major|minor|patch) - release bump type
  • Migration for existing databases adds both columns with defaults

New Functions

  • trigger_batch_release() - Pulls main, runs version-manager.sh release --skip-preflight, stores success/failure in memory, sends notifications. Non-blocking on failure.
  • cmd_release() - Manual release trigger with --enable/--disable/--dry-run/--type options

Integration Points

  • check_batch_completion() - Checks release_on_complete flag after batch completes, triggers release if enabled
  • cmd_batch() - New --release-on-complete and --release-type flags
  • Status display - Shows release config in both batch detail and overview views
  • Help text - Full documentation with usage examples

Usage Examples

# Create batch with auto-release
supervisor-helper.sh batch "v2.106" --tasks "t128.10,t128.9" --release-on-complete --release-type minor

# Enable/disable on existing batch
supervisor-helper.sh release <batch_id> --enable --type minor
supervisor-helper.sh release <batch_id> --disable

# Manual trigger
supervisor-helper.sh release <batch_id> --type patch
supervisor-helper.sh release <batch_id> --dry-run

Testing

  • Schema creation verified (new columns with CHECK constraint)
  • Migration from old schema verified (columns added with defaults)
  • Batch creation with --release-on-complete flag verified
  • Status display shows release configuration
  • Enable/disable toggle verified
  • Dry-run mode verified
  • Batch completion triggers release (verified non-blocking failure in worktree context)
  • Default behavior unchanged (batches without flag don't trigger release)
  • ShellCheck: zero new violations

Task Reference

t128.10 - Automatic release at batch milestones (blocked-by: t128.8, now complete)

Add release_on_complete flag and release_type to batches, enabling
automatic version-manager.sh release when all tasks in a batch complete.

- Schema: release_on_complete (INTEGER, default 0) and release_type
  (TEXT, default 'patch') columns on batches table with migration
- trigger_batch_release(): pulls main, runs version-manager.sh release
  with --skip-preflight, stores success/failure in memory, sends
  notifications, non-blocking on failure
- check_batch_completion(): wired to trigger release when batch
  completes and release_on_complete=1
- cmd_batch(): --release-on-complete and --release-type flags
- cmd_release(): manual trigger, enable/disable, dry-run support
- Status display: shows release config in batch status and overview
- Help text: full documentation with examples
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 7, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 57 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.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t128.10

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.

@gemini-code-assist
Copy link
Copy Markdown

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 significantly enhances the supervisor's batch management capabilities by introducing automated version releases. It allows users to define a release type (major, minor, or patch) that will be automatically executed via version-manager.sh once all tasks within a batch reach a terminal state, streamlining the deployment pipeline. Additionally, a new release command provides granular control, enabling manual triggers, configuration changes, and dry-run simulations for batch-related releases.

Highlights

  • Automated Version Releases: Batches can now be configured to automatically trigger a version release (patch, minor, or major) using version-manager.sh upon successful completion of all tasks within the batch.
  • New release Command: A new supervisor-helper.sh release command has been introduced, allowing users to manually trigger a release for a batch, enable/disable automatic releases for existing batches, or perform a dry-run to preview the release action.
  • Database Schema Updates: The batches table in the supervisor's database now includes release_on_complete (INTEGER) and release_type (TEXT) columns to store auto-release configuration, with a schema migration ensuring compatibility for existing databases.
  • Enhanced Status Display: The status command has been updated to display the configured auto-release settings for batches, providing better visibility into whether a batch will trigger a release and what type.
Changelog
  • .agents/scripts/supervisor-helper.sh
    • Added release_on_complete (INTEGER, default 0) and release_type (TEXT, default 'patch') columns to the batches table, including a schema migration for existing databases.
    • Implemented trigger_batch_release function to handle the logic for performing a release, including repository synchronization, version-manager.sh execution, logging, and notifications.
    • Integrated automatic release triggering into check_batch_completion, which now checks for the release_on_complete flag and calls trigger_batch_release when a batch finishes.
    • Introduced cmd_release command, enabling manual release execution for a batch, toggling release_on_complete status, and supporting dry-run operations.
    • Updated cmd_batch with new --release-on-complete and --release-type options for configuring auto-releases during batch creation.
    • Modified cmd_status to display the auto-release configuration (enabled/disabled, type) in both the batch overview and detailed views.
    • Expanded the script's help documentation to include usage details for the new release command and the auto-release options for batch.
    • Added release command to the main command dispatcher.
Activity
  • No specific activity (comments, reviews, progress updates) was provided in the context for this pull request.
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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 19:13:59 UTC 2026: Code review monitoring started
Sat Feb 7 19:13:59 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 25
Sat Feb 7 19:14:00 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 19:14:02 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 25
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 19:14:02 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 7, 2026

@marcusquinn marcusquinn merged commit 3d0ebac into main Feb 7, 2026
11 checks passed
Copy link
Copy Markdown

@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 well-implemented feature for automatic releases upon batch completion. The changes are comprehensive, including schema migration, new commands (release, trigger_batch_release), updates to existing logic, and thorough documentation. The code is robust with solid error handling and logging. I've made a couple of suggestions to consolidate database queries for improved efficiency, but overall, this is a high-quality contribution.

Comment on lines +880 to +890
total_tasks=$(db "$SUPERVISOR_DB" "
SELECT count(*) FROM batch_tasks WHERE batch_id = '$escaped_batch';
")
complete_count=$(db "$SUPERVISOR_DB" "
SELECT count(*) FROM batch_tasks bt JOIN tasks t ON bt.task_id = t.id
WHERE bt.batch_id = '$escaped_batch' AND t.status IN ('complete', 'deployed', 'merged');
")
failed_count=$(db "$SUPERVISOR_DB" "
SELECT count(*) FROM batch_tasks bt JOIN tasks t ON bt.task_id = t.id
WHERE bt.batch_id = '$escaped_batch' AND t.status IN ('failed', 'blocked');
")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

These three separate database queries to fetch total_tasks, complete_count, and failed_count can be combined into a single, more efficient query using conditional aggregation. This reduces the number of round-trips to the database and simplifies the code.

Suggested change
total_tasks=$(db "$SUPERVISOR_DB" "
SELECT count(*) FROM batch_tasks WHERE batch_id = '$escaped_batch';
")
complete_count=$(db "$SUPERVISOR_DB" "
SELECT count(*) FROM batch_tasks bt JOIN tasks t ON bt.task_id = t.id
WHERE bt.batch_id = '$escaped_batch' AND t.status IN ('complete', 'deployed', 'merged');
")
failed_count=$(db "$SUPERVISOR_DB" "
SELECT count(*) FROM batch_tasks bt JOIN tasks t ON bt.task_id = t.id
WHERE bt.batch_id = '$escaped_batch' AND t.status IN ('failed', 'blocked');
")
local stats
stats=$(db -separator '|' "$SUPERVISOR_DB" "\n SELECT\n COUNT(*),\n SUM(CASE WHEN status IN ('complete', 'deployed', 'merged') THEN 1 ELSE 0 END),\n SUM(CASE WHEN status IN ('failed', 'blocked') THEN 1 ELSE 0 END)\n FROM tasks\n WHERE id IN (SELECT task_id FROM batch_tasks WHERE batch_id = '$escaped_batch');\n ")
IFS='|' read -r total_tasks complete_count failed_count <<< "${stats:-0|0|0}"

Comment on lines +1013 to +1016
batch_release_flag=$(db "$SUPERVISOR_DB" "SELECT release_on_complete FROM batches WHERE id = '$escaped_batch';" 2>/dev/null || echo "0")
if [[ "$batch_release_flag" -eq 1 ]]; then
local batch_release_type
batch_release_type=$(db "$SUPERVISOR_DB" "SELECT release_type FROM batches WHERE id = '$escaped_batch';" 2>/dev/null || echo "patch")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

These two consecutive database queries to fetch release_on_complete and release_type can be combined into a single, more efficient query. This reduces database overhead. Consider one of two approaches:

  1. Fetch both columns at once and check the flag in bash:
local flag type
IFS='|' read -r flag type <<< "$(db ... 'SELECT release_on_complete, release_type ...')"
if [[ "$flag" -eq 1 ]]; then
  # use type
fi
  1. Combine the check into the WHERE clause:
local type
type=$(db ... 'SELECT release_type FROM ... WHERE ... AND release_on_complete = 1;')
if [[ -n "$type" ]]; then
  # use type
fi

@marcusquinn marcusquinn deleted the feature/t128.10 branch February 21, 2026 01:59
@marcusquinn marcusquinn added the code-reviews-actioned All review feedback has been actioned label Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-reviews-actioned All review feedback has been actioned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant