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

Implement initial project health metrics/requirements support #798

Open
arkid15r opened this issue Feb 10, 2025 · 4 comments · May be fixed by #904
Open

Implement initial project health metrics/requirements support #798

arkid15r opened this issue Feb 10, 2025 · 4 comments · May be fixed by #904
Assignees
Labels

Comments

@arkid15r
Copy link
Collaborator

Describe the solution you'd like

1. ProjectHealthMetrics Model

This model stores the raw metric values for each project. The fields include:

  • contributors_count: Total number of contributors.
  • created_at: Timestamp when the project was created.
  • forks_count: Number of forks for the project's repository.
  • is_funding_requirements_compliant: Boolean indicating compliance with funding policies.
  • is_project_leaders_requirements_compliant: Boolean indicating whether project leadership meets requirements.
  • last_released_at: Timestamp of the most recent release.
  • last_committed_at: Timestamp of the latest commit.
  • open_issues_count: Number of currently open issues.
  • open_pull_requests_count: Number of currently open pull requests.
  • owasp_page_last_updated_at: Timestamp for the last update of the OWASP.org project page.
  • pull_request_last_created_at: Timestamp of the most recent pull request creation.
  • recent_releases_count: Count of releases within a defined recent time window.
  • score: A computed float value (0 to 100) representing the project’s health.
  • stars_count: Number of GitHub stars.
  • total_issues_count: Total number of issues over the project’s lifetime.
  • total_pull_request_count: Total number of pull requests over the project’s lifetime.
  • total_releases_count: Total number of releases over the project’s lifetime.
  • unanswered_issues_count: Number of issues that have not received responses.
  • unassigned_issues_count: Number of issues that are not assigned to anyone.

2. ProjectHealthRequirements Model

This model defines the thresholds and criteria used to calculate the health score for each project, differentiated by project level (e.g., incubator, lab, production, flagship). The fields include:

  • contributors_count: Expected or minimum number of contributors.
  • creation (days): Expected project age in days.
  • forks_count: Threshold value for the number of forks.
  • last_release (days): Expected number of days since the last release.
  • last_commit (days): Expected number of days since the last commit.
  • open_issues_count: Acceptable limit for open issues.
  • open_pull_requests_count: Acceptable limit for open pull requests.
  • owasp_page_last_update (days): Expected days since the last update on the OWASP project page.
  • last_pull_request_creation (days): Expected days since the last pull request was created.
  • recent_releases_count: Minimum number of releases expected in a recent time window.
  • recent_releases_time_window (days): The time window (in days) for considering recent releases.
  • stars_count: Expected number of GitHub stars.
  • total_pull_requests_count: Expected total pull requests.
  • total_releases_count: Expected total releases.
  • unanswered_issues_count: Acceptable limit for unanswered issues.
  • unassigned_issues_count: Acceptable limit for unassigned issues.

Each instance of ProjectHealthRequirements is associated with a specific project level. This allows the management command to retrieve the appropriate set of criteria when calculating the score for a project.


Management Command Overview

The management command will:

  1. Populate Metrics:
    Iterate over all projects and update the corresponding ProjectHealthMetrics instance by retrieving current values (e.g., from GitHub APIs, OWASP.org, etc.).

  2. Calculate Health Score:

    • For each project, determine its project level (incubator, lab, production, flagship).
    • Retrieve the corresponding ProjectHealthRequirements instance.
    • Use the raw metric values from ProjectHealthMetrics and the thresholds/criteria from ProjectHealthRequirements to compute a health score on a scale of 0 to 100.
    • Update the score field in the ProjectHealthMetrics model with the computed value (the computation formula is still WIP and will be changing a lot in future, for now let's use something simple based on just a couple of factors)
@github-project-automation github-project-automation bot moved this to Backlog in Project Nest Feb 10, 2025
@arkid15r arkid15r moved this from Backlog to In progress in Project Nest Feb 10, 2025
@RitikJha93
Copy link

Hey @arkid15r I would like to contribute on this

@arkid15r arkid15r assigned Dishant1804 and unassigned harsh3dev Feb 11, 2025
@osamaahmed17
Copy link
Contributor

@RitikJha93, if you are facing issue with this task, I can work upon it.

@Yashgupta9330
Copy link
Collaborator

@Dishant1804 are you working on it ?

@Dishant1804
Copy link
Collaborator

@Dishant1804 are you working on it ?

Yess, I'll raise PR soon

@Dishant1804 Dishant1804 linked a pull request Feb 20, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

6 participants