Contributor login constructor crashes analytical model construction

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

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

@Shubham-Padkonde y travaille déjà.

Depuis le 26/10/2026.

  • #418 par @Shubham-Padkonde — ouverte

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
25/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
javascript, node.js
Domaine
analytics, backend

Piste de recherche

Start in src/services/analytics.js at buildAnalyticalModel() and read the existing analytical-model tests. Reproduce with the supplied input containing the login constructor, then add coverage for inherited-property names and aggregation across repositories. Done when construction returns the contributor with the expected contribution and the existing output shape and sorting remain intact.

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

Description

bug
Bug Description

buildAnalyticalModel() crashes when a repository has a contributor whose login is constructor (a valid GitHub username). The contributor accumulator is a plain object, so contributorMap[login] finds an inherited property and skips initializing the contributor record. It then fails at entry.repos.push(...), aborting the analysis.

Steps to Reproduce

Run from the repository root with Node:

import { buildAnalyticalModel } from './src/services/analytics.js'
const repos = { demo: [{ name: 'repo', pushed_at: '2026-10-01T00:00:00Z', open_issues_count: 0 }] }
buildAnalyticalModel(
  [{ login: 'demo' }],
  repos,
  { 'demo/repo': [{ login: 'constructor', contributions: 1 }] },
  repos,
)

Expected: one contributor named constructor with one contribution.
Actual: TypeError: Cannot read properties of undefined (reading 'push').

Proposed fix

I plan to use a null-prototype object for this accumulator and extend the existing analytical-model tests to cover inherited-property names, including aggregation across repositories. This keeps the existing output shape and sorting behavior.

Environment: Windows, Node 24.15.0, current main. No browser credentials or live repository writes are needed to reproduce this.

AI disclosure: Codex (GPT-6) investigated and reproduced this issue and drafted this report on my behalf. This text has not had prior human review.

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.