[BUG]: Complete Analysis can silently skip repositories when the PAT has access to private repos
Los mantenedores suelen responder en 4 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 75/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- github, javascript
Línea de trabajo
Empieza con fetchRepos en src/services/github.js y la llamada en src/context/AppContext.jsx; el issue incluye una reproducción con un fetch simulado que devuelve 100 repositorios y luego 50. Primero lee las pruebas de obtención de repositorios y comprueba cómo define el proyecto el alcance de Complete Analysis. El trabajo estará terminado cuando la prueba confirme que se obtienen todos los repositorios previstos y pasen las pruebas existentes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- JavaScript
- Estrellas
- 45
- Forks
- 148
- Merge medio
- 5 d 14 h
- PR fusionados (30 d)
- 30
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AOSSIE-Org/OrgExplorer
-
[BUG]: Overview "Language Distribution" percentages are relative to the top-7 languages, not all reposPosiblemente ocupada @Rohit270406 la tomó hace 1 día. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AOSSIE-Org/OrgExplorer#402 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
[BUG]: "Delete" PAT button is gated on the input field, so a saved token can't be removed when the field is emptyPosiblemente ocupada @riyanshbhosale la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
AOSSIE-Org/OrgExplorer#401 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
[BUG]: Overview wrongly lists a successfully-loaded org as "could not be loaded" (case / duplicate)Posiblemente ocupada @dhruvbit la tomó hace 1 día. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
AOSSIE-Org/OrgExplorer#400 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AOSSIE-Org/OrgExplorer#399 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
[BUG]: Governance "Issue Resolution Rate" counts pull requests as issuesPosiblemente ocupada @amangupta-12 la tomó hoy. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
AOSSIE-Org/OrgExplorer#398 · 1 comentario ·
Los mantenedores suelen responder en 4 días
Todos los issues de AOSSIE-Org/OrgExplorer
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
Los mantenedores suelen responder en 1 día
-
CloudredirectAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
NanmiCoder/dsh-agent-teams#277 ·
Los mantenedores suelen responder en 1 día
-
[ordering-review] workshop order graph: 1 confirmed ordering problem, 3 cycles are false positivesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
githubnext/gh-aw-workshop#4943 ·
Los mantenedores suelen responder en 1 día