Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 29, 2025

Previously, when aggregateDependencies encountered a version whose dependencies couldn't be fetched, it would throw an error and fail the entire aggregation process. This caused package installation to fail completely even when other compatible versions were available.

This PR changes the behavior to gracefully handle dependency fetching failures by:

  1. Catching errors for individual versions: When dependency fetching fails for a specific version, the error is caught and that version is removed from the aggregated results instead of propagating the error.

  2. Continuing aggregation with remaining versions: The process continues with other available versions, allowing the package resolution to proceed with working versions.

  3. Maintaining data consistency: Failed versions are properly cleaned up from the dnps object, including removing empty package entries when all versions fail.

Example Scenario

Before this fix:

// If version 0.1.1 fails to fetch dependencies, entire process fails
versions: ["0.1.0", "0.1.1", "0.1.2"]  Error thrown, no packages aggregated

After this fix:

// Only the failing version is skipped, others continue processing
versions: ["0.1.0", "0.1.1", "0.1.2"]  ["0.1.0", "0.1.2"] successfully aggregated

Testing

Added comprehensive test coverage for:

  • Partial failure scenarios where some versions fail but others succeed
  • Complete failure scenarios where all versions of a package fail to fetch dependencies
  • Verification that the aggregation process continues gracefully in both cases

All existing tests continue to pass, ensuring backward compatibility and no regressions.

This change improves system resilience and provides a better user experience by allowing package installations to succeed even when some package versions have dependency issues.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • binaries.soliditylang.org
    • Triggering command: /usr/local/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
  • ethereum.github.io
    • Triggering command: /usr/local/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
  • ns.dappnode.io
    • Triggering command: /usr/local/bin/node --experimental-specifier-resolution=node --import=tsx/esm /home/REDACTED/work/DNP_DAPPMANAGER/DNP_DAPPMANAGER/packages/utils/node_modules/mocha/lib/cli/cli.js ./test/unit packages/installer/test/unit/dappGet/aggregate/aggregateDependencies.test.ts --no-config --recursive --no-package --color --exit --extension ts --require dotenv/config --diff --reporter spec --slow 75 --timeout 2000 --ui bdd --watch-ignore node_modules --watch-ignore .git (dns block)
  • relay.trufflesuite.com
    • Triggering command: /usr/local/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
  • solc-bin.ethereum.org
    • Triggering command: /usr/local/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

aggregateDependencies will now skip versions whose dependencies can't be fetched instead of failing the entire aggregation.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Marketen <36164126+Marketen@users.noreply.github.com>
Copilot AI changed the title [WIP] Merge copilot/skip-bad-dep-versions into develop Fix aggregateDependencies to skip versions whose dependencies can't be fetched Sep 29, 2025
Copilot AI requested a review from Marketen September 29, 2025 12:04
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.

2 participants