Skip to content

feat: aidevops update now checks planning template versions#160

Merged
marcusquinn merged 1 commit intomainfrom
feature/update-triggers-planning-upgrade
Jan 24, 2026
Merged

feat: aidevops update now checks planning template versions#160
marcusquinn merged 1 commit intomainfrom
feature/update-triggers-planning-upgrade

Conversation

@marcusquinn
Copy link
Owner

Summary

  • aidevops update now scans registered repos for outdated planning templates
  • Offers to upgrade TODO.md/PLANS.md when template version mismatches detected
  • Extracted check_planning_file_version() to top-level for reuse across commands

What happens on aidevops update

After the existing version check, a new section runs:

Checking Planning Templates
[WARN] 2 project(s) have outdated planning templates:
  - myproject (v1.0)
  - another-repo (vnone)

  Latest template: v1.1 (adds risk field, active session time estimates)

Upgrade planning templates in these projects? [y/N]

If confirmed, runs upgrade-planning --force in each repo (creates backups, merges existing tasks into new template structure).

Testing

  • ShellCheck: zero violations
  • Only checks repos with "planning": true in .aidevops.json

- Extract check_planning_file_version() to top-level for reuse
- Add check_planning_needs_upgrade() helper for per-repo checks
- After version upgrades, scan registered repos for outdated planning
  templates and offer to upgrade them (runs upgrade-planning --force)
- Shows current vs latest template version and what's new
- Only checks repos with planning feature enabled
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

Warning

Rate limit exceeded

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


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

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 aidevops update command by integrating a new feature that automatically detects and offers upgrades for outdated TODO.md and PLANS.md planning templates across all registered repositories. This ensures that project documentation remains consistent with the latest template versions, improving maintainability and feature adoption by providing a streamlined, interactive upgrade process.

Highlights

  • Automated Planning Template Version Checks: The aidevops update command now automatically scans registered repositories for outdated TODO.md and PLANS.md planning templates.
  • Interactive Template Upgrade Prompt: Users are prompted to upgrade their planning files if template version mismatches or missing metadata markers are detected, with an option to perform the upgrade automatically.
  • Refactored Planning File Version Logic: The check_planning_file_version function has been extracted and made reusable, centralizing the logic for determining if a planning file needs an upgrade.
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.

@sonarqubecloud
Copy link

@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, 362 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Jan 24 01:29:22 UTC 2026: Code review monitoring started
Sat Jan 24 01:29:23 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 362
Sat Jan 24 01:29:23 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Jan 24 01:29:25 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 362
  • VULNERABILITIES: 0

Generated on: Sat Jan 24 01:30:40 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit ecc4602 into main Jan 24, 2026
9 checks passed
@augmentcode
Copy link

augmentcode bot commented Jan 24, 2026

🤖 Augment PR Summary

Summary: Extends aidevops update to detect outdated planning templates across registered projects and optionally upgrade them.

Changes:

  • Added reusable helpers (check_planning_file_version, check_planning_needs_upgrade) to compare planning files against shipped templates using TOON:meta version markers.
  • Updated cmd_update to scan registered repos with planning enabled, report mismatches, and optionally run upgrade-planning --force per repo.
  • Refactored cmd_upgrade_planning to rely on the shared version-check helper while keeping per-file warnings.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

print_warning "$label format version $current_ver -> $template_ver (adds risk field, updated estimates)"
return 0
# Check TODO.md
if check_planning_file_version "$todo_file" "$todo_template"; then
Copy link

Choose a reason for hiding this comment

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

check_planning_file_version currently returns “up to date” when the planning file is missing, so cmd_upgrade_planning will treat a missing TODO.md/todo/PLANS.md as already up to date and skip the create-from-template path. This can also lead to printing an empty version string from the else branch when the file doesn’t exist.

Other Locations
  • aidevops.sh:1231

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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 useful feature for checking and upgrading planning templates. The implementation is solid, but there are several opportunities to improve maintainability and robustness by reducing code duplication and using more consistent tooling.

My review includes suggestions to:

  • Extract repeated version-parsing logic into a helper function.
  • Use jq for JSON parsing consistently, instead of grep.
  • Refactor duplicated blocks of code within cmd_upgrade_planning into a local helper function.
  • Simplify conditional logic for better readability.

Addressing these points will make the script more maintainable and easier to extend in the future.

Comment on lines +633 to +637
local has_planning
has_planning=$(grep -o '"planning": *true' "$repo_path/.aidevops.json" 2>/dev/null || true)
if [[ -n "$has_planning" ]] && check_planning_needs_upgrade "$repo_path"; then
repos_needing_planning+=("$repo_path")
fi

Choose a reason for hiding this comment

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

high

The script uses grep to check if the "planning": true key-value pair exists in .aidevops.json. This is inconsistent with other parts of the script that use jq for robust JSON parsing. Using jq is more reliable as it's not affected by whitespace or formatting changes in the JSON file. Since jq is a dependency for this script, it should be used here for consistency and correctness.

Suggested change
local has_planning
has_planning=$(grep -o '"planning": *true' "$repo_path/.aidevops.json" 2>/dev/null || true)
if [[ -n "$has_planning" ]] && check_planning_needs_upgrade "$repo_path"; then
repos_needing_planning+=("$repo_path")
fi
if jq -e '.features.planning == true' "$repo_path/.aidevops.json" &>/dev/null; then
if check_planning_needs_upgrade "$repo_path"; then
repos_needing_planning+=("$repo_path")
fi
fi

Comment on lines +1208 to 1250
# Check TODO.md
if check_planning_file_version "$todo_file" "$todo_template"; then
if [[ -f "$todo_file" ]]; then
if ! grep -q "TOON:meta" "$todo_file" 2>/dev/null; then
print_warning "TODO.md uses minimal template (missing TOON markers)"
else
local current_ver template_ver
current_ver=$(grep -A1 "TOON:meta" "$todo_file" 2>/dev/null | tail -1 | cut -d',' -f1)
template_ver=$(grep -A1 "TOON:meta" "$todo_template" 2>/dev/null | tail -1 | cut -d',' -f1)
print_warning "TODO.md format version $current_ver -> $template_ver (adds risk field, updated estimates)"
fi
print_success "$label already up to date (v${current_ver})"
return 1
else
print_info "$label not found - will create from template"
return 0
print_info "TODO.md not found - will create from template"
fi
}

# Check TODO.md
if check_planning_file_version "$todo_file" "$todo_template" "TODO.md"; then
todo_needs_upgrade=true
needs_upgrade=true
else
local current_ver
current_ver=$(grep -A1 "TOON:meta" "$todo_file" 2>/dev/null | tail -1 | cut -d',' -f1)
print_success "TODO.md already up to date (v${current_ver})"
fi

# Check PLANS.md
if check_planning_file_version "$plans_file" "$plans_template" "todo/PLANS.md"; then
if check_planning_file_version "$plans_file" "$plans_template"; then
if [[ -f "$plans_file" ]]; then
if ! grep -q "TOON:meta" "$plans_file" 2>/dev/null; then
print_warning "todo/PLANS.md uses minimal template (missing TOON markers)"
else
local current_plans_ver template_plans_ver
current_plans_ver=$(grep -A1 "TOON:meta" "$plans_file" 2>/dev/null | tail -1 | cut -d',' -f1)
template_plans_ver=$(grep -A1 "TOON:meta" "$plans_template" 2>/dev/null | tail -1 | cut -d',' -f1)
print_warning "todo/PLANS.md format version $current_plans_ver -> $template_plans_ver"
fi
else
print_info "todo/PLANS.md not found - will create from template"
fi
plans_needs_upgrade=true
needs_upgrade=true
else
local current_plans_ver
current_plans_ver=$(grep -A1 "TOON:meta" "$plans_file" 2>/dev/null | tail -1 | cut -d',' -f1)
print_success "todo/PLANS.md already up to date (v${current_plans_ver})"
fi

Choose a reason for hiding this comment

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

high

There's significant code duplication between the logic for checking TODO.md and PLANS.md. This makes the code harder to read and maintain, as any changes to the checking logic would need to be applied in two places.

I recommend extracting this logic into a new local helper function. This function would handle checking a single planning file, printing the appropriate status message, and returning whether an upgrade is needed. This refactoring will improve code clarity and maintainability.

    # Helper to check a single planning file and print status
    _print_planning_file_status() {
        local file="$1" template="$2" label="$3"

        if ! check_planning_file_version "$file" "$template"; then
            local current_ver
            current_ver=$(grep -A1 "TOON:meta" "$file" 2>/dev/null | tail -1 | cut -d',' -f1)
            print_success "$label already up to date (v${current_ver:-unknown})"
            return 1
        fi

        if [[ -f "$file" ]]; then
            if ! grep -q "TOON:meta" "$file" 2>/dev/null; then
                print_warning "$label uses minimal template (missing TOON markers)"
            else
                local current_ver template_ver
                current_ver=$(grep -A1 "TOON:meta" "$file" 2>/dev/null | tail -1 | cut -d',' -f1)
                template_ver=$(grep -A1 "TOON:meta" "$template" 2>/dev/null | tail -1 | cut -d',' -f1)
                local extra_msg=""
                if [[ "$label" == "TODO.md" ]]; then
                    extra_msg=" (adds risk field, updated estimates)"
                fi
                print_warning "$label format version ${current_ver:-none} -> ${template_ver}${extra_msg}"
            fi
        else
            print_info "$label not found - will create from template"
        fi
        return 0
    }

    # Check TODO.md
    if _print_planning_file_status "$todo_file" "$todo_template" "TODO.md"; then
        todo_needs_upgrade=true
        needs_upgrade=true
    fi

    # Check PLANS.md
    if _print_planning_file_status "$plans_file" "$plans_template" "todo/PLANS.md"; then
        plans_needs_upgrade=true
        needs_upgrade=true
    fi

Comment on lines +156 to +176
# Check if a planning file needs upgrading (version mismatch or missing TOON markers)
# Usage: check_planning_file_version <file> <template>
# Returns 0 if upgrade needed, 1 if up to date
check_planning_file_version() {
local file="$1" template="$2"
if [[ -f "$file" ]]; then
if ! grep -q "TOON:meta" "$file" 2>/dev/null; then
return 0
fi
local current_ver template_ver
current_ver=$(grep -A1 "TOON:meta" "$file" 2>/dev/null | tail -1 | cut -d',' -f1)
template_ver=$(grep -A1 "TOON:meta" "$template" 2>/dev/null | tail -1 | cut -d',' -f1)
if [[ -n "$template_ver" ]] && [[ "$current_ver" != "$template_ver" ]]; then
return 0
fi
return 1
else
# No file = no upgrade needed (init would create it)
return 1
fi
}

Choose a reason for hiding this comment

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

medium

The logic to extract the version from TOON meta blocks is repeated in multiple places in this PR. To improve maintainability and reduce code duplication, I suggest extracting this logic into a helper function _get_toon_version and using it within check_planning_file_version. This new helper can then be reused in cmd_update and cmd_upgrade_planning to centralize version extraction.

# Helper to get version from a TOON meta block
_get_toon_version() {
    local file="$1"
    grep -A1 "TOON:meta" "$file" 2>/dev/null | tail -1 | cut -d',' -f1
}

# Check if a planning file needs upgrading (version mismatch or missing TOON markers)
# Usage: check_planning_file_version <file> <template>
# Returns 0 if upgrade needed, 1 if up to date
check_planning_file_version() {
    local file="$1" template="$2"
    if [[ -f "$file" ]]; then
        if ! grep -q "TOON:meta" "$file" 2>/dev/null; then
            return 0
        fi
        local current_ver template_ver
        current_ver=$(_get_toon_version "$file")
        template_ver=$(_get_toon_version "$template")
        if [[ -n "$template_ver" ]] && [[ "$current_ver" != "$template_ver" ]]; then
            return 0
        fi
        return 1
    else
        # No file = no upgrade needed (init would create it)
        return 1
    fi
}

Comment on lines +189 to +195
if check_planning_file_version "$todo_file" "$todo_template"; then
return 0
fi
if [[ -f "$plans_template" ]] && check_planning_file_version "$plans_file" "$plans_template"; then
return 0
fi
return 1

Choose a reason for hiding this comment

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

medium

The conditional logic here can be simplified for better readability and conciseness. You can combine the checks using an || operator, which makes the function's intent clearer at a glance.

Suggested change
if check_planning_file_version "$todo_file" "$todo_template"; then
return 0
fi
if [[ -f "$plans_template" ]] && check_planning_file_version "$plans_file" "$plans_template"; then
return 0
fi
return 1
if check_planning_file_version "$todo_file" "$todo_template" || \
( [[ -f "$plans_template" ]] && check_planning_file_version "$plans_file" "$plans_template" ); then
return 0
fi
return 1

marcusquinn added a commit that referenced this pull request Jan 24, 2026
- #160: aidevops update auto-detects outdated planning templates
- #159: session-time-helper for active time analysis, risk:low/med/high field
- #157: content summaries in progressive disclosure pattern
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