Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.
Merged
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
110 changes: 80 additions & 30 deletions .github/workflows/debug_raw_githubusercontent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,92 @@ jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: Test raw.githubusercontent.com responses
run: |
for URL in \
"https://raw.githubusercontent.com/balancer/bal_addresses/refs/heads/main/extras/chains.json" \
"https://raw.githubusercontent.com/balancer/bal_addresses/main/extras/chains.json" \
"https://raw.githubusercontent.com/BalancerMaxis/bal_addresses/main/extras/chains.json"; do
echo "=== $URL ==="
echo "--- Headers ---"
curl -sI "$URL"
echo "--- Status code ---"
curl -s -o /dev/null -w "HTTP %{http_code}\n" "$URL"
echo "--- First 200 bytes ---"
curl -s "$URL" | head -c 200
echo ""
echo ""
done

- name: Test Python requests behavior
- name: Checkout
uses: actions/checkout@v6

- name: Setup Python 3.10
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install dependencies (same as trigger_fee_collection)
run: pip3 install -r requirements.txt

- name: Debug
run: |
pip3 install requests
python3 -c "
python3 << 'PYEOF'
import sys, json
print(f"Python: {sys.version}")

# Check if json module has been monkey-patched
print(f"\n=== json module identity ===")
print(f"json module: {json}")
print(f"json.loads: {json.loads}")
print(f"json.JSONDecoder: {json.JSONDecoder}")

# Check if json_fix is installed and what it does
try:
import json_fix
print(f"json_fix version: {json_fix.__version__ if hasattr(json_fix, '__version__') else 'unknown'}")
print(f"json.loads after json_fix: {json.loads}")
except ImportError:
print("json_fix not installed")

# Check what requests uses for JSON
import requests
print(f"\n=== requests JSON backend ===")
print(f"requests: {requests.__version__}")
from requests.compat import complexjson
print(f"complexjson: {complexjson}")
print(f"complexjson.loads: {complexjson.loads}")

# Check if simplejson is available
try:
import simplejson
print(f"simplejson: {simplejson.__version__}")
except ImportError:
print("simplejson not installed")

# Test the exact URLs used at import time
print(f"\n=== Testing raw.githubusercontent.com URLs ===")
urls = [
'https://raw.githubusercontent.com/balancer/bal_addresses/refs/heads/main/extras/chains.json',
'https://raw.githubusercontent.com/balancer/bal_addresses/main/extras/chains.json',
"https://raw.githubusercontent.com/balancer/bal_addresses/refs/heads/main/extras/chains.json",
"https://raw.githubusercontent.com/balancer/bal_addresses/main/extras/chains.json",
"https://raw.githubusercontent.com/balancer/bal_addresses/main/extras/func_desc_by_name.json",
]
for url in urls:
print(f'=== {url} ===')
resp = requests.get(url)
print(f'Status: {resp.status_code}')
print(f'Content-Type: {resp.headers.get(\"content-type\")}')
print(f'Body[:200]: {resp.text[:200]}')
print(f"\n{url}")
print(f" Status: {resp.status_code}")
print(f" Encoding: {resp.encoding}")
print(f" Bytes[:20]: {resp.content[:20]}")
print(f" Text[:100]: {repr(resp.text[:100])}")
try:
resp.json()
print('json(): OK')
print(f" json(): OK")
except Exception as e:
print(f'json(): FAILED - {e}')
print()
"
print(f" json(): FAILED - {e}")

# Test the actual import chain that fails in CI
print(f"\n=== Importing bal_tools (the first thing that crashes) ===")
try:
from bal_tools.utils import CHAINS
print(f"OK - keys: {list(CHAINS.keys())}")
except Exception as e:
print(f"FAILED: {type(e).__name__}: {e}")

print(f"\n=== Importing bal_addresses ===")
try:
from bal_addresses import AddrBook
print(f"OK - chains: {list(AddrBook.chain_ids_by_name.keys())[:5]}")
except Exception as e:
print(f"FAILED: {type(e).__name__}: {e}")

# Test the exact import main_combined.py does
print(f"\n=== Importing fee_allocator (exact CI import chain) ===")
try:
from fee_allocator.fee_allocator import FeeAllocator
print("OK")
except Exception as e:
print(f"FAILED: {type(e).__name__}: {e}")
PYEOF
Loading