-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] #48: Create AI branch review command #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| #ddev-generated | ||
|
|
||
| ## Description: Runs AI code review commands. | ||
| ## Usage: review | ||
| ## Example: "ddev review" | ||
| ## ExecRaw: true | ||
|
|
||
| wdr-core tooling review.sh "$@" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,210 @@ | ||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||
| #ddev-generated | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||
| # Helper script to perform AI Code Review on the current branch against a target branch (default: main). | ||||||||||||||||||||||||||||||||||||
| # Usage: ddev ai-review [target-branch] | ||||||||||||||||||||||||||||||||||||
| # Example: ddev ai-review | ||||||||||||||||||||||||||||||||||||
| # Example: ddev ai-review develop | ||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| set -eu | ||||||||||||||||||||||||||||||||||||
| if [[ -n "${WUNDERIO_DEBUG:-}" ]]; then | ||||||||||||||||||||||||||||||||||||
| set -x | ||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # Try to source global helpers if they exist | ||||||||||||||||||||||||||||||||||||
| source "$WUNDERIO_GLOBAL_SCRIPT_ROOT/_helpers.sh" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # Helper function for error messages if _helpers.sh isn't available | ||||||||||||||||||||||||||||||||||||
| display_error_message() { | ||||||||||||||||||||||||||||||||||||
| echo -e "\033[31m$1\033[0m" | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+17
to
+22
|
||||||||||||||||||||||||||||||||||||
| source "$WUNDERIO_GLOBAL_SCRIPT_ROOT/_helpers.sh" 2>/dev/null || true | |
| # Helper function for error messages if _helpers.sh isn't available | |
| display_error_message() { | |
| echo -e "\033[31m$1\033[0m" | |
| } | |
| if [[ -n "${WUNDERIO_GLOBAL_SCRIPT_ROOT:-}" ]] && [[ -f "${WUNDERIO_GLOBAL_SCRIPT_ROOT}/_helpers.sh" ]]; then | |
| # shellcheck disable=SC1090 | |
| source "${WUNDERIO_GLOBAL_SCRIPT_ROOT}/_helpers.sh" | |
| fi | |
| # Helper function for error messages if _helpers.sh isn't available | |
| if ! declare -F display_error_message >/dev/null 2>&1; then | |
| display_error_message() { | |
| echo -e "\033[31m$1\033[0m" | |
| } | |
| fi |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git branch --show-current returns an empty string (exit 0) in detached HEAD state, so the || echo "HEAD" fallback won’t run and CURRENT_BRANCH becomes empty. Handle the empty-string case explicitly so messages and comparisons don’t break (e.g., default to "HEAD" when the output is empty).
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTP status handling assumes $HTTP_STATUS is a valid number. If it’s empty or non-numeric (e.g., curl didn’t write the file), [ "$HTTP_STATUS" -lt 200 ] / -ge 300 will emit errors and may skip the intended failure path. Consider validating that the status is numeric (or explicitly treating empty/"000" as an error) before doing numeric comparisons, similar to the more defensive logic in tooling/commit.sh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header comment documents
ddev ai-review, but this command is wired up asddev review(see commands/web/wunderio-core-review.sh). Update the usage/examples in this script header to match the actual command name to avoid confusing users.