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

Gh metrics #1222

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Gh metrics #1222

wants to merge 17 commits into from

Conversation

dioptx
Copy link
Contributor

@dioptx dioptx commented Jan 7, 2025

Contents

Experimentation Notebooks (Self contained)

  • Defillama Specific notebooks
  • PoC for Github Metrics

Functionality updates

  • Ported new Github metric functionality in github_platform_metrics.py

Overview for github_platform_metrics.py

This file fetches and processes GitHub repository metrics

Key Components

  • Rate Limit Handling: Functions manage GitHub API rate limits, pausing execution when limits are reached.
  • GitHubFetcher: Fetches data from GitHub. Retrieves additional metadata for pull requests, such as reviews and comments.
  • Pull Request Processing: Calculates metrics like time-to-approval and time-to-merge for each PR

Main Functions

  • pull_github_data: Fetches data and returns a GitHubData object.
  • pull_and_write_platforms_github_metrics: Writes DataFrames to a data store for persistence.

Run Schedule

  • Runs Daily for all repositories

Update Schedule

  • All PRs that are not merged need to be checked every day for updates. Their metrics need to be updated daily.
  • When a PR is approved & merged, all metrics for its lifecycle can be calculated so there's no need to keep checking it every day. We only need to do it once in the initial pull.
  • [IMPORTANT] New comments on already merged PRs may occur but they are out of scope for this effort since no metrics rely on this information

@dioptx dioptx requested a review from lithium323 January 7, 2025 11:02
@dioptx dioptx self-assigned this Jan 7, 2025
@dioptx dioptx changed the title Gh metrics Gh metrics & Experimentation Notebooks Jan 7, 2025
@dioptx dioptx added the enhancement New feature or request label Jan 7, 2025
@dioptx dioptx added this to the Build Protocol devX Monitoring milestone Jan 7, 2025
@dioptx dioptx closed this Jan 7, 2025
@dioptx dioptx reopened this Jan 7, 2025
@dioptx dioptx linked an issue Jan 7, 2025 that may be closed by this pull request
@dioptx dioptx changed the title Gh metrics & Experimentation Notebooks Gh metrics Jan 10, 2025
@lithium323
Copy link
Collaborator

thanks so much for this head start work Dennis! I started looking at the branch and will push some commits to it with my changes. I want to keep the old github code that goes to bigquery so we can have some overlap between old and new as we migrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github metrics pipeline
2 participants