Skip to content

ci: add metric badge workflows and README dashboard#229

Merged
ThomasPluck merged 1 commit intomainfrom
add-metric-badges
Apr 14, 2026
Merged

ci: add metric badge workflows and README dashboard#229
ThomasPluck merged 1 commit intomainfrom
add-metric-badges

Conversation

@joamatab
Copy link
Copy Markdown
Contributor

@joamatab joamatab commented Apr 14, 2026

Summary

  • Add 4 new CI workflows using centralized reusable workflows from doplaydo/pdk-ci-workflow:
    • model_coverage.yml — reports fraction of cells with models
    • model_regression.yml — runs make test -k model to catch regressions
    • test_coverage.yml — runs make test with --cov pinned to package
    • update_badges.yml — generates SVG badges (coverage %, models %, issues, PRs)
  • Update README with clickable badge dashboard

All logic is centralized — each workflow file is a thin caller (~10 lines).

Test plan

  • Verify all new workflows pass
  • Check badges render in README after first update_badges run

🤖 Generated with Claude Code

Summary by Sourcery

Add CI workflows and README badges for model and test coverage, regressions, and repo activity metrics using centralized reusable workflows.

CI:

  • Introduce model coverage, model regression, test coverage, and badge update workflows using shared CI templates.

Documentation:

  • Add a README badge dashboard linking to documentation, tests, DRC, coverage, model coverage, issues, and PRs.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 14, 2026

Reviewer's Guide

Adds a lightweight CI badge and metrics dashboard by wiring four new reusable GitHub Actions workflows (model coverage, model regression tests, test coverage, and badge generation) and exposing their outputs as clickable badges in the README.

Sequence diagram for scheduled update_badges workflow generating SVG badges

sequenceDiagram
  actor Maintainer
  participant Scheduler as GitHub_Scheduler
  participant Actions as GitHub_Actions_CSPDK
  participant UpdateWF as Update_Badges_Workflow
  participant ReusableWF as Reusable_Update_Badges_Workflow
  participant BadgesBranch as Badges_Branch
  participant RawServer as GitHub_Raw_Server
  participant Viewer as Badge_Viewer

  Scheduler->>Actions: Trigger update_badges on cron
  Maintainer->>Actions: Optional manual workflow_dispatch
  Actions->>UpdateWF: Load workflow config update_badges yml
  UpdateWF->>ReusableWF: uses doplaydo pdk ci workflow update_badges
  ReusableWF->>ReusableWF: Compute metrics issues PRs coverage model_coverage
  ReusableWF->>BadgesBranch: Commit generated SVG badges
  BadgesBranch->>RawServer: Expose coverage svg model_coverage svg issues svg prs svg
  Viewer->>RawServer: Request badge SVG via README links
  RawServer-->>Viewer: Return latest badge images
Loading

File-Level Changes

Change Details Files
Expose CI status, coverage, and repository metrics via a README badge dashboard.
  • Insert a BADGES block near the top of the README containing linked badges for docs, tests, DRC, model regression, test coverage, model coverage, issues, and pull requests.
  • Wire coverage, model coverage, and repository activity badges to SVGs served from the repository’s badges branch, and link them to the corresponding workflows or GitHub pages.
README.md
Add reusable-workflow wrappers for test, model, and coverage CI.
  • Create a Model Coverage workflow triggered on pull requests, main pushes, and manual dispatch, delegating to doplaydo/pdk-ci-workflow model_coverage.yml with inherited secrets.
  • Create a Model Regression workflow with the same triggers that delegates to doplaydo/pdk-ci-workflow model_regression.yml, relying on the centralized implementation (e.g., make test -k model).
  • Create a Test Coverage workflow with the same triggers that delegates to doplaydo/pdk-ci-workflow test_coverage.yml, centralizing coverage logic in the shared repo.
.github/workflows/model_coverage.yml
.github/workflows/model_regression.yml
.github/workflows/test_coverage.yml
Automate generation and refresh of metrics badges via a scheduled workflow.
  • Add an Update Badges workflow triggered on main pushes, a weekly cron schedule, and manual dispatch, delegating to doplaydo/pdk-ci-workflow update_badges.yml with inherited secrets to generate SVG badges (coverage, model coverage, issues, PRs).
.github/workflows/update_badges.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The reusable workflows are referenced with @main; consider pinning them to a specific tag or commit SHA to avoid unexpected CI behavior if the upstream repository changes.
  • The new workflows all trigger on both pull_request and push to main, which may result in duplicate runs for the same changes; consider tightening triggers (e.g., PR-only for checks, push-only for badge updates) to reduce unnecessary CI load.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The reusable workflows are referenced with `@main`; consider pinning them to a specific tag or commit SHA to avoid unexpected CI behavior if the upstream repository changes.
- The new workflows all trigger on both `pull_request` and `push` to `main`, which may result in duplicate runs for the same changes; consider tightening triggers (e.g., PR-only for checks, push-only for badge updates) to reduce unnecessary CI load.

## Individual Comments

### Comment 1
<location path=".github/workflows/model_coverage.yml" line_range="3-4" />
<code_context>
+name: Model Coverage
+on:
+  pull_request:
+  push:
+    branches: [main]
+  workflow_dispatch:
</code_context>
<issue_to_address>
**question (bug_risk):** Double-check `secrets: inherit` behavior for pull_request events, especially from forks

Because this job inherits secrets on `pull_request`, it won’t get secrets for PRs from forks (GitHub blocks that), which can cause the called workflow to fail or skip key steps. If you expect forked contributions, consider limiting this workflow to trusted branches/types, or update the called workflow to handle missing secrets safely and explicitly.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +3 to +4
pull_request:
push:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

question (bug_risk): Double-check secrets: inherit behavior for pull_request events, especially from forks

Because this job inherits secrets on pull_request, it won’t get secrets for PRs from forks (GitHub blocks that), which can cause the called workflow to fail or skip key steps. If you expect forked contributions, consider limiting this workflow to trusted branches/types, or update the called workflow to handle missing secrets safely and explicitly.

@ThomasPluck ThomasPluck merged commit 39dd777 into main Apr 14, 2026
7 of 8 checks passed
@ThomasPluck ThomasPluck deleted the add-metric-badges branch April 14, 2026 15:14
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