Overview
Implement an automated weekly CI process that tracks download counts and star growth, calculates week-over-week deltas, and updates a single self-contained SVG artifact. To eliminate separate state files, the historical metrics and checkpoint data must be embedded directly within the SVG metadata/comments. The workflow will update the figure via an automated Pull Request and embed it into the project documentation.
Key Requirements
1. Self-Contained State & Delta Engine
-
No external state files: The SVG artifact must serve as both the visualization output and the single source of truth for historical checkpoints.
-
Embedded Checkpoint: Embed structured JSON state directly into the SVG file structure (e.g., inside an SVG
<metadata> tag or XML comment block <!-- METRICS_CHECKPOINT_DATA: {...} -->).
-
Delta Computation:
- Read previous state from existing
metrics.svg.
- Fetch current total metrics (stars, downloads) from upstream APIs.
- Calculate weekly diffs ($\Delta \text{stars}$, $\Delta \text{downloads}$).
- Append current period data to history and overwrite the embedded metadata block during regeneration.
2. Dual-Axis Visual Layout
-
New Stars: Rendered as vertical bar series on the primary axis.
-
Weekly Downloads: Rendered as a trend line overlay on the secondary axis.
-
Rolling Window: Display a configurable historical range (e.g., last $N$ weeks).
-
Embedded Summary: Include header metrics highlighting the most recent week-over-week change.
3. Continuous Integration & Workflow
- Trigger: Scheduled weekly CI runner (e.g., cron
0 0 * * 0).
- Pipeline Execution:
- Extract embedded state from target SVG in repository.
- Query external APIs for latest metrics.
- Re-render SVG graphic and serialize updated state payload into its metadata.
- Submit changes via automated Pull Request.
4. Documentation Integration
Embed the self-updating SVG into the documentation site and main repository landing page:
<img src="docs/assets/weekly-metrics.svg" alt="Weekly Activity and Growth Metrics" width="100%" />
Technical Tasks
Overview
Implement an automated weekly CI process that tracks download counts and star growth, calculates week-over-week deltas, and updates a single self-contained SVG artifact. To eliminate separate state files, the historical metrics and checkpoint data must be embedded directly within the SVG metadata/comments. The workflow will update the figure via an automated Pull Request and embed it into the project documentation.
Key Requirements
1. Self-Contained State & Delta Engine
<metadata>tag or XML comment block<!-- METRICS_CHECKPOINT_DATA: {...} -->).metrics.svg.2. Dual-Axis Visual Layout
3. Continuous Integration & Workflow
0 0 * * 0).4. Documentation Integration
Embed the self-updating SVG into the documentation site and main repository landing page:
Technical Tasks
.github/workflows/update-metrics-svg.ymlscheduled workflow.