Contributor login constructor crashes analytical model construction

未关闭
#417 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Shubham-Padkonde 已经在做这个了。

开始于 2026年10月26日。

  • #418 来自 @Shubham-Padkonde —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
领域
analytics, backend

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
JavaScript
星标
53
派生
187
平均合并
18 分钟
30 天内合并 PR
2

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AOSSIE-Org/OrgExplorer 的其他 Issue

查看 AOSSIE-Org/OrgExplorer 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。