Extension of NPM REST API (repo index, metrics, content filters)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15
- Forks
- 24
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 7
Description
Lightwell UI lists npm packages, versions, and (if added) repository counts through content-sources-backend. That backend reads Pulp Postgres directly (Tangy). We need Pulp HTTP APIs so the path is UI → backend → Pulp REST, not SQL.
Today GET …/content/npm/packages/ is one row per (name, version). It cannot paginate distinct package names or return versions grouped per package. The content filter supports name only — there is no version=, so PackageGet cannot select one version without listing all of them.
Scoped packages use the full name string (@types/node).
{pk} is the repository UUID. Latest complete repository version is implied.
| UI path | Pulp |
|---|---|
| PackageList | New GET …/repositories/npm/npm/{pk}/packages/ — one row per name, paginate, name__istartswith |
| PackageVersions | Extend existing GET …/content/npm/packages/ with collapse_builds=true and serializer field base_version |
| PackageGet | Extend the same content list: add version= (exact); omit collapse_builds |
| RepoMetrics | New GET …/repositories/npm/npm/{pk}/metrics/ — package_count, version_count, build_count (also missing in Tangy/CS today) |
collapse_builds=true (default false): strip trailing \.[a-zA-Z]+-\d+$ from version, one row per (name, base_version). No-op until Lightwell npm rebuilds exist.
PackageList rows: name, versions[], latest_releases[] (version, created_at, release). Same version keys in both lists. Pulp-native shape, not Tangy DTOs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing GET …/content/npm/packages/ endpoint and trace the API handling for the repository and content routes. Implement the specified PackageList, PackageVersions, PackageGet, and RepoMetrics behavior, including scoped names, pagination, exact version filtering, collapse_builds, and the listed response fields. Done means the four UI paths can use Pulp REST without direct Postgres access.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100