Skip to content

Extract discover's filter+score as a library #7

Description

@andrew

internal/discover does two things on top of the raw ecosyste.ms dependent list: filter out forks/archived/stale repos, and clone-and-score by test-file and import-file counts. The raw list already lives in git-pkgs/enrichment (RepositoryDependents).

alpha-omega-security/hyrum corpus wants the same ranked list to pick which dependents to generate contract tests from, and scrutineer could plausibly use it for "audit the top N dependents of X". Both would currently have to shell out to downstream discover --stdout and parse TOML.

Options:

  • move internal/discoverdiscover (public in this module)
  • extract to git-pkgs/dependents, importing enrichment for the ecosyste.ms call, and have downstream depend on it

The second keeps the clone-and-score step (which touches disk and can be slow) out of enrichment, which is otherwise a pure metadata-fetch library, and matches the one-purpose-library shape of the rest of the org.

hyrum will use enrichment.RepositoryDependents directly in the meantime and switch when this lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions