Skip to content

Conversation

@yashkohli88
Copy link
Contributor

Overview

This PR removes the deprecated request package and replaces its usage for downloading packages across all supported ecosystems with a new getStream function.
It also updates dependencies and modernizes related testing and fetch logic.

Key Changes

  • New getStream function in lib/fetch.js exported to provide streaming downloads using axios.
  • Replaced all usage of request in package fetchers across:
    • Conda
    • Debian
    • Go
    • Maven
    • NPM
    • Composer
    • PyPI
    • RubyGems
  • Removed the deprecated request dependency from package.json.
  • Updated axios to version 1.11.0.
  • Updated tests and mocks to match new streaming approach, including proxyquire stubs.
  • Addressed formatting issues and cleaned up code.

Motivation

  • The request package is deprecated and no longer maintained.
  • Modern HTTP libraries like axios offer better security, support, and community engagement.
  • Uniform download logic across all ecosystem fetchers simplifies maintenance and enables enhancements.

Testing

  • Updated and added unit tests for getStream and affected providers.
  • Tests cover both direct URL and options object, as well as default headers and error handling.
  • Updated all test and mock code to use Promise-based streaming stubs for fetchers.

Closes: #573

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.

1 participant