Skip to content

Fix for devclaw up and devclaw status on Mac#27

Merged
achandmsft merged 1 commit into
mainfrom
pamelatry
Jun 13, 2026
Merged

Fix for devclaw up and devclaw status on Mac#27
achandmsft merged 1 commit into
mainfrom
pamelatry

Conversation

@pamelafox

@pamelafox pamelafox commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary

  • make hook scripts executable on macOS/Linux
  • fix preprovision.sh portability issues (grep -E, portable lowercase handling)
  • harden missing azd env key parsing in azd_flag
  • make devclaw status azd-first so app/FQDN can be shown without Azure CLI login
  • remove unsupported westcentralus from allowed regions

Why

  • resolves permission denied and shell-compat failures seen during devclaw up
  • avoids false "No container app found" when Azure CLI context differs from azd env

Validation

  • bash -n infra/hooks/preprovision.sh
  • bash -n ./devclaw
  • ./devclaw status returns app/FQDN/resource with azd metadata

@pamelafox pamelafox changed the title Fix hook portability and improve status reliability Fix for devclaw up and devclaw status on Mac Jun 13, 2026
@pamelafox pamelafox requested review from achandmsft and Copilot June 13, 2026 06:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves cross-platform reliability (macOS/Linux) of the devclaw workflow and azd hook scripts by hardening azd env parsing, reducing bash/grep portability pitfalls, and making devclaw status able to show metadata without requiring an Azure CLI login.

Changes:

  • Updated hook scripts to be more portable (avoid non-portable grep -P, avoid bash-4-only lowercase handling, and harden missing azd env key parsing).
  • Reworked devclaw status to prefer azd metadata (azd show / azd env) and only use Azure CLI opportunistically for live state.
  • Removed westcentralus from the allowed region list.
Show a summary per file
File Description
README.md Adds guidance on when devclaw login is needed for runtime operations.
infra/main.bicep Removes unsupported westcentralus from the allowed region list.
infra/hooks/preprovision.sh Improves portability and robustness of azd env value parsing and GUID checks.
infra/hooks/predeploy.sh Adds POSIX hook for Docker Hub credential setup to mitigate rate limits.
infra/hooks/postprovision.sh Adds POSIX hook to update Easy Auth redirect URI after provisioning.
infra/hooks/postdeploy.sh Adds POSIX hook for post-deploy fixups (scale/ingress/redirect URI/env persistence).
devclaw Makes get_app stricter about Azure CLI login/subscription access and updates status to be azd-first.

Copilot's findings

  • Files reviewed: 4/7 changed files
  • Comments generated: 4

Comment thread devclaw
Comment on lines 46 to 51
RG=$(azd env get-value AZURE_RESOURCE_GROUP 2>/dev/null || true)
SUB=$(azd env get-value AZURE_SUBSCRIPTION_ID 2>/dev/null || true)
if [ -z "$RG" ]; then
echo -e " ${R}No deployment found. Run 'devclaw up' first.${N}"
exit 1
fi
Comment thread devclaw
Comment on lines +218 to +223
RG=$(azd env get-value AZURE_RESOURCE_GROUP 2>/dev/null || true)
SUB=$(azd env get-value AZURE_SUBSCRIPTION_ID 2>/dev/null || true)
if [ -z "$RG" ]; then
echo -e " ${R}No deployment found. Run 'devclaw up' first.${N}"
exit 1
fi
Comment thread devclaw
Comment on lines +234 to +240
# Fallback if azd show did not include resource IDs yet.
if [ -z "$APP" ]; then
HOST=$(azd env get-value HOST_FQDN 2>/dev/null || true)
if [ -n "$HOST" ]; then
APP="${HOST%%.*}"
fi
fi
Comment thread devclaw
Comment on lines +252 to +255
FQDN=$(azd env get-value HOST_FQDN 2>/dev/null || true)
if [ -z "$FQDN" ] && [ -n "$SHOW_JSON" ]; then
FQDN=$(printf '%s\n' "$SHOW_JSON" | sed -n 's#.*"ingressUrl"[[:space:]]*:[[:space:]]*"https\{0,1\}://\([^/\"]*\)/\{0,1\}".*#\1#p' | head -1)
fi
@achandmsft achandmsft merged commit acc7f77 into main Jun 13, 2026
2 checks passed
@achandmsft achandmsft deleted the pamelatry branch June 13, 2026 08:34
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.

3 participants