[BUG]: Governance "Issue Resolution Rate" counts pull requests as issues
维护者通常 4 天内回复
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 86/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- github, javascript, react
调研方向
在 src/pages/GovernancePage.jsx 中,检查第338–343行附近的 Issue Resolution Rate 计算,并将其筛选逻辑与 issue 中提到的治理检查进行比较。从 repo issue 列表中排除 pull request,然后确认卡片的分母和比率只使用 issue;报告中的 OrgExplorer 示例应统计44个 issue,而不是获取到的100个项目。
由索引模型根据 Issue 内容生成。
描述
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
- Explore any active org (e.g. AOSSIE-Org) and open the Governance page.
- Click "Run Audit".
- Look at the "Issue Resolution Rate" bars — closed/total includes pull requests.
- 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:
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_requestto 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
- 主要语言
- JavaScript
- 星标
- 48
- 派生
- 169
- 平均合并
- 4 天 13 小时
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AOSSIE-Org/OrgExplorer 的其他 Issue
-
[BUG]: `fetchWithCache` crashes with `SyntaxError: Unexpected end of JSON input` when encountering empty repositories (HTTP 204 No Content)可能已有人在做 @Devnil434 于 5 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
AOSSIE-Org/OrgExplorer#433 · 1 条评论 ·
维护者通常 4 天内回复
-
[BUG]: Table sort headers can't be used from the keyboard and don't announce sort order可能已有人在做 @Simran-Sobhani 于 6 天前认领。 未关闭bug enhancement
难度 2/5 1-3 小时 新手友好度 78/100
AOSSIE-Org/OrgExplorer#419 · 2 条评论 ·
维护者通常 4 天内回复
-
[BUG]: Connect PAT modal saves invalid GitHub tokens without validation可能重新可做 @Prince-ES 于 8 天前认领,目前没有进行中的 PR。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
AOSSIE-Org/OrgExplorer#416 · 1 条评论 ·
维护者通常 4 天内回复
-
[BUG]: Avoid triggering Release Drafter for closed, unmerged pull requests可能已有人在做 @Praveena2809 于 6 天前认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 82/100
AOSSIE-Org/OrgExplorer#414 · 2 条评论 ·
维护者通常 4 天内回复
-
[BUG]: Overview "Language Distribution" percentages are relative to the top-7 languages, not all repos可能已有人在做 @Rohit270406 于 11 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
AOSSIE-Org/OrgExplorer#402 · 1 条评论 ·
维护者通常 4 天内回复
查看 AOSSIE-Org/OrgExplorer 的全部 Issue
相似的 Issue
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 88/100
modrollstudio/Modroll-Studio-Website#80 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 82/100
-
area: panel enhancement
难度 1/5 1 小时以内 新手友好度 72/100
GabrielGirardi/ledge#7 ·
-
0. Needs triage 35-feedback bug
难度 1/5 1 小时以内 新手友好度 62/100
维护者通常 1 天内回复
-
A-linter
难度 2/5 1-3 小时 新手友好度 73/100
oxc-project/oxc#28783 ·
维护者通常 1 天内回复