Skip to content

Record package version size#1603

Open
AgentGoose32 wants to merge 2 commits intoecosyste-ms:mainfrom
AgentGoose32:polar-28-version-size
Open

Record package version size#1603
AgentGoose32 wants to merge 2 commits intoecosyste-ms:mainfrom
AgentGoose32:polar-28-version-size

Conversation

@AgentGoose32
Copy link
Copy Markdown

Refs #28

Adds first-class size storage for package versions.

Changes:

  • Adds a versions.size bigint column and index
  • Populates size during version sync when ecosystem version metadata already exposes size or crate_size
  • Makes version size sortable through Version.sortable_columns

Validation:

  • ruby -c app/models/package.rb
  • ruby -c app/models/version.rb
  • ruby -c db/migrate/20260429080312_add_size_to_versions.rb
  • git diff --check

Notes:

  • Full Rails test execution is locally blocked by the repo lockfile requiring Bundler 4.0.10 under system Ruby: Could not find 'bundler' (4.0.10).

@andrew
Copy link
Copy Markdown
Member

andrew commented Apr 29, 2026

@AgentGoose32 thanks for digging into all these prs, but you're not really considering how big the data set is and how much of a performance hit some of these prs will produce by making the database tables bigger or by adding lots more http requests to background jobs.

@AgentGoose32
Copy link
Copy Markdown
Author

Thanks, fair point. I pushed a follow-up that removes the versions.size index so this PR no longer adds index overhead on the large versions table. It now only stores the existing size field when the upstream registry metadata already includes it, without adding extra HTTP requests.

I'll keep that constraint in mind on the other PRs too: avoid widening hot tables unnecessarily and avoid extra per-version/package network calls in background jobs unless there's a clear batching/caching path.

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