feat: change auto_fetch default to true

Auto-fetching missing dependencies from upstream is the more useful default
behavior. Users who need fast, network-free resolution can explicitly set
auto_fetch=false.

Artifacts are content-addressed by SHA256, so reproducibility concerns don't
apply - the same version always produces the same artifact.
This commit is contained in:
Mondo Diaz
2026-02-04 12:23:01 -06:00
parent 6b9863f9c3
commit 7bfec020c8
2 changed files with 9 additions and 9 deletions

View File

@@ -7032,8 +7032,8 @@ async def resolve_artifact_dependencies(
ref: str, ref: str,
request: Request, request: Request,
auto_fetch: bool = Query( auto_fetch: bool = Query(
False, True,
description="Fetch missing dependencies from upstream registries (e.g., PyPI)" description="Fetch missing dependencies from upstream registries (e.g., PyPI). Set to false for fast, network-free resolution."
), ),
db: Session = Depends(get_db), db: Session = Depends(get_db),
storage: S3Storage = Depends(get_storage), storage: S3Storage = Depends(get_storage),
@@ -7046,9 +7046,9 @@ async def resolve_artifact_dependencies(
(dependencies before dependents). Includes download URLs for each artifact. (dependencies before dependents). Includes download URLs for each artifact.
**Parameters:** **Parameters:**
- **auto_fetch**: When true, attempts to fetch missing dependencies from - **auto_fetch**: When true (default), attempts to fetch missing dependencies from
upstream registries (PyPI for _pypi project packages). Default is false upstream registries (PyPI for _pypi project packages). Set to false for
for fast, network-free resolution. fast, network-free resolution when all dependencies are already cached.
**Response Fields:** **Response Fields:**
- **resolved**: All artifacts in dependency order with download URLs - **resolved**: All artifacts in dependency order with download URLs

View File

@@ -1073,17 +1073,17 @@ class TestAutoFetchDependencies:
"""Tests for auto-fetch functionality in dependency resolution. """Tests for auto-fetch functionality in dependency resolution.
These tests verify: These tests verify:
- Resolution with auto_fetch=false (default) behavior is unchanged - Resolution with auto_fetch=true (default) fetches missing dependencies from upstream
- Resolution with auto_fetch=true attempts to fetch missing dependencies - Resolution with auto_fetch=false skips network calls for fast resolution
- Proper handling of missing/non-existent packages - Proper handling of missing/non-existent packages
- Response schema includes fetched artifacts list - Response schema includes fetched artifacts list
""" """
@pytest.mark.integration @pytest.mark.integration
def test_resolve_auto_fetch_false_is_default( def test_resolve_auto_fetch_true_is_default(
self, integration_client, test_package, unique_test_id self, integration_client, test_package, unique_test_id
): ):
"""Test that auto_fetch=false is the default and behaves as before.""" """Test that auto_fetch=true is the default (no fetch needed when all deps cached)."""
project_name, package_name = test_package project_name, package_name = test_package
# Upload a simple artifact without dependencies # Upload a simple artifact without dependencies