Skip to content

Select artifacts by PURL qualifiers, and fix the conda client - #105

Merged
andrew merged 2 commits into
mainfrom
resolver-qualifiers
Oct 19, 2026
Merged

andrew merged 2 commits into
mainfrom
resolver-qualifiers

Conversation

@andrew

@andrew andrew commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Closes #95

ResolveOptions gains Qualifiers map[string]string. When a version lists several artifacts, arch, distro, subdir and build are matched against artifact metadata of the same name, and ErrNoMatchingArtifact is returned when none match. An artifact that doesn't record a qualifier isn't ruled out by it, so ecosystems whose clients don't publish that metadata keep resolving as before. repository_url and channel choose the registry rather than the file, so the resolver ignores them and the caller registers a registry for that URL. Qualifiers don't affect ecosystems resolved through URLs().Download, where name and version already determine the file.

Conda had no artifacts to select from, and its client couldn't decode the real API at all: anaconda.org returns owner as an object and upload_time as a string like 2024-09-17 07:32:19.214000+00:00, while the client expected a string and a Unix timestamp. Every FetchVersions, FetchPackage and FetchMaintainers call failed with a JSON error, and the tests didn't notice because their fixtures were built from the same structs. The client now decodes the real shape, and each file becomes an Artifact with its subdir, build, arch and platform, with the scheme-relative download_url given https:. The new conda test uses a response trimmed from api.anaconda.org.

Against the live API, resolving conda-forge/zlib 1.3.1 with subdir set to linux-64, osx-arm64 and win-64 returns the matching build for each, and the osx-arm64 download matches its published sha256.

When a client starts recording one of these qualifiers, a request with a non-matching value that used to resolve to some artifact will return ErrNoMatchingArtifact instead.

https://claude.ai/code/session_01NxsA75HBjdWQKcdx7FDTDc

owner is an object and upload_time a string in the real API, so
FetchVersions failed on every package. Each file is now an Artifact
with its subdir, build and arch.

Claude-Session: https://claude.ai/code/session_01NxsA75HBjdWQKcdx7FDTDc
Copilot AI balanced review requested due to automatic review settings October 18, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@andrew
andrew merged commit 9d6abac into main Oct 19, 2026
6 checks passed
@andrew
andrew deleted the resolver-qualifiers branch October 19, 2026 07:09
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.

Pass PURL qualifiers through artifact resolution

2 participants