Skip to content

feat(cli): oa check reads Gemfile.lock and packages.lock.json - #489

Merged
M0Rf30 merged 1 commit into
openartifact:mainfrom
orcamedia:feat/lockfile-gem-go-nuget
Nov 16, 2026
Merged

M0Rf30 merged 1 commit into
openartifact:mainfrom
orcamedia:feat/lockfile-gem-go-nuget

Conversation

@orcamedia

Copy link
Copy Markdown
Contributor

oa check reads Gemfile.lock (GEM sections; a gem locked for several platforms is one version) and packages.lock.json (every target framework; project references left out); --fetch requests info/ or the flat container version list, as bundle install and dotnet restore do.

Two proxy fixes so the check can answer from those documents: a RubyGems proxy listed versions only from api/v1/versions, fetched only for the minimum age (now falls back to the cached info file), and a NuGet proxy only from the inline items of the registration index, which restore never fetches and nuget.org pages for big packages (now falls back to the cached flat container, dated where the registration dates them).

Checked end to end against proxies to rubygems.org and nuget.org: unknown when cold, all available after --fetch (paged registration included), a minimum age holds gems with their until times, a curation rule holds Newtonsoft.Json 13.0.3 as restore sees it, a missing version is not_found. go.sum is left out (no dependency graph; needs go.mod).

🤖 Generated with Claude Code

pkg/lockfile gains two parsers:

- Gemfile.lock (and gems.locked): the gems of the GEM sections; GIT and
  PATH gems are not served by a registry, and PATH gems (the project's own)
  are no requirers. A gem locked for several platforms
  ("1.16.7-x86_64-linux") is one version, the number before the platform,
  as the proxy's gate judges it.
- packages.lock.json: the packages of every target framework and runtime;
  project references are left out and are no requirers. Requirements name
  ids in any case, as NuGet does.

Neither lockfile records development dependencies, so --no-dev is refused
for them. --fetch requests the compact index info file (info/<gem>) or the
flat container version list (v3/package/<id>/index.json), what bundle
install and dotnet restore request.

The proxies could not answer from those documents, so a check after a plain
install, or after --fetch, still said unknown:

- rubygems listed versions only from the api/v1/versions document, which
  the proxy fetches only for the minimum age (and clients cannot request).
  Without it, the versions now come undated from the cached info file.
- nuget listed versions only from the inline items of the cached
  registration index, which dotnet restore does not fetch and which
  nuget.org splits into separate pages for a package of many versions
  (Microsoft.Extensions.Logging, AWSSDK.Core). When the index is missing or
  paged, the versions now come from the cached flat container, dated where
  the registration dates them.

The fixtures are a real Gemfile.lock from Bundler 2.6 (a platform gem, a git
gem, a path gem, a test group; the native builds of the platform gem added
by hand in Bundler's format, which Bundler 2.6 would not lock here) and a
real packages.lock.json from .NET 10 (a project reference), renamed to acme.
Fuzz targets for both. Checked end to end against RubyGems and NuGet proxies
to rubygems.org and nuget.org behind groups: cold proxies answer unknown and
--fetch makes all available (a paged registration included); a minimum age
holds the gems with their until times; a NuGet curation rule holds
Newtonsoft.Json 13.0.3 (the flat container served to restore omits 13.x);
a version upstream lacks is not_found.

go.sum is left out: it records no dependency graph, so "required by" could
not be told, and needs go.mod read with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@M0Rf30
M0Rf30 force-pushed the feat/lockfile-gem-go-nuget branch from 613cd98 to 16d8519 Compare November 16, 2026 15:32
@M0Rf30 M0Rf30 closed this Nov 16, 2026
@M0Rf30 M0Rf30 reopened this Nov 16, 2026
@M0Rf30
M0Rf30 merged commit a1bd8b8 into openartifact:main Nov 16, 2026
30 of 45 checks passed
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