Skip to content

t1264.3: Integrate repo-sync into aidevops CLI, setup.sh, and onboarding#2016

Merged
marcusquinn merged 1 commit intomainfrom
feature/t1264.3
Feb 20, 2026
Merged

t1264.3: Integrate repo-sync into aidevops CLI, setup.sh, and onboarding#2016
marcusquinn merged 1 commit intomainfrom
feature/t1264.3

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 20, 2026

Add repo-sync parent directories onboarding question to onboarding-helper.sh.

Changes:

  • check_repo_sync(): shows repo-sync scheduler status and configured dir count in status output
  • configure_dirs(): interactive prompt to add git parent directories, delegates to repo-sync-helper.sh dirs add
  • configure-dirs command added to main() case statement
  • show_help() updated to document new command
  • check_repo_sync added to show_status() output

Note: aidevops.sh repo-sync case and setup.sh enable prompt were already present in main (implemented in prior subtasks).

Ref #1987

Summary by CodeRabbit

  • New Features

    • Added "configure-dirs" command to configure Git parent directories for repo-sync.
    • Extended status output to include repo-sync status information.
  • Style

    • Improved code consistency and formatting throughout the onboarding helper.

…per.sh (t1264.3)

- Add check_repo_sync() to show repo-sync scheduler and dir count in status
- Add configure_dirs() for interactive parent directory setup
- Add configure-dirs command to main() case statement
- Update show_help() to document new command
- Integrates with repo-sync-helper.sh dirs add for config management
@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 enhances the aidevops onboarding experience by integrating repo-sync configuration directly into the onboarding-helper.sh script. It introduces new functionalities to check the status of the repo-sync scheduler and to interactively configure git parent directories, making it easier for users to set up and manage their repository synchronization.

Highlights

  • Repo Sync Status Check: Introduced a new check_repo_sync function to display the status of the repo-sync scheduler and the count of configured parent directories within the aidevops onboarding helper.
  • Interactive Directory Configuration: Added a configure_dirs function that provides an interactive prompt for users to add git parent directories for repo-sync, delegating to repo-sync-helper.sh or falling back to direct configuration.
  • CLI Command and Help Update: Extended the onboarding-helper.sh CLI with a new configure-dirs command and updated the show_help message to document this new functionality, along with a minor text correction.
  • Service Status Integration: Integrated the check_repo_sync status into the overall aidevops service status display provided by the show_status function.
Changelog
  • .agents/scripts/onboarding-helper.sh
    • Added check_repo_sync function to report repo-sync scheduler status and configured directory count.
    • Added configure_dirs function for interactive setup of git parent directories.
    • Updated show_status to include the output from check_repo_sync.
    • Modified show_help to document the new configure-dirs command.
    • Updated main function to dispatch the configure-dirs command.
    • Corrected a typo in the show_help message, changing "OpenCode" to "Claude Code".
Activity
  • No specific review comments or activities were provided in the context.
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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

Walkthrough

The pull request refactors .agents/scripts/onboarding-helper.sh for consistent shell styling, introduces a new interactive configure-dirs command to manage Git parent directories for repo-sync, and extends the status workflow to include repo-sync health checks.

Changes

Cohort / File(s) Summary
Shell Script Refactoring & Enhancement
.agents/scripts/onboarding-helper.sh
Consolidated indentation and spacing patterns across functions; streamlined multi-line condition blocks (e.g., is_configured, is_cli_authenticated, is_installed, print_service) with no semantic change. Added new interactive configure-dirs command (alias dirs) for configuring Git parent directories. Extended status workflow with check_repo_sync to report repo-sync health in overall status output. Updated command dispatcher and help system to recognize and route the new configure-dirs command alongside existing commands (status, recommend, guide, json, help).

Sequence Diagram

sequenceDiagram
    participant User
    participant Script as onboarding-helper.sh
    participant GitConfig as Git Configuration
    participant RepoSync as repo-sync

    User->>Script: Run "configure-dirs" (or "dirs")
    Script->>User: Prompt for Git parent directory path(s)
    User->>Script: Provide directory input
    Script->>Script: Validate & format input
    Script->>GitConfig: Write git_parent_dirs config
    GitConfig-->>Script: Config stored
    Script->>User: Display confirmation
    
    Note over Script,RepoSync: Later invocations...
    User->>Script: Run "status"
    Script->>Script: Execute check_repo_sync
    Script->>RepoSync: Query repo-sync state
    RepoSync->>GitConfig: Read git_parent_dirs config
    GitConfig-->>RepoSync: Config retrieved
    RepoSync-->>Script: Status information
    Script->>User: Display overall status (including Repo Sync)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

Poem

🔧 A script once plain, now refactored with care,
Configure your repos—directories declared!
With dirs at your command, the path flows just right,
repo-sync checks the status, all gleaming and bright. ✨

🚥 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 accurately reflects the main changes: integrating repo-sync functionality into the onboarding-helper.sh script with new configure-dirs command and status checks.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% 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 docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t1264.3

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, 30 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 20 17:53:48 UTC 2026: Code review monitoring started
Fri Feb 20 17:53:48 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 30

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 30
  • VULNERABILITIES: 0

Generated on: Fri Feb 20 17:53:51 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

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

The pull request integrates repo-sync functionality into the onboarding-helper.sh script, adding a new check_repo_sync function to display its status and a configure_dirs function for interactive setup of parent directories. The show_status and show_help functions have been updated to reflect these changes. The changes are well-implemented and follow the existing code style. I've provided some feedback regarding error handling and consistency in output messages, incorporating repository-specific rules for shell scripting practices.

# Check configured parent dirs
local dir_count=0
if [[ -f "$config_file" ]] && command -v jq &>/dev/null; then
dir_count=$(jq -r '.git_parent_dirs[]? // empty' "$config_file" 2>/dev/null | wc -l | tr -d ' ')

Choose a reason for hiding this comment

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

medium

The jq command should not suppress stderr with 2>/dev/null to ensure diagnostic information is visible, as per repository guidelines. If jq fails on an optional lookup, dir_count should correctly be 0. The || true pattern is used to prevent script exit while allowing stderr to be visible and ensuring wc -l correctly yields 0 on empty input.

Suggested change
dir_count=$(jq -r '.git_parent_dirs[]? // empty' "$config_file" 2>/dev/null | wc -l | tr -d ' ')
if [[ -f "$config_file" ]] && command -v jq >/dev/null; then
dir_count=$(jq -r '.git_parent_dirs[]? // empty' "$config_file" || true | wc -l)
fi
References
  1. In shell scripts with 'set -e' enabled, use '|| true' to prevent the script from exiting when a command like 'jq' fails on an optional lookup. Do not suppress stderr with '2>/dev/null' so that actual syntax or system errors remain visible for debugging.
  2. When reporting errors for failed file operations in shell scripts, such as 'jq' writes, include the file path in the error message. Avoid suppressing stderr with '2>/dev/null' to ensure that diagnostic information about malformed files or write failures is visible.

if bash "$repo_sync_script" dirs add "$new_dir"; then
added=$((added + 1))
fi
else

Choose a reason for hiding this comment

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

medium

The fallback mechanism for adding directories should handle jq failures or write errors. The error message should include the file path for better debugging, as per repository guidelines for failed file operations. The current suggestion correctly uses continue to skip to the next iteration.

Suggested change
else
if jq --arg d "$normalized" '.git_parent_dirs += [$d]' "$config_file" >"$temp_file"; then
mv "$temp_file" "$config_file"
echo "Added: $normalized"
added=$((added + 1))
else
rm -f "$temp_file"
echo "Error: Failed to add '$new_dir' to '$config_file'. Check permissions or file format." >&2
continue # Skip to the next iteration if adding failed
fi
References
  1. When reporting errors for failed file operations in shell scripts, such as 'jq' writes, include the file path in the error message. Avoid suppressing stderr with '2>/dev/null' to ensure that diagnostic information about malformed files or write failures is visible.

echo " $0 guide openai"
echo " $0 configure-dirs"
echo ""
echo "Use /onboarding in Claude Code for the full interactive experience."

Choose a reason for hiding this comment

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

medium

The message "Use /onboarding in Claude Code for the full interactive experience." is updated to "Claude Code". This should be consistent with the rest of the codebase. If the intention is to refer to a specific tool, it should be explicitly named.

Suggested change
echo "Use /onboarding in Claude Code for the full interactive experience."
echo -e "Use /onboarding in OpenCode for the full interactive experience."

coderabbitai[bot]
coderabbitai bot previously requested changes Feb 20, 2026
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

🧹 Nitpick comments (3)
.agents/scripts/onboarding-helper.sh (3)

448-449: repo_sync_script path duplicated across two functions.

"$HOME/.aidevops/agents/scripts/repo-sync-helper.sh" is defined identically at Line 448 (check_repo_sync) and Line 481 (configure_dirs). A single file-scope readonly keeps this DRY and avoids drift.

♻️ Proposed refactor

Add near the other readonly constants at the top of the file:

+readonly REPO_SYNC_SCRIPT="$HOME/.aidevops/agents/scripts/repo-sync-helper.sh"

Then in both functions:

-	local repo_sync_script="$HOME/.aidevops/agents/scripts/repo-sync-helper.sh"
+	local repo_sync_script="$REPO_SYNC_SCRIPT"

Also applies to: 481-482

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/onboarding-helper.sh around lines 448 - 449, The
repo_sync_script path is duplicated inside check_repo_sync and configure_dirs;
define a single file-scope readonly variable (e.g., readonly REPO_SYNC_SCRIPT)
near the other readonly constants at the top of the script and replace the local
definitions in the functions (check_repo_sync and configure_dirs) with
references to that constant to keep the value DRY and avoid divergence.

325-325: Redundant 2>&1 after &>/dev/null.

&>/dev/null already redirects both stdout and stderr to /dev/null; the trailing 2>&1 is a no-op. Appears on Lines 325, 425, and 944.

♻️ Proposed cleanup (repeat for Lines 425, 944)
-	if is_installed "npx" && npx --no-install playwright --version &>/dev/null 2>&1; then
+	if is_installed "npx" && npx --no-install playwright --version &>/dev/null; then

Also applies to: 425-425, 944-944

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/onboarding-helper.sh at line 325, The shell redirection
"&>/dev/null 2>&1" is redundant in the is_installed checks; remove the trailing
"2>&1" so the command uses only "&>/dev/null". Update each occurrence that
checks npx/playwright version (the lines using is_installed "npx" and the
command `npx --no-install playwright --version`) — there are three instances
noted — to eliminate the extraneous "2>&1", leaving "&>/dev/null" as the sole
stdout+stderr redirect.

49-50: ${value,,} avoids the fork-per-call in hot-path helpers.

echo "$value" | tr spawns two subprocesses on every call to is_configured. Since this function is invoked ~20+ times per status run, the bash built-in lowercase expansion is a free win.

♻️ Proposed refactor
-	local lower_value
-	lower_value=$(echo "$value" | tr '[:upper:]' '[:lower:]')
+	local lower_value="${value,,}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/onboarding-helper.sh around lines 49 - 50, Replace the
external echo+tr pipeline in is_configured with bash parameter expansion to
avoid forking: instead of running lower_value=$(echo "$value" | tr '[:upper:]'
'[:lower:]'), assign lower_value="${value,,}" (ensure the script is run with
bash so ${value,,} is supported and keep the variable name lower_value and the
is_configured function intact).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/scripts/onboarding-helper.sh:
- Around line 550-559: The fallback jq append unconditionally (jq
'.git_parent_dirs += [$d]') and can write duplicate entries for the same path
(variables: config_file, temp_file, normalized, new_dir), so change the jq
invocation to first deduplicate or check for existence before appending: either
use an expression like '.git_parent_dirs = (.git_parent_dirs + [$d] | unique)'
or conditional append 'if (.git_parent_dirs | index($d)) then . else
.git_parent_dirs += [$d] end', write to temp_file and mv on success as before,
and adjust the echo messages to reflect whether the path was added or already
present; keep the existing rm -f "$temp_file" on failure.
- Around line 530-534: The read in the while loop that prompts for "Parent
directory" (the read -r -p that stores into new_dir) can return non-zero on EOF
(Ctrl+D) and triggers a set -e exit; fix it by explicitly guarding the read's
exit status: perform the read inside a conditional or immediately test its
return and treat non-zero (EOF) as a graceful break (i.e., if the read fails,
break the loop), leaving the existing empty-input check for new_dir intact.

---

Nitpick comments:
In @.agents/scripts/onboarding-helper.sh:
- Around line 448-449: The repo_sync_script path is duplicated inside
check_repo_sync and configure_dirs; define a single file-scope readonly variable
(e.g., readonly REPO_SYNC_SCRIPT) near the other readonly constants at the top
of the script and replace the local definitions in the functions
(check_repo_sync and configure_dirs) with references to that constant to keep
the value DRY and avoid divergence.
- Line 325: The shell redirection "&>/dev/null 2>&1" is redundant in the
is_installed checks; remove the trailing "2>&1" so the command uses only
"&>/dev/null". Update each occurrence that checks npx/playwright version (the
lines using is_installed "npx" and the command `npx --no-install playwright
--version`) — there are three instances noted — to eliminate the extraneous
"2>&1", leaving "&>/dev/null" as the sole stdout+stderr redirect.
- Around line 49-50: Replace the external echo+tr pipeline in is_configured with
bash parameter expansion to avoid forking: instead of running lower_value=$(echo
"$value" | tr '[:upper:]' '[:lower:]'), assign lower_value="${value,,}" (ensure
the script is run with bash so ${value,,} is supported and keep the variable
name lower_value and the is_configured function intact).

Comment on lines +530 to +534
while true; do
read -r -p "Parent directory (e.g. ~/Git): " new_dir
if [[ -z "$new_dir" ]]; then
break
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

read without EOF guard causes abrupt set -e exit on Ctrl+D.

read's exit status is non-zero when EOF is encountered. Because set -euo pipefail is active and this read sits in the loop body (not in an if condition), pressing Ctrl+D instead of typing an empty line causes the whole script to exit with a non-zero code — confusing for users who expect graceful cancellation.

🛡️ Proposed fix
-		read -r -p "Parent directory (e.g. ~/Git): " new_dir
-		if [[ -z "$new_dir" ]]; then
-			break
-		fi
+		read -r -p "Parent directory (e.g. ~/Git): " new_dir || break
+		if [[ -z "$new_dir" ]]; then
+			break
+		fi

As per coding guidelines for .agents/scripts/*.sh: "Reliability and robustness".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
while true; do
read -r -p "Parent directory (e.g. ~/Git): " new_dir
if [[ -z "$new_dir" ]]; then
break
fi
while true; do
read -r -p "Parent directory (e.g. ~/Git): " new_dir || break
if [[ -z "$new_dir" ]]; then
break
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/onboarding-helper.sh around lines 530 - 534, The read in the
while loop that prompts for "Parent directory" (the read -r -p that stores into
new_dir) can return non-zero on EOF (Ctrl+D) and triggers a set -e exit; fix it
by explicitly guarding the read's exit status: perform the read inside a
conditional or immediately test its return and treat non-zero (EOF) as a
graceful break (i.e., if the read fails, break the loop), leaving the existing
empty-input check for new_dir intact.

Comment on lines +550 to +559
fi
local temp_file="${config_file}.tmp"
if jq --arg d "$normalized" '.git_parent_dirs += [$d]' "$config_file" >"$temp_file"; then
mv "$temp_file" "$config_file"
echo "Added: $normalized"
added=$((added + 1))
else
rm -f "$temp_file"
echo "Failed to add: $new_dir"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fallback path silently adds duplicate directories.

The primary path (repo_sync_script dirs add) presumably deduplicates, but the fallback jq '.git_parent_dirs += [$d]' appends unconditionally. Entering the same path twice in one session writes it twice to repos.json, which could cause double-sync noise.

🛡️ Proposed fix — deduplicate before appending
-			if jq --arg d "$normalized" '.git_parent_dirs += [$d]' "$config_file" >"$temp_file"; then
+			if jq --arg d "$normalized" \
+				'if (.git_parent_dirs | index($d)) then . else .git_parent_dirs += [$d] end' \
+				"$config_file" >"$temp_file"; then
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fi
local temp_file="${config_file}.tmp"
if jq --arg d "$normalized" '.git_parent_dirs += [$d]' "$config_file" >"$temp_file"; then
mv "$temp_file" "$config_file"
echo "Added: $normalized"
added=$((added + 1))
else
rm -f "$temp_file"
echo "Failed to add: $new_dir"
fi
fi
local temp_file="${config_file}.tmp"
if jq --arg d "$normalized" \
'if (.git_parent_dirs | index($d)) then . else .git_parent_dirs += [$d] end' \
"$config_file" >"$temp_file"; then
mv "$temp_file" "$config_file"
echo "Added: $normalized"
added=$((added + 1))
else
rm -f "$temp_file"
echo "Failed to add: $new_dir"
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/onboarding-helper.sh around lines 550 - 559, The fallback jq
append unconditionally (jq '.git_parent_dirs += [$d]') and can write duplicate
entries for the same path (variables: config_file, temp_file, normalized,
new_dir), so change the jq invocation to first deduplicate or check for
existence before appending: either use an expression like '.git_parent_dirs =
(.git_parent_dirs + [$d] | unique)' or conditional append 'if (.git_parent_dirs
| index($d)) then . else .git_parent_dirs += [$d] end', write to temp_file and
mv on success as before, and adjust the echo messages to reflect whether the
path was added or already present; keep the existing rm -f "$temp_file" on
failure.

@marcusquinn marcusquinn dismissed coderabbitai[bot]’s stale review February 20, 2026 18:25

Auto-dismissed: bot review does not block autonomous pipeline

@marcusquinn marcusquinn merged commit e980ff8 into main Feb 20, 2026
19 checks passed
@marcusquinn marcusquinn deleted the feature/t1264.3 branch February 20, 2026 18:42
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