[BUG]: Governance audit may miss older open issues and PRs due to pagination order

Ouverte
#424 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@Smriti-N y travaille déjà.

Depuis le 27/10/2026.

  • #425 par @Smriti-N — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
github, javascript
Domaine
api, backend

Piste de recherche

Start in src/services/github.js and trace how fetchIssues supplies data to the Dead Issues and Zombie PRs checks, while preserving the existing fetch used by analytics. Add focused unit tests for the governance request parameters and fetched open items. Done when those checks request open items oldest first and the tests verify the behavior; pull request #425 is already open for this issue.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug enhancement
Bug Description

The fetchIssues function in src/services/github.js fetches issues using state=all, per_page=100, and paginated requests without explicitly specifying a sort order or direction.

GitHub returns issues in descending creation order by default, meaning newer items appear first. However, the Governance checks for Dead Issues (open for more than 90 days) and Zombie PRs (open for more than 90 days) depend on older open items, which may be excluded when the number of fetched results is limited.

Without a personal access token (PAT), the implementation fetches only the first page (up to 100 items). With a PAT, it fetches at most 10 pages (up to 1,000 items). On repositories with substantial activity, older open issues and pull requests may therefore be missing from the dataset, causing governance metrics to under-report neglected work or report zero incorrectly.

Additionally, using state=all means closed items consume part of the limited result set, even though these governance checks focus on open items.

Expected behavior

The Governance audit should retrieve an appropriate dataset of open issues and pull requests, prioritizing older items so that neglected work is less likely to be missed.

Actual behavior

The limited dataset may contain mostly newer items and closed items, causing older open issues and pull requests to be omitted and governance counts to be under-reported.

Suggested solution

  • Introduce a dedicated fetch strategy for governance checks using state=open&sort=created&direction=asc to prioritize older items.
  • Preserve the existing state=all fetch for analytics and time-series charts that require closed items.
  • Add unit tests to verify the request parameters and ensure the governance checks process the fetched open items correctly.

Oldest-first ordering will improve coverage of older items, although pagination limits may still prevent a complete audit of very large repositories.

Addition
I would like to start working on this issue.

Steps to Reproduce
  1. Open OrgExplorer and select an organization with a repository containing a large number of issues and pull requests.
  2. Navigate to the Governance page.
  3. Inspect the results returned by fetchIssues in src/services/github.js.
  4. Compare the fetched dataset with the repository's oldest open issues and pull requests using an oldest-first GitHub API query.
  5. Check whether older open items are missing from the dataset used by the Dead Issues and Zombie PRs checks.
  6. Compare the reported governance counts with the older open items found.

Repository tested: https://github.com/facebook/react?utm_source=chatgpt.com

Note: The impact is most apparent in repositories where the number of issues and pull requests exceeds the configured pagination limit.

Logs and Screenshots
Image
Environment Details
  • OS: Windows 11
  • Browser: Microsoft Edge
  • Project: AOSSIE OrgExplorer
  • Affected file: src/services/github.js
  • Affected functionality: Governance — Dead Issues and Zombie PRs
  • Authentication: Behavior depends on whether a GitHub personal access token is configured
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
Langage dominant
JavaScript
Étoiles
53
Forks
187
Merge moyen
18 min
PR mergées (30 j)
2

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de AOSSIE-Org/OrgExplorer

Toutes les issues de AOSSIE-Org/OrgExplorer

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.