Skip to content

Use dependents library for discovery - #8

Open
andrew wants to merge 2 commits into
mainfrom
issue-7-use-dependents
Open

Use dependents library for discovery#8
andrew wants to merge 2 commits into
mainfrom
issue-7-use-dependents

Conversation

@andrew

@andrew andrew commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Uses git-pkgs/dependents for repository deduplication, health filtering, ranking, checkout, and source and test analysis. Keeps downstream's package-specific ecosyste.ms request and downstream.toml reconciliation local.

Closes #7

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors internal/discover to delegate repository deduplication, filtering, ranking, checkout, and source/test analysis to github.com/git-pkgs/dependents, keeping only downstream-specific ecosyste.ms querying and config reconciliation logic local.

Changes:

  • Replaced in-package ranking/filtering/analysis logic with dependents.Build, dependents.Filter, dependents.Rank, and dependents.Analyze.
  • Extended ecosyste.ms repo metadata ingestion to include mirror_url to support mirror filtering.
  • Updated tests and module dependencies to reflect the new dependents-based pipeline.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/discover/ecosystems.go Adds MirrorURL to repo metadata parsed from ecosyste.ms.
internal/discover/discover.go Rebuilds phase-one discovery around dependents grouping, filtering, and ranking.
internal/discover/discover_test.go Updates ranking-related test to use the new ranking helper.
internal/discover/analyze.go Replaces local clone/scan logic with dependents.Analyze and re-ranking.
internal/discover/analyze_test.go Reworks analysis tests to use injected dependents.Checkout and new behaviors.
go.mod Adds github.com/git-pkgs/dependents and related indirect dependencies.
go.sum Updates sums for new direct/indirect dependencies.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +74 to +78
func rankCandidates(candidates []Candidate, limit int) []Candidate {
shared := make([]dependents.Candidate, len(candidates))
byRepository := make(map[string]Candidate, len(candidates))
for i, candidate := range candidates {
shared[i] = candidate.shared()
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.

Extract discover's filter+score as a library

2 participants