Skip to content

Extend the scorecard github module with some new metrics #3468

@christoph-jerolimov

Description

@christoph-jerolimov

Scorecard is a backstage plugin and the GitHub module for scorecard lives in folder workspaces/scorecard/plugins/scorecard-backend-module-github. For the new metrics only code changes in this folder should be neccessary.

The GitHub module creates already this metric:

  1. Currently Open PRs already exist.

Add this metrics for Issues/PRs:

  1. Currently Open issues. This is the number of open issues (not PR) at the time the metric is calculated.
  2. Opened issues. This is the number of opened issues in the last 7 days.
  3. Opened PRs. This is the number of opened PRs in the last 7 days.
  4. Closed issues. This is the number of opened issues in the last 7 days.
  5. Closed PRs. This is the number of opened PRs in the last 7 days.

All these metrics for PRs:

  1. Time to Review is the time that PRs takes from creation (PR create time) until the first pullrequestreview was added, independend if the pullrequestreview status. This metric should fetch all PRs (open and closed) that was updated in the last 7 days. PRs without any pullrequestreview should be ignored.
  2. Time to Approve is the time that PRs takes from creation (PR create time) until the first pullrequestreview has the status approved. This metric should fetch all PRs (open and closed) that was updated in the last 7 days. PRs without any pullrequestreview should be ignored.
  3. Time to Merge is the time that PRs takes from creation to merged. This metric should fetch all merged PRs that was updated in the last 7 days. Closed PRs without merge should be ignored.
  4. First time CI status pass rate for the last 7 days and the last 24 hours. This metrics should check the CI status for PRs that was opened in the last 7 days or last 24 hours. It was succesful when all CI statuses was green for the last commit of the first push to a PR.

And this metrics for GitHub Actions:

  1. Number of started actions in the last 7 days.
  2. Number of successfully finished actions in the last 7 days. Ignore actions that are pending, running, canceled, etc.
  3. Number of failed actions in the last 7 days. Ignore actions that are pending, running, canceled, etc.
  4. Two metrics for Ratio of successful vs successful+failed actions, once for the last 7 days and one for the last 24 hours. Ignore actions that are pending, running, canceled, etc.

Metadata

Metadata

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions