Skip to content

Add mutual exclusivity validator for source vs legacy fields #1207

Closed

Description

@smoparth

Context

The new SourceResolver data model is complete in _resolver.py (PRs #1228, #1235). Once the source field is activated on PackageSettings and VariantInfo (Phase 1 — #1291), we need validation to prevent users from mixing old and new config styles.

The design proposal (Migration section) states:

Top-level and variant-specific source settings are mutually exclusive with download_source, resolver_dist, wheel_server_url, and pre_build settings. It is an error to combine the new source settings with any of the old settings.

Parent epic: #1254 (Phase 1)

Problem

Without validation, a user can set both source and legacy fields in the same YAML file without error:

source:
  provider: pypi-sdist
  index_url: https://custom.example/simple
resolver_dist:
  sdist_server_url: https://other.example/simple
  include_wheels: true

The new source field would silently take precedence and the legacy resolver_dist is ignored. This is confusing and can lead to configuration mistakes that are hard to debug.

Acceptance criteria

  • Setting source alongside download_source, resolver_dist, wheel_server_url, or pre_built raises a clear validation error
  • Validation works at both package level and variant level
  • Existing configs (legacy-only or new-only) continue to load without errors
  • Error message clearly tells the user which fields conflict

Related

Activity

  1. added a commit that references this issue on Aug 21, 2026
    8fdedf1
  2. LalatenduMohanty commented on Sep 11, 2026

    @LalatenduMohanty
    Member

    Closing as #1307 has merged.

  3. added 2 commits that reference this issue on Sep 21, 2026
    6e4b492
    aeb3606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions