[BUG]: respect granularity when limiting analytics time-series buckets
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- analytics
調査の方向性
src/services/analytics.jsと、src/services/analytics.buildTimeSeries.test.jsにある既存のテストを読んでください。buildTimeSeriesが週次および月次のバケットをどのように処理するか、またテストでバケット数と順序をどのように検証するかを確認してください。月次の結果が12件、週次の結果が26件に制限され、結果が時系列順に並んだ状態を保てば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bug Description
The buildTimeSeries function in src/services/analytics.js limits its output to the last 12 buckets regardless of the selected granularity.
As a result, the Weekly view displays only approximately 12 weeks of activity (~3 months), while the Monthly view can display up to 12 months of activity. This creates inconsistent historical windows when switching between granularities.
The function already accepts a granularity parameter, but the final .slice(-12) applies the same limit to both monthly and weekly buckets.
Expected Behavior:
- Monthly granularity should retain up to 12 buckets (~12 months).
- Weekly granularity should retain up to 26 buckets (~6 months).
Actual Behavior:
Both granularities are limited to 12 buckets, causing older activity to disappear from the Weekly view.
Proposed Fix
Use a bucket limit based on the selected granularity instead of hardcoding the limit to 12:
const SLICE_COUNT = granularity === 'weekly' ? 26 : 12;
return Object.values(buckets)
.sort((a, b) => a.date.localeCompare(b.date))
.slice(-SLICE_COUNT);
This allows the Weekly view to retain up to 26 buckets while preserving the existing 12-bucket limit for the Monthly view.
Testing
Update src/services/analytics.buildTimeSeries.test.js to verify that:
- Monthly granularity returns at most 12 buckets.
- Weekly granularity returns at most 26 buckets.
- Weekly granularity can return more than 12 buckets when sufficient data is available.
- Results remain sorted chronologically.
Scope
- Implementation:
src/services/analytics.js - Tests:
src/services/analytics.buildTimeSeries.test.js - No UI, layout, or API changes are required.
Steps to Reproduce
- Run the application locally using
npm run dev. - Explore an organisation with sufficient issue or pull request history, such as
AOSSIE-Org. - Navigate to the Analytics page.
- Click Run Complete Analysis to populate the time-series chart.
- Select Monthly granularity and observe the displayed date range.
- Switch to Weekly granularity.
- Observe that the chart displays at most 12 weekly buckets, even when older activity is available.
The issue can also be reproduced by passing more than 12 distinct weekly buckets to buildTimeSeries in src/services/analytics.js.
Logs and Screenshots
No error logs are expected because this is a data truncation issue rather than a runtime error.
A screenshot comparing the Monthly and Weekly analytics views would help demonstrate the inconsistent historical windows.
Relevant implementation: src/services/analytics.js, where the returned buckets are limited using .slice(-12).
Relevant tests: src/services/analytics.buildTimeSeries.test.js.
Environment Details
- OS: Ubuntu 26 LTS
- Browser: Brave (Chromium-based)
- Runtime: Node.js 22.22.1
- Project: AOSSIE-Org/OrgExplorer
- Setup: Local development environment using
npm run dev - Additional context: The issue concerns the time-series bucket limit in
src/services/analytics.js.
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
- 主要言語
- JavaScript
- スター
- 42
- フォーク
- 124
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/OrgExplorer のほかの issue
-
[BUG]: Loading skeletons use hardcoded dark colors and appear as dark blocks in light mode on every page対応中かも @g-k-s-03 が 3 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/OrgExplorer#326 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[FEATURE]: Pressing Enter after typing all orgs to search should hit explore.対応中かも @Rajvardhan-Singh-Rathore が 3 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
AOSSIE-Org/OrgExplorer#324 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: Navigating to a new page preserves the previous scroll position対応中かも @syedbarkath980 が 6 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AOSSIE-Org/OrgExplorer#314 ·
メンテナーはふだん 1 日以内に返信
-
[FEATURE]: Add Language column in Repository Explorer table対応中かも @ProgrammerNesi が 7 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
AOSSIE-Org/OrgExplorer#309 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
chore(assets): Convert org-explorer-logo.png to SVG再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AOSSIE-Org/OrgExplorer#301 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
AOSSIE-Org/OrgExplorer の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
521xueweihan/HelloGitHub#3939 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
aemsites/author-kit#19 ·
-
needs-website-changes
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信