Fix for devclaw up and devclaw status on Mac#27
Merged
Merged
Conversation
There was a problem hiding this comment.
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 statusto prefer azd metadata (azd show/ azd env) and only use Azure CLI opportunistically for live state. - Removed
westcentralusfrom 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 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 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 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 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Validation