ci: add metric badge workflows and README dashboard#229
Conversation
Reviewer's GuideAdds 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 badgessequenceDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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_requestandpushtomain, 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| pull_request: | ||
| push: |
There was a problem hiding this comment.
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.
Summary
doplaydo/pdk-ci-workflow:make test -k modelto catch regressionsmake testwith--covpinned to packageAll logic is centralized — each workflow file is a thin caller (~10 lines).
Test plan
update_badgesrun🤖 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:
Documentation: