Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions .agents/scripts/localdev-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ configure_resolver() {
# Traefik conf.d Migration
# =============================================================================
# Migrates from single dynamic.yml to conf.d/ directory provider.
# Preserves existing routes (e.g., awardsapp) by splitting into per-app files.
# Preserves existing routes (e.g., webapp) by splitting into per-app files.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Run ShellCheck on the target script
if [ -f ".agents/scripts/localdev-helper.sh" ]; then
  echo "=== Running ShellCheck ==="
  shellcheck -x -f gcc .agents/scripts/localdev-helper.sh 2>&1 || true
else
  echo "File not found: .agents/scripts/localdev-helper.sh"
fi

Repository: marcusquinn/aidevops

Length of output: 202


🏁 Script executed:

#!/bin/bash
# Examine the changed lines to understand the modifications
echo "=== Changed line 188 ==="
sed -n '185,191p' .agents/scripts/localdev-helper.sh | cat -n

echo -e "\n=== Changed lines 225-233 ==="
sed -n '225,233p' .agents/scripts/localdev-helper.sh | cat -n

echo -e "\n=== Changed lines 239-270 ==="
sed -n '239,270p' .agents/scripts/localdev-helper.sh | cat -n

echo -e "\n=== Changed line 2308 ==="
sed -n '2305,2311p' .agents/scripts/localdev-helper.sh | cat -n

Repository: marcusquinn/aidevops

Length of output: 2483


🏁 Script executed:

#!/bin/bash
# Check script size and overall structure
echo "=== Script statistics ==="
wc -l .agents/scripts/localdev-helper.sh
echo ""
echo "=== Verify script is executable and well-formed ==="
bash -n .agents/scripts/localdev-helper.sh && echo "✓ Syntax valid" || echo "✗ Syntax error"

Repository: marcusquinn/aidevops

Length of output: 197


Address pre-existing ShellCheck violation before committing.

ShellCheck found a minor SC2086 note at line 1055 (double quote to prevent globbing). The changed segments are syntactically sound and follow proper shell scripting patterns (error redirects, conditionals, heredoc usage). Per guidelines, resolve the pre-existing SC2086 and run .agents/scripts/linters-local.sh before committing.

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

In @.agents/scripts/localdev-helper.sh at line 188, There is a ShellCheck SC2086
warning for an unquoted variable expansion in the "Preserves existing routes
(e.g., webapp) by splitting into per-app files." block; locate the unquoted
parameter expansion around that section (the token causing SC2086, e.g., an
instance of $FOO or $routes used without quotes) and wrap it in double quotes
(change $var to "$var") to prevent globbing/word-splitting, then re-run
.agents/scripts/linters-local.sh to verify the warning is resolved before
committing.


migrate_traefik_to_confd() {
print_info "Migrating Traefik to conf.d/ directory provider..."
Expand Down Expand Up @@ -222,34 +222,34 @@ migrate_dynamic_yml() {
cp "$dynamic_yml" "$BACKUP_DIR/$backup_name"
print_info "Backed up dynamic.yml to $BACKUP_DIR/$backup_name"

# Check if awardsapp route exists in dynamic.yml
if grep -q 'awardsapp' "$dynamic_yml" 2>/dev/null; then
# Extract and create awardsapp conf.d file
if [[ ! -f "$CONFD_DIR/awardsapp.yml" ]]; then
create_awardsapp_confd
print_success "Migrated awardsapp route to conf.d/awardsapp.yml"
# Check if webapp route exists in dynamic.yml
if grep -q 'webapp' "$dynamic_yml" 2>/dev/null; then
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

The error suppression 2>/dev/null is unnecessary here as the existence of $dynamic_yml is already checked earlier in the migrate_traefik_to_confd function. Removing the suppression will make potential issues like file read permissions visible for easier debugging.

Suggested change
if grep -q 'webapp' "$dynamic_yml" 2>/dev/null; then
if grep -q 'webapp' "$dynamic_yml"; then
References
  1. Avoid using 2>/dev/null to suppress errors on file operations if the file's existence has already been verified by a preceding check (e.g., [[ -f "$file" ]] or an early return). This practice is redundant for 'file not found' errors and can mask other important issues like permissions problems.

# Extract and create webapp conf.d file
if [[ ! -f "$CONFD_DIR/webapp.yml" ]]; then
create_webapp_confd
print_success "Migrated webapp route to conf.d/webapp.yml"
else
print_info "conf.d/awardsapp.yml already exists — skipping migration"
print_info "conf.d/webapp.yml already exists — skipping migration"
fi
fi

return 0
}

# Create the awardsapp conf.d file from the known existing config
create_awardsapp_confd() {
cat >"$CONFD_DIR/awardsapp.yml" <<'YAML'
# Create the webapp conf.d file from the known existing config
create_webapp_confd() {
cat >"$CONFD_DIR/webapp.yml" <<'YAML'
http:
routers:
awardsapp:
rule: "Host(`awardsapp.local`)"
webapp:
rule: "Host(`webapp.local`)"
entryPoints:
- websecure
service: awardsapp
service: webapp
tls: {}

services:
awardsapp:
webapp:
loadBalancer:
servers:
- url: "http://host.docker.internal:3100"
Expand All @@ -265,8 +265,8 @@ http:

tls:
certificates:
- certFile: /certs/awardsapp.local+1.pem
keyFile: /certs/awardsapp.local+1-key.pem
- certFile: /certs/webapp.local+1.pem
keyFile: /certs/webapp.local+1-key.pem
YAML
return 0
}
Expand Down Expand Up @@ -2305,7 +2305,7 @@ cmd_help() {
echo " 1. Configure dnsmasq with address=/.local/127.0.0.1 (CLI wildcard resolution)"
echo " 2. Create /etc/resolver/local (routes .local to dnsmasq for CLI tools)"
echo " 3. Migrate Traefik from single dynamic.yml to conf.d/ directory"
echo " 4. Preserve existing routes (e.g., awardsapp)"
echo " 4. Preserve existing routes (e.g., webapp)"
echo " 5. Restart Traefik if running"
echo " Note: dnsmasq resolves .local for CLI tools only. Browsers need /etc/hosts"
echo " entries (added automatically by 'add' command) due to macOS mDNS."
Expand Down
2 changes: 1 addition & 1 deletion .agents/scripts/supervisor/ai-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ _exec_create_subtasks() {
# Resolve the task's repo from the supervisor DB (t1234, t1237).
# Tasks are always repo-specific — never guess by falling back to the
# primary repo, because task IDs can collide across repos (e.g., both
# aidevops and awardsapp have t003 for different things). Writing to
# aidevops and webapp have t003 for different things). Writing to
# the wrong repo is a privacy breach if repo visibility differs.
Comment on lines 1446 to 1450
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Run ShellCheck on the supervisor script
if [ -f ".agents/scripts/supervisor/ai-actions.sh" ]; then
  echo "=== Running ShellCheck on ai-actions.sh ==="
  shellcheck .agents/scripts/supervisor/ai-actions.sh 2>&1
  exit_code=$?
  echo ""
  echo "Exit code: $exit_code"
  if [ $exit_code -eq 0 ]; then
    echo "✓ ShellCheck passed with no issues"
  else
    echo "✗ ShellCheck found issues (see above)"
  fi
else
  echo "File not found: .agents/scripts/supervisor/ai-actions.sh"
fi

Repository: marcusquinn/aidevops

Length of output: 1937


ShellCheck found 6 info-level issues — review and address before commit.

ShellCheck reports:

  • SC2016 (lines 1402, 2142, 2169): Single quotes in sed patterns flagged as preventing variable expansion. Verify if double quotes are needed or if these patterns are intentionally literal.
  • SC1091 (lines 2393, 2395, 2397): Source directives not followed — run shellcheck -x to include external sourced files and suppress these warnings.

Address the SC2016 warnings and confirm the file passes ShellCheck cleanly (exit code 0) per the A-grade automation toolchain standard.

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

In @.agents/scripts/supervisor/ai-actions.sh around lines 1446 - 1450,
ShellCheck flagged three sed usages with SC2016 and three source directives with
SC1091; for the sed instances (the sed commands that currently use single-quoted
patterns) decide whether variables should expand—if they should, change the
pattern quotes to double quotes so variables expand (or concatenate the variable
outside the single-quoted literal), otherwise add an inline comment clarifying
the literal intent or escape the $ to silence ShellCheck; for the SC1091 source
warnings, update the source statements to use explicit, resolvable paths (e.g.,
build an absolute path with dirname "$0") and guard them with if [ -f ... ];
then . "path"; fi or run shellcheck with -x in CI so external sourced files are
included; after making these changes, run shellcheck (shellcheck -x) and ensure
exit code 0.

#
# If the parent task is NOT in the DB, refuse to proceed — the AI reasoner
Expand Down
2 changes: 1 addition & 1 deletion .agents/scripts/supervisor/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,7 @@ rebase_sibling_pr() {
fi

# Determine the rebase target branch from the PR's base ref (e.g. develop, main).
# Repos like awardsapp use 'develop' as default branch — hardcoding 'main' causes
# Repos like webapp use 'develop' as default branch — hardcoding 'main' causes
# rebases onto the wrong branch, leaving PRs permanently DIRTY.
local rebase_target="main"
if [[ -n "$tpr" && "$tpr" != "no_pr" && "$tpr" != "task_only" && "$tpr" != "verified_complete" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .agents/scripts/supervisor/dispatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2684,7 +2684,7 @@ cmd_dispatch() {
# t1239: Pre-dispatch cross-repo validation.
# Verify the task's registered repo actually contains this task in its TODO.md.
# This is the last line of defence against cross-repo misregistration — if a task
# from a private repo (e.g., awardsapp) was registered under the wrong repo path
# from a private repo (e.g., webapp) was registered under the wrong repo path
# (e.g., aidevops), the worker would run in the wrong codebase. Cancel instead.
local dispatch_todo_file="${trepo:-.}/TODO.md"
if [[ -n "$trepo" && -f "$dispatch_todo_file" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .agents/services/hosting/local-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ Bun.serve({ port: 3100 })

### Turbostarter / Turborepo Monorepo

Turbostarter (and similar Turborepo-based monorepos) have specific quirks discovered during the awardsapp migration:
Turbostarter (and similar Turborepo-based monorepos) have specific quirks discovered during the webapp migration:

**1. Port hardcoded in `apps/web/package.json`** (not via `PORT` env var):

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- replace declare -A with bash 3.2-compatible grep lookup in ai-context.sh (t1236) (#1918)
- guard cmd_push() against cross-repo issue creation (t1235) (#1913)
- add cross-repo guard to issue-sync-helper.sh (t1235) (#1912)
- remove misplaced awardsapp subtasks from aidevops TODO.md (privacy breach)
- remove misplaced private repo subtasks from aidevops TODO.md (privacy breach)
- strengthen execute_action_plan array validation guard (t1223) (#1872)
- add post-write verification to create_subtasks executor (t1217) (#1858)
- add semantic dedup to AI task creation to prevent duplicate tasks (t1218) (#1859)
Expand Down
Loading
Loading