Skip to content

Add ecosyste.ms identity options and friendlier lookup errors - #245

Merged
andrew merged 1 commit into
mainfrom
ecosystems-identity
Jun 28, 2026
Merged

andrew merged 1 commit into
mainfrom
ecosystems-identity

Conversation

@andrew

@andrew andrew commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #231.

Bumps github.com/git-pkgs/enrichment to v0.4.0, which adds WithFrom, WithAPIKey and WithBatchSize and pulls in ecosystems-go v0.2.0 with its improved error handling and batching.

All enrichment client construction now goes through a single newEnrichmentClient() helper in cmd/enrichment.go that applies the standard user agent plus three new environment variables:

  • GIT_PKGS_ECOSYSTEMS_FROM sets the From header so requests use the ecosyste.ms polite pool
  • GIT_PKGS_ECOSYSTEMS_API_KEY sends a bearer token
  • GIT_PKGS_ECOSYSTEMS_BATCH_SIZE overrides the bulk lookup batch size

Previously licenses, funding and freshness went through the swappable NewEnrichmentClient var while outdated, sbom, changelog and integrity called enrichment.NewClient directly; they're now unified so the env vars apply everywhere.

BulkLookup errors are wrapped with a hint pointing at GIT_PKGS_ECOSYSTEMS_FROM / GIT_PKGS_ECOSYSTEMS_API_KEY when no identity is configured, so the failure mode in #231 becomes:

Error: looking up packages: bulk lookup: stream error: stream ID 1; INTERNAL_ERROR; received from peer
requests to ecosyste.ms without an identity share a common rate-limit pool; set GIT_PKGS_ECOSYSTEMS_FROM to your email address (or GIT_PKGS_ECOSYSTEMS_API_KEY to an API key) to use the polite pool

The hint is suppressed once an identity is set. README documents the new variables alongside GIT_PKGS_DIRECT.

Bump enrichment to v0.4.0 (which brings ecosystems-go v0.2.0) and route
all enrichment client construction through a single helper that applies
GIT_PKGS_ECOSYSTEMS_FROM, GIT_PKGS_ECOSYSTEMS_API_KEY and
GIT_PKGS_ECOSYSTEMS_BATCH_SIZE. BulkLookup failures now include a hint
pointing at those variables when no identity is configured.

Fixes #231
@andrew
andrew force-pushed the ecosystems-identity branch from 63ad9bf to 28d8ada Compare June 28, 2026 06:47
@andrew
andrew merged commit 552e906 into main Jun 28, 2026
7 checks passed
@andrew
andrew deleted the ecosystems-identity branch June 28, 2026 06:55
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.

"git pkgs outdated" fails at bulk lookup

1 participant