check_contributors.py makes two gh calls per pull request where one would do

Open Beginner friendly
#1,332 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github, python
Domain
tooling

Research direction

Read scripts/contributors_github.py and locate fetch_commit_authors, fetch_closing_issues, plus the --pending and --stub paths. Check how the fake-runner tests count gh commands and preserve the run_gh timeout and all-or-nothing failure behavior. Done means each path makes one gh pr view call per PR and the existing fake-runner tests cover that count.

Written by the indexing model from the issue text.

Description

enhancement tooling

Where: scripts/contributors_github.py (fetch_commit_authors, fetch_closing_issues).

Current gap: Both wrappers run gh pr view N per pull request, one with --json commits and one with --json closingIssuesReferences, so a sweep with 10 pending PRs makes 20 calls (each a GraphQL round trip, about a second) when --json commits,closingIssuesReferences returns both.

Suggested approach: Replace the two wrappers by one fetch_pr_details(numbers) returning {number: {commit_authors, closing_issues}} and have --pending and --stub use it, keeping the run_gh timeout and the all-or-nothing failure behaviour.

Done when: a pending run and a stub run each make one gh pr view call per PR, covered by the fake-runner tests that already count the commands.

Dominant language
HTML
Stars
47
Forks
45
Avg merge
2h 49m
Merged PRs (30d)
69

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yakew7/Fair-Code

All issues in yakew7/Fair-Code

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.