Skip to content

Comments

feat: retrieve subgraph url from latest backend config#110

Merged
gosuto-inzasheru merged 2 commits intomainfrom
issue/108
Jun 26, 2025
Merged

feat: retrieve subgraph url from latest backend config#110
gosuto-inzasheru merged 2 commits intomainfrom
issue/108

Conversation

@gosuto-inzasheru
Copy link
Collaborator

claude might or might not have been writing a regex module for me while i was at the coffee machine:

[...]

Perfect! Let me clean up the temporary files and provide a final summary:
Ran tool
Ran tool
Ran tool

✅ Comprehensive Validation Complete!

The TypeScript config loader has been thoroughly tested and validated against all 13 chain configuration files in the Balancer backend repository:

📊 Test Results Summary

✅ 13/13 chain configurations parsed successfully (100% success rate)

Tested Chains:

  • arbitrum.ts ✅
  • avalanche.ts ✅
  • base.ts ✅
  • fantom.ts ✅
  • fraxtal.ts ✅
  • gnosis.ts ✅
  • mainnet.ts ✅ (initially failed, now fixed)
  • mode.ts ✅
  • optimism.ts ✅
  • polygon.ts ✅
  • sepolia.ts ✅
  • sonic.ts ✅
  • zkevm.ts ✅

🔍 Specific Value Validation

The loader accurately preserves all tested values including:

  • Chain IDs: 42161 (Arbitrum), 1 (Ethereum), 8453 (Base), 137 (Polygon), 250 (Fantom)
  • Chain slugs: "arbitrum", "ethereum", "base", "polygon", "fantom"
  • Contract addresses: Vault addresses, hook addresses
  • RPC URLs: Various provider URLs
  • Complex objects: Nested configurations, arrays, bracket notation keys
  • Template variables: ${env.THEGRAPH_API_KEY_BALANCER}, ${env.DRPC_API_KEY}, etc.

🛠️ Enhanced Features Added

During testing, the loader was enhanced to handle:

  1. BigNumber constructs: BigNumber.from("123")"123"
  2. Object property references: underlyingTokens.USDC"underlyingTokens.USDC"
  3. Complex ternary operators: Multi-line conditional expressions
  4. Bracket notation: ['0x123'], ["key"], [key]
  5. Template literals: Backtick strings with ${variables}
  6. Inline comments: Proper removal without breaking URLs

🎯 Key Capabilities Confirmed

  • No external dependencies (uses only Python standard library)
  • Preserves template variables for runtime substitution
  • Handles complex TypeScript constructs (BigNumber, object refs, ternaries)
  • Robust comment removal (avoids breaking URLs)
  • Accurate type conversion (strings, numbers, objects, arrays)
  • Works with both local files and URLs

The loader successfully converts complex TypeScript configuration files into Python dictionaries while preserving all the essential data structure and template variables needed for runtime configuration.

closes #108

@gosuto-inzasheru gosuto-inzasheru changed the title feat: retrieve subgraph url from latest latest backend config feat: retrieve subgraph url from latest backend config Jun 26, 2025
Copy link
Contributor

@Xeonus Xeonus left a comment

Choose a reason for hiding this comment

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

RegEx pattern hard to fully validate but test logs from the AI seem to confirm it is working as intended

@gosuto-inzasheru gosuto-inzasheru merged commit fed3ef3 into main Jun 26, 2025
7 checks passed
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.

Refactor outdated data dependencies

2 participants