Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 25, 2025

This PR adds a new GitHub Actions workflow that automatically updates rolldown build statistics whenever changes are pushed to the main branch that modify the dashboard code.

What it does

The new .github/workflows/update-rolldown-stats.yml workflow:

  • Triggers automatically when code is pushed to the main branch with changes to apps/dashboard/**
  • Runs performance analysis using the existing pnpm rolldown:stats command
  • Commits results back to main if the statistics file changes

Why this is needed

The dashboard directly imports and visualizes rolldown performance data from rolldown-version-stats.json:

import rolldownStats from '../../../rolldown-version-stats.json'

const buildTimeData = rolldownStats.map(stat => ({
  name: `v${stat.version}`,
  value: stat.buildTime
}))

When dashboard code changes are merged to main, the build statistics may also change (different bundle sizes, build times, etc.), so the stats need to be automatically updated to keep the visualizations accurate.

Implementation details

The workflow follows existing CI patterns and includes:

  • Proper permissions (contents: write) to commit back to the main branch
  • Smart change detection that only commits when rolldown-version-stats.json actually changes
  • Direct push to main branch after stats collection
  • Comprehensive error handling for cases where no updates are needed
  • Uses maintainer's git configuration for commits

The pnpm rolldown:stats command analyzes build performance across multiple rolldown versions, generating fresh statistics that include timestamps, build times, bundle sizes, and file breakdowns.

Fixes #26.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update tool Add CI workflow to auto-update rolldown stats on dashboard changes Aug 25, 2025
Copilot AI requested a review from Boshen August 25, 2025 06:57
name: Update Rolldown Stats

on:
pull_request:
Copy link
Member

Choose a reason for hiding this comment

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

@copilot change to change on main branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the trigger to push on main branch instead of pull_request. The workflow will now run when changes are pushed to the main branch. (63469e9)

- name: Commit and push changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "[email protected]"
Copy link
Member

Choose a reason for hiding this comment

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

@copilot replace email to my email [email protected]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced email with [email protected] in the git config. (63469e9)

if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
Copy link
Member

Choose a reason for hiding this comment

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

@copilot replace with my name Boshen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced username with "Boshen" in the git config. (63469e9)

Copilot AI changed the title Add CI workflow to auto-update rolldown stats on dashboard changes Add CI workflow to auto-update rolldown stats on main branch changes Aug 25, 2025
Copilot AI requested a review from Boshen August 25, 2025 08:07
@Boshen Boshen marked this pull request as ready for review August 25, 2025 08:10
@Boshen Boshen merged commit 98f4187 into main Aug 25, 2025
1 check passed
@Boshen Boshen deleted the copilot/fix-26 branch August 25, 2025 08:10
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.

Update tool

3 participants