[BUG]: Complete Analysis can silently skip repositories when the PAT has access to private repos
Maintainer thường phản hồi trong vòng 4 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github, javascript
Hướng nghiên cứu
Bắt đầu với fetchRepos trong src/services/github.js và lời gọi trong src/context/AppContext.jsx; issue có phần tái hiện lỗi bằng fetch giả lập, trả về 100 repository rồi 50. Trước tiên, đọc các bài kiểm tra việc lấy repository và kiểm tra cách dự án xác định phạm vi Complete Analysis. Hoàn tất khi bài kiểm tra xác nhận tất cả repository dự kiến đều được lấy và các bài kiểm tra hiện có đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Description
Summary
With a Personal Access Token configured, fetchRepos decides how many pages to request based on the organization's public repository count. If the token can also see private repositories, GitHub returns more repositories than that count, and the remaining pages are never requested. Those repositories are silently missing from the analysis.
Root cause
In src/services/github.js:
export async function fetchRepos(org, repoCount, pat) {
const all = []
const maxPages = pat ? Math.ceil(repoCount / 100) : 5
for (let page = 1; page <= maxPages; page++) {
const url = `https://api.github.com/orgs/${org}/repos?per_page=100&page=${page}&sort=updated`
const data = await fetchWithCache(url, pat)
all.push(...data)
if (data.length < 100) break
}
return all
}
src/context/AppContext.jsx calls it as:
fetchRepos(org.login, org.public_repos, pat)
The request URL does not set a type parameter, so for an authenticated token the /orgs/{org}/repos endpoint returns every repository the token can access, including private ones. The page limit, however, is calculated from org.public_repos only. When the token can see more repositories than public_repos, the loop reaches maxPages and stops, even though GitHub still has more full pages to return.
For example, with public_repos = 50 and 150 repositories visible to the token, maxPages is 1, so only the first 100 repositories are fetched and the remaining 50 are dropped.
Impact
- Total Repos, the Repositories page, and the analytics built on them can be based on an incomplete list, with no indication that data is missing.
- Private repositories can also be included in the results, while the "Learn More" panel describes Complete Analysis as covering all public repositories.
This only affects users whose token has access to private repositories in the analyzed organization.
Possible fixes
Either of these would resolve it, depending on the intended scope of Complete Analysis:
- Fetch public repositories only, by adding
type=publicto the request. This matches the "Learn More" description, andpublic_reposthen becomes an accurate page count. - Keep paginating until GitHub returns a page with fewer than 100 items, instead of deriving the limit from
public_repos(with a reasonable safety cap).
I'd be happy to work on this once the preferred approach is confirmed.
Steps to Reproduce
The issue can be reproduced with a unit test against the current main branch, by stubbing fetch to serve 150 repositories across two pages while public_repos is 50:
// fetch is stubbed to return 100 repos for page 1 and 50 repos for page 2
const result = await fetchRepos('some-org', 50, 'pat-token')
expect(result).toHaveLength(150)
Result:
AssertionError: expected 100 to be 150
Only the first page is requested, because maxPages = Math.ceil(50 / 100) = 1.
Real-world reproduction:
- Add a PAT in Settings that has access to private repositories of an organization.
- Explore that organization.
- Compare the number of repositories shown with the number visible to the token on GitHub. If the token can see more repositories than the organization's public count, some are missing.
Expected: all repositories in scope are fetched.
Actual: fetching stops after ceil(public_repos / 100) pages, and the remaining repositories are skipped.
Logs and Screenshots
Test output from npx vitest run:
AssertionError: expected 100 to be 150 // Object.is equality
- Expected
+ Received
- 150
+ 100
Environment Details
- Branch: upstream
main(as of 21 October 2026) - Reproduced with:
npx vitest run - Files:
src/services/github.js(fetchRepos),src/context/AppContext.jsx
Impact
Critical - Application is unusable
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Ngôn ngữ chính
- JavaScript
- Star
- 45
- Fork
- 148
- Merge trung bình
- 5 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AOSSIE-Org/OrgExplorer
-
[BUG]: Overview "Language Distribution" percentages are relative to the top-7 languages, not all reposCó thể đã có người làm @Rohit270406 đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AOSSIE-Org/OrgExplorer#402 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
[BUG]: "Delete" PAT button is gated on the input field, so a saved token can't be removed when the field is emptyCó thể đã có người làm @riyanshbhosale đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AOSSIE-Org/OrgExplorer#401 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
[BUG]: Overview wrongly lists a successfully-loaded org as "could not be loaded" (case / duplicate)Có thể đã có người làm @dhruvbit đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
AOSSIE-Org/OrgExplorer#400 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AOSSIE-Org/OrgExplorer#399 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
[BUG]: Governance "Issue Resolution Rate" counts pull requests as issuesCó thể đã có người làm @amangupta-12 đã nhận 1 ngày trước. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
AOSSIE-Org/OrgExplorer#398 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của AOSSIE-Org/OrgExplorer
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vercel-labs/agent-skills#348 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
NanmiCoder/dsh-agent-teams#289 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
c1overzz/dsh-bili-scroll#124 ·
Maintainer thường phản hồi trong vòng 1 ngày