Skip to content

Promote source out of the constraint hash onto Declaration #150

Description

@JPDuchesne

Problem

Resolver#package_id builds a PackageId by excavating the constraint hash by key convention:

source = decl.constraint["repo"] || decl.constraint["url"]

Identity should be a field, not an excavation. A source-based package's coordinates (git URL, owner/repo slug) are part of which package this is — the same fact PackageId#source carries — yet on the declaration side they hide inside the constraint hash, whose job is to describe which versions qualify. Any new source-shaped key (a mirror URL, a monorepo path) silently extends the || chain.

Proposal

Give Declaration an explicit optional source field, stamped where the constraint is normalized (DSL verbs for project rows; repositories for transitive declarations). Resolver#package_id then reads decl.source and the key-convention dig dies. The constraint hash keeps only version-shaped keys (version, tag, buildid, …).

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    transitivityTransitive dependency resolution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions