Skip to content

Conversation

@frank-zsy
Copy link
Contributor

This PR fixes:

  • The githubAppBaseTable which is a legacy implementation when events data and GitHub app data are separated into different tables. But now they are all in events table, so we should not use this anymore.
  • User uniqExactIf instead of uniqIf to get more accurate data.

Signed-off-by: frank-zsy <syzhao1988@126.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the database query structure by removing the legacy githubAppBaseTable function, which was used when GitHub app data and events data were stored in separate tables. Now that all data resides in the unified events table, queries have been simplified to directly query the events table. Additionally, the PR improves data accuracy by replacing countIf and uniqIf with uniqExactIf for counting distinct values.

  • Removed the deprecated githubAppBaseTable function and its usages across all metric files
  • Updated all queries to directly use the events table with explicit WHERE clauses
  • Changed from countIf/uniqIf to uniqExactIf for more accurate distinct counting of events, issues, comments, and pull requests
  • Fixed default value for age levels array to properly initialize with zeros

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/metrics/basic.ts Removed the legacy githubAppBaseTable function that performed UNION ALL operations between github_app_repo_data and events tables
src/metrics/metrics.ts Removed import and replaced githubAppBaseTable usage with direct events table query
src/metrics/indices.ts Replaced githubAppBaseTable calls with direct queries and updated activity calculations to use uniqExactIf with appropriate field names (issue_comment_id, issue_id, pull_review_comment_id)
src/metrics/chaoss.ts Updated all queries to use events table directly and corrected the default value for age_levels array from empty array to [0,0,0,0] to match the expected 4-element array structure
src/cron/tasks/globalOpenrank.ts Changed activity calculation from uniqIf to uniqExactIf for more accurate distinct counting of issues, comments, and pull requests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@frank-zsy frank-zsy merged commit 8755f14 into X-lab2017:master Jan 7, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant