Merge branch 'main' into codex/update-setup-dev.sh-for-robust-validation-and-bootstrapping

This commit is contained in:
beatz174-bit
2026-04-21 15:51:18 +10:00
committed by GitHub
2 changed files with 49 additions and 0 deletions
+22
View File
@@ -134,6 +134,28 @@ Covers focused package behavior (client parsing, mappers, provider helper logic)
go test ./...
```
### Troubleshooting Go dependency downloads
If you see an error like:
```text
GOPROXY list is not the empty string, but contains no entries
```
your local Go environment is misconfigured. A common fix is:
```bash
go env -w GOPROXY=https://proxy.golang.org,direct
```
Helpful diagnostics:
```bash
go env GOPROXY
echo "$GOPROXY"
```
### Acceptance tests
### Tier B: local integration tests (mock Dynu API, no real credentials)
These tests use an `httptest` fake Dynu API server and run the Terraform provider end-to-end against deterministic fixtures.
+27
View File
@@ -14,6 +14,33 @@ for cmd in bash git; do
have "$cmd" || die "$cmd is required"
done
validate_goproxy() {
local value="$1"
local part trimmed
local has_valid=0
IFS=',' read -r -a parts <<<"$value"
for part in "${parts[@]}"; do
trimmed="${part#"${part%%[![:space:]]*}"}"
trimmed="${trimmed%"${trimmed##*[![:space:]]}"}"
if [[ -n "$trimmed" ]]; then
has_valid=1
break
fi
done
if [[ "$has_valid" -eq 0 ]]; then
warn "GOPROXY appears malformed: non-empty value contains no entries"
warn "This can cause errors like: GOPROXY list is not the empty string, but contains no entries"
warn "Suggested fix: go env -w GOPROXY=https://proxy.golang.org,direct"
warn "Current GOPROXY from environment: '$value'"
fi
}
if [[ "${GOPROXY+x}" == "x" ]]; then
validate_goproxy "$GOPROXY"
fi
ensure_dir .codex
ensure_dir .codex/bin
ensure_dir .codex/cache