[BUG]: Governance "Issue Resolution Rate" counts pull requests as issues

Open Beginner friendly
#398 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@amangupta-12 is already working on this.

Since Oct 25, 2026.

  • #413 by @amangupta-12 — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github, javascript, react

Research direction

In src/pages/GovernancePage.jsx, inspect the Issue Resolution Rate calculation around lines 338–343 and compare its filtering with the governance checks cited in the issue. Exclude pull requests from the repo issue list, then verify that the card’s denominator and rate use issues only; the reported OrgExplorer example should count 44 issues rather than 100 fetched items.

Written by the indexing model from the issue text.

Description

bug
Bug Description

The Governance "Issue Resolution Rate" card computes each repo's rate from GitHub's
/issues data without excluding pull requests. GitHub's /issues?state=all returns PRs as
well as issues (every PR is also an issue object, identified by a pull_request key), so
merged/closed PRs are counted as resolved issues and the rate is wrong.

In src/pages/GovernancePage.jsx (~lines 338-343):

const repoIssues = allIssues.filter(i => i.repoName === r.name)
const closed = repoIssues.filter(i => i.state === 'closed').length
const total = repoIssues.length
const rate = total ? Math.round(closed / total * 100) : null

allIssues (built ~lines 107-114) includes PRs and is never filtered with !i.pull_request.
Every other governance check DOES filter PRs out — Dead Issues (line 126), Zombie PRs
(line 144), and the stale-issues stats (AppContext.jsx line 422) — so this widget is the
outlier.

Verified on live data for AOSSIE-Org/OrgExplorer (first 100 of state=all): 56 of the 100
"issues" are actually PRs, so the denominator is inflated 44 -> 100 and the rate reads 42%
instead of the correct 39%.

Steps to Reproduce
  1. Explore any active org (e.g. AOSSIE-Org) and open the Governance page.
  2. Click "Run Audit".
  3. Look at the "Issue Resolution Rate" bars — closed/total includes pull requests.
  4. Compare any repo's number with GitHub's real issue count and it won't match.

Deterministic check (same logic as the page, on live data):

node f1_resolution.mjs
# fetched items (issues + PRs): 100  (PRs among them: 56)
# CURRENT (buggy, counts PRs) : 42/100 closed -> 42%
# CORRECT (issues only)       : 17/44  closed -> 39%
Logs and Screenshots

Reproducible script output (replicates GovernancePage.jsx:338-343 on live GitHub data):

=== F1 Issue Resolution Rate — AOSSIE-Org/OrgExplorer (first 100 of state=all) ===
fetched items (issues + PRs): 100 (PRs among them: 56)

CURRENT (buggy, counts PRs) : 42/100 closed -> 42%
CORRECT (issues only) : 17/44 closed -> 39%

=> PRs inflate the denominator by 56 and skew the rate by 3 points.

📎 Image file:

Image
Environment Details
  • OS: macOS (also reproduces on the live site, any OS/browser)
  • Browser: Chrome
  • Site: https://orgexplorer.aossie.org/ and local dev (npm run dev), main @ d91d2b8
  • Node.js: v20 (for the repro script)
  • Suggested fix: add && !i.pull_request to the repoIssues filter.
  • Related but separate: #302's open PR #304 rewrites this exact line for org-scoping
    (issuesData?.[${r.orgLogin}/${r.name}] || []) but still counts PRs — so this defect
    survives #304 and should be fixed on top of / within that change.
Impact

Medium - Feature works but has issues

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
Dominant language
JavaScript
Stars
53
Forks
187
Avg merge
18m
Merged PRs (30d)
2

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 AOSSIE-Org/OrgExplorer

All issues in AOSSIE-Org/OrgExplorer

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.