Skip to content

chore: explicit provider aggregation path for testnet#6

Open
randyquaye wants to merge 2 commits intomainfrom
rq/providers-split
Open

chore: explicit provider aggregation path for testnet#6
randyquaye wants to merge 2 commits intomainfrom
rq/providers-split

Conversation

@randyquaye
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 5, 2026 15:56
@randyquaye randyquaye linked an issue Feb 5, 2026 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

yarn install --frozen-lockfile
yarn bootstrap
if [ "$infra_environment" = "testnet" ]; then
yarn bootstrap-testnet
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
yarn bootstrap-testnet
yarn bootstrap-testnet

Copilot uses AI. Check for mistakes.
.sort((a, b) => a.providerId - b.providerId);

// Create output directory if it doesn't exist
const outputDir = outputFile.substring(0, outputFile.lastIndexOf('/'));
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@randyquaye randyquaye marked this pull request as ready for review February 5, 2026 16:09
@randyquaye randyquaye requested a review from a team February 5, 2026 16:09
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.

Separate metadata folder for testnet

2 participants