Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add origins/condaforge Route for Consistent Conda API Structure #1279

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

yashkohli88
Copy link
Contributor

@yashkohli88 yashkohli88 commented Jan 30, 2025

Description:

This pull request addresses the need to enhance the API for Conda origins by creating a separate route for the Conda-Forge channel, thereby aligning it with the structure used for other package managers.

Key Changes:

  1. New origins/condaforge Route:
  • Introduced a dedicated route for the Conda-Forge channel using /origins/condaforge.
  • This change ensures a consistent approach, similar to other package managers that have distinct routes for different sources.
  1. Separation of Repo Access Logic:
  • Extracted and refactored the code responsible for fetching channel and repo data into a new CondarepoAccess library for better separation of concerns and reusability.
  1. Code Refactoring:
  • Refactored existing originConda and new originCondaforge routes to use CondaRepoAccess for accessing package data.
  • Improved readability and maintainability of the route handling logic.
  1. Cache Improvements:
  • Reused the existing cache setting for caching purposes to help improve performance by reducing redundant API calls.
  1. Test Enhancements:
  • Updated and added new tests to cover changes in route handling and data fetching logic to ensure stability and reliability.

Files Changed:

  • app.js: Added route definition for Conda-Forge.
  • lib/condaRepoAccess.js: New library for handling Conda repository access.
  • routes/originConda.js: Refactored to leverage CondaRepoAccess.
  • routes/originCondaforge.js: New route handler for Conda-Forge channel.
  • test/lib/condaRepoAccess.js: Added unit tests for CondaRepoAccess.
  • test/routes/origins.js: Updated integration tests to accommodate new and refactored routes.

Notes:

  • These changes aim to enhance the API's consistency, making it easier for users to interact with different Conda channels.
  • All affected tests have been updated to ensure proper coverage and functionality.

This PR is related to #1284

@yashkohli88 yashkohli88 marked this pull request as draft January 30, 2025 18:23
})
})

describe('Conda Origin Routes', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

_getOriginCondaRevisions is exposed on the router for testing purposes. Tests related to "Conda Origin Routes" may be better to remain in origin related tests.

@yashkohli88 yashkohli88 changed the title Yk/add origins condaforge Add origins/condaforge Route for Consistent Conda API Structure Feb 12, 2025
@yashkohli88 yashkohli88 marked this pull request as ready for review February 12, 2025 08:03
@qtomlinson qtomlinson requested a review from mpcen February 12, 2025 21:25
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