chore: explicit provider aggregation path for testnet#6
chore: explicit provider aggregation path for testnet#6randyquaye wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the provider metadata aggregation system to support separate provider directories for testnet and mainnet environments. The aggregation logic has been extracted into a shared core module that both environment-specific scripts use.
Changes:
- Extracted provider aggregation logic into a reusable core module (
aggregate-providers-core.ts) - Created separate aggregation scripts for testnet and mainnet provider directories
- Updated bootstrap scripts and shell commands to conditionally use the appropriate provider aggregation based on environment
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| providers-testnet/_example.json | Example template file for testnet provider metadata |
| atp-indexer/scripts/aggregate-providers.ts | Refactored to use shared core module for mainnet providers |
| atp-indexer/scripts/aggregate-providers-testnet.ts | New script to aggregate testnet providers using shared core module |
| atp-indexer/scripts/aggregate-providers-core.ts | New shared module containing provider aggregation logic extracted from original script |
| atp-indexer/package.json | Added bootstrap-testnet script command |
| atp-indexer/bootstrap.sh | Updated build and deploy functions to conditionally call appropriate bootstrap script based on environment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
atp-indexer/bootstrap.sh
Outdated
| yarn install --frozen-lockfile | ||
| yarn bootstrap | ||
| if [ "$infra_environment" = "testnet" ]; then | ||
| yarn bootstrap-testnet |
There was a problem hiding this comment.
Missing indentation for line 335. The 'yarn bootstrap-testnet' command should be indented with 2 spaces to align with the surrounding code in the if-else block (see line 337 for correct indentation).
| yarn bootstrap-testnet | |
| yarn bootstrap-testnet |
| .sort((a, b) => a.providerId - b.providerId); | ||
|
|
||
| // Create output directory if it doesn't exist | ||
| const outputDir = outputFile.substring(0, outputFile.lastIndexOf('/')); |
There was a problem hiding this comment.
Using substring with lastIndexOf('/') to extract the directory path is not cross-platform compatible and will fail on Windows systems where paths use backslashes. Import and use the dirname function from the 'path' module instead, which handles both forward and backward slashes correctly across all platforms.
No description provided.