Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add API for data insights on PRs, issues, and code changes. #700

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

xingwanying
Copy link
Contributor

Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
petercat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 8:17am

Copy link

Walkthrough

This PR introduces a new API for data insights on pull requests, issues, and code changes. It adds new endpoints to the FastAPI router for fetching insights from GitHub repositories, utilizing external data sources to aggregate metrics by year, quarter, and month.

Changes

File Summary
server/insight/router.py Added new API endpoints for insights on issues, PRs, and code changes.
server/insight/service/issue.py, server/insight/service/pr.py Implemented functions to fetch and process data for issues and PRs using a metrics mapping.
server/main.py Integrated the new insight router into the main application.
server/tests/utils/test_insight.py Added unit tests for the data fetching utility to ensure correct data aggregation.
server/utils/insight.py Created a utility function to fetch and aggregate data from external sources.

return json.dumps({"success": False, "message": str(e)})


@router.get("code_change")

Choose a reason for hiding this comment

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

The endpoint path for get_code_change_insight is missing a leading slash. It should be @router.get("/code_change") to ensure the route is correctly registered.

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
server/main.py 92.30% <ø> (ø)

... and 2 files with indirect coverage changes

Copy link
Contributor

@ch-liuzhide ch-liuzhide left a comment

Choose a reason for hiding this comment

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

LGTM

@xingwanying xingwanying merged commit 205e146 into main Jan 20, 2025
5 checks passed
@xingwanying xingwanying deleted the feat_insight branch January 20, 2025 09:02
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.

2 participants