Skip to content

refactor: split get_repository_info into smaller functions#2745

Open
sijie-Z wants to merge 1 commit into
DeepSourceCorp:masterfrom
sijie-Z:refactor/split-get-repo-info
Open

refactor: split get_repository_info into smaller functions#2745
sijie-Z wants to merge 1 commit into
DeepSourceCorp:masterfrom
sijie-Z:refactor/split-get-repo-info

Conversation

@sijie-Z

@sijie-Z sijie-Z commented Jun 2, 2026

Copy link
Copy Markdown

get_repository_info was a ~90-line function handling validation, data fetching, formatting, and dict construction. Split into four focused helper functions:

  • _is_valid_repository(repository) — checks archived + inactivity
  • _fetch_labeled_issues(repository, rate_limiter) — fetches issues per label
  • _format_issues(good_first_issues) — converts issue objects to dicts
  • _build_repo_info(repository, owner, name, issues) — constructs the result dict

The main get_repository_info function now only handles orchestration and retry logic, making each piece independently testable and easier to follow.

get_repository_info was a ~90-line function handling validation, data
fetching, formatting, and dict construction. Split into four focused
helper functions:

- _is_valid_repository(repository) — checks archived + inactivity
- _fetch_labeled_issues(repository, rate_limiter) — fetches issues per label
- _format_issues(good_first_issues) — converts issue objects to dicts
- _build_repo_info(repository, owner, name, issues) — constructs the result dict

The main get_repository_info function now only handles orchestration and
retry logic, making each piece independently testable and easier to follow.
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

@sijie-Z is attempting to deploy a commit to the DeepSource Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant