Repository navigation
fix(composer): take each package's registry from composer.lock - #170
Merged
Merged
Conversation
Composer read Packagist for every package, so a package from a private Composer repository could be looked up on Packagist, where its name may be someone else's. Each package now follows crate::origins: - composer.lock decides: Composer marks a package from a Composer registry with that registry's notification-url. Packagist's mark means Packagist; another registry's fails the lookup until private Composer repositories are read. Path, VCS, inline and artifact packages carry no mark and are listed as skipped. - A package the lock does not record comes from Packagist only when composer.json configures no other repository and leaves Packagist on. - composer.json is read as strict JSON, as Composer reads it; one with comments, or a lock the Count cannot read, fails every lookup. The ambiguous-lookup error now says "several registries", since it covers gems and PHP packages as well as Python.
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Rust | Nov 3, 2026 11:45p.m. | Review ↗ | |
| JavaScript | Nov 3, 2026 11:45p.m. | Review ↗ | |
| Shell | Nov 3, 2026 11:45p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 716b77a | Commit Preview URL Branch Preview URL |
Nov 03 2026, 11:37 PM |
|
Docs7 for sweepies/count-patchula
Commit |
- Inline package repositories' packages are skipped, whatever their data claims, and so are artifacts (a dist URL that is a local file). - Packagist named with only, exclude or canonical counts as another repository, as do the merge plugin and a Composer plugin in the lock, since plugins can add repositories; unrecorded packages then fail. - config.lock false ignores composer.lock, as Composer does. - A null packages-dev, as composer update --no-dev writes, is no package. - The manifest is matched by its file name, and the skip reason names every repository kind it covers.
Real Composer stamps every Packagist package with it, and the Count now takes a package without one as not from Packagist.
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second per-ecosystem fix from the registry audit, after Bundler (#168). Composer looked every package up on Packagist, so a package from a private Composer repository could be looked up there, where its name may be someone else's.
Design
composer.jsoncannot say which repository holds a package: Composer asks each repository in order. So the Count does not predict it. It uses Composer's own record incomposer.lock, through the sharedcrate::originsrule:notification-url. Composer stamps it from the repository'snotify-batch. Packagist's ishttps://packagist.org/downloads/, which I checked against a realcomposer updateon boat.packageand artifact packages carry no mark and are listed as skipped.composer.jsonconfigures no repository besides Packagist and leaves Packagist on. Otherwise the lookup fails, asking forcomposer.lockto be committed.composer.jsonis read as strict JSON, as Composer reads it, so a file with comments counts as unreadable. A lock that isn't the expected shape counts the same.composer.lockis always read when Composer is enabled, whateverfilesandexcludesay.Assumption: a private repository's packages don't carry Packagist's notification URL. A repository would have to advertise Packagist's
notify-batch, which would also report every private install to packagist.org.A stale lock is still resolved with the real
composer.jsonin the update stage.The ambiguous-lookup error now says "several registries" instead of "several indexes", since it covers gems and PHP packages too.
Docs: sources.md (package registries), managers.md, compatibility.md, departures.md.