Skip to content

Count stored publish times under their ecosystem in the stats - #646

Merged
andrew merged 2 commits into
git-pkgs:mainfrom
simonchrz:fix/version-publish-time-package
Nov 2, 2026
Merged

andrew merged 2 commits into
git-pkgs:mainfrom
simonchrz:fix/version-publish-time-package

Conversation

@simonchrz

Copy link
Copy Markdown
Contributor

The ecosystem breakdown on the dashboard showed an "unattributed" row with 0 B downloaded on a proxy whose artifacts all had package rows.

The row came from the versions count. Cooldown stores the publish time of each version it looks up, through SetVersionPublishedAt, also for packages nobody downloaded, such as modules only resolved with go list -m or @latest. Those versions have no package row, so GetEcosystemStats put them under "unattributed". On my instance that was 148 versions of six Go modules and two npm packages.

They now count under the type of their package PURL, which is the ecosystem name for every ecosystem that stores publish times. Only a package PURL that can't be parsed stays unattributed, so the totals still reconcile with GetCacheStats.

Creating the missing package rows instead doesn't work for Go: publish times are keyed by the escaped module path, so a module with capitals would get a second package row next to the one its downloads create.

Cooldown stores the publish time of every version it looks up, also of
packages nobody downloaded, which have no package row. The ecosystem stats
counted those versions as unattributed. They now count under the type of
their package PURL; only a PURL that can't be parsed stays unattributed.
@simonchrz simonchrz added the bug Something isn't working label Oct 31, 2026
Covers namespaced npm and Maven PURLs, a publish time under an alias of
a package row's ecosystem, and a PURL starting with the orphan prefix,
and checks the per-ecosystem versions against GetCacheStats' total.

@andrew andrew 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.

One small thing: the versionEcosystem doc comment says the ecosystems that store publish times are named like their PURL types, which is not true for Go (golang vs go). It works because mergeAliasedEcosystems folds them together afterwards, so the comment should say that instead.

@andrew
andrew merged commit cc8f50c into git-pkgs:main Nov 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants