From 72305ea291eb4ad8a304e48da8fd2392e21ce72e Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:27:47 +0000 Subject: [PATCH 1/3] fix: add missing cache configurations to CI workflows - Add Turbo cache to test and e2e jobs in ci.yml - Add Playwright browser cache to e2e job in ci.yml - Add Playwright browser cache to storybook-tests.yml - Optimize browser installation with conditional steps Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/bb8d201b-62ea-48f6-997e-339b081d66b6 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++++ .github/workflows/storybook-tests.yml | 16 ++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d51ccbb6..e3fcc5934 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,14 @@ jobs: node-version: '20.x' cache: 'pnpm' + - name: Turbo Cache + uses: actions/cache@v5 + with: + path: node_modules/.cache/turbo + key: turbo-${{ runner.os }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }}- + - name: Install dependencies run: pnpm install --frozen-lockfile @@ -120,6 +128,14 @@ jobs: node-version: '20.x' cache: 'pnpm' + - name: Turbo Cache + uses: actions/cache@v5 + with: + path: node_modules/.cache/turbo + key: turbo-${{ runner.os }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }}- + - name: Install dependencies run: pnpm install --frozen-lockfile @@ -128,9 +144,25 @@ jobs: with: name: build-output + - name: Get Playwright version + id: playwright-version + run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT + + - name: Cache Playwright browsers + uses: actions/cache@v5 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} + - name: Install Playwright browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' run: pnpm exec playwright install --with-deps chromium + - name: Install Playwright system dependencies + if: steps.playwright-cache.outputs.cache-hit == 'true' + run: pnpm exec playwright install-deps chromium + - name: Run E2E tests run: pnpm test:e2e --project=chromium diff --git a/.github/workflows/storybook-tests.yml b/.github/workflows/storybook-tests.yml index 25109a2c5..9a00caf20 100644 --- a/.github/workflows/storybook-tests.yml +++ b/.github/workflows/storybook-tests.yml @@ -58,9 +58,25 @@ jobs: - name: Build Storybook run: pnpm storybook:build + - name: Get Playwright version + id: playwright-version + run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT + + - name: Cache Playwright browsers + uses: actions/cache@v5 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} + - name: Install Playwright Browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' run: pnpm exec playwright install --with-deps chromium + - name: Install Playwright system dependencies + if: steps.playwright-cache.outputs.cache-hit == 'true' + run: pnpm exec playwright install-deps chromium + - name: Run Storybook tests run: pnpm storybook:ci From 001ea0f8f53bc0bd7ac4fbc29daa7e47fff439fc Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:28:56 +0000 Subject: [PATCH 2/3] docs: add CI cache configuration audit report Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/bb8d201b-62ea-48f6-997e-339b081d66b6 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- .github/CI_CACHE_AUDIT.md | 191 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 .github/CI_CACHE_AUDIT.md diff --git a/.github/CI_CACHE_AUDIT.md b/.github/CI_CACHE_AUDIT.md new file mode 100644 index 000000000..cccdf807d --- /dev/null +++ b/.github/CI_CACHE_AUDIT.md @@ -0,0 +1,191 @@ +# CI Cache Configuration Audit Report + +**Date:** 2026-04-13 +**Repository:** objectstack-ai/objectui +**Branch:** claude/check-ci-cache-processes + +## Executive Summary + +This report documents a comprehensive audit of all GitHub Actions workflow cache configurations. The audit identified and fixed several missing cache configurations that were impacting CI performance. + +### Key Findings + +- ✅ **pnpm-lock.yaml:** Valid and healthy (lockfile version 9.0, 46 importers) +- ❌ **Missing Turbo caches:** 2 jobs were missing Turbo cache configuration +- ❌ **Missing Playwright caches:** 2 jobs were installing browsers from scratch every time +- ✅ **pnpm version:** Consistently set to 10.31.0 across all workflows +- ✅ **Cache keys:** Properly scoped and consistent + +## Issues Fixed + +### 1. ci.yml - Test Job +**Problem:** Missing Turbo cache +**Impact:** Tests ran without build cache, slowing down test execution +**Fix:** Added Turbo cache configuration with proper keys + +### 2. ci.yml - E2E Job +**Problem:** Missing both Turbo cache and Playwright browser cache +**Impact:** +- No build cache for E2E tests +- Playwright browsers (~200MB) downloaded and installed every run +**Fix:** +- Added Turbo cache configuration +- Added Playwright browser cache with version-based key +- Optimized installation steps to skip browser download when cached + +### 3. storybook-tests.yml +**Problem:** Missing Playwright browser cache +**Impact:** Playwright browsers downloaded every run +**Fix:** +- Added Playwright browser cache with version-based key +- Optimized installation with conditional steps + +## Cache Configuration Details + +### Turbo Cache +**Purpose:** Caches build outputs and computation results +**Path:** `node_modules/.cache/turbo` +**Key Strategy:** +- Primary key: `turbo-${{ runner.os }}-${{ github.sha }}` +- Restore keys: `turbo-${{ runner.os }}-` + +**Workflows Using Turbo Cache:** +- ✅ ci.yml (test, build, e2e, docs) +- ✅ lint.yml +- ✅ storybook-deploy.yml +- ✅ release.yml +- ✅ performance-budget.yml +- ✅ storybook-tests.yml +- ✅ changeset-release.yml + +### pnpm Cache +**Purpose:** Caches npm packages +**Implementation:** Built into `setup-node` action with `cache: 'pnpm'` +**Path:** `~/.pnpm-store` (managed by action) + +**All workflows properly configured with pnpm cache** ✅ + +### Playwright Browser Cache +**Purpose:** Caches installed browser binaries +**Path:** `~/.cache/ms-playwright` +**Key Strategy:** `playwright-${{ runner.os }}-${{ version }}` + +**Implementation Details:** +```yaml +- name: Get Playwright version + id: playwright-version + run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT + +- name: Cache Playwright browsers + uses: actions/cache@v5 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} + +- name: Install Playwright browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' + run: pnpm exec playwright install --with-deps chromium + +- name: Install Playwright system dependencies + if: steps.playwright-cache.outputs.cache-hit == 'true' + run: pnpm exec playwright install-deps chromium +``` + +**Workflows Using Playwright Cache:** +- ✅ ci.yml (e2e job) +- ✅ storybook-tests.yml + +## Performance Impact + +### Before Optimization +- Test job: No build cache +- E2E job: No build cache + ~200MB browser download every run +- Storybook tests: ~200MB browser download every run + +### After Optimization +- Test job: Turbo cache enables incremental builds/tests +- E2E job: Build cache + browser cache (browser download only on version change) +- Storybook tests: Browser cache (browser download only on version change) + +**Estimated Time Savings:** +- Browser downloads: ~2-3 minutes per workflow run (when cached) +- Build cache: Variable, depends on changes (typically 30s-2min) + +## Lockfile Health Check + +``` +✅ pnpm-lock.yaml is valid YAML +✅ Lockfile version: 9.0 +✅ Total importers: 46 +✅ No YAML document separator issues +✅ No corruption detected +``` + +**Note on Error in Problem Statement:** +The error mentioned in the original issue appears to have been a transient problem, possibly caused by: +- Concurrent git operations creating a temporary conflict +- Network interruption during a previous workflow run +- Manual editing that was later corrected + +The current lockfile is completely valid. + +## Workflows Not Requiring Additional Caching + +### shadcn-check.yml +- Only runs analysis commands +- No build/test operations +- pnpm cache sufficient + +### dependabot-auto-merge.yml +- Only validates and approves PRs +- No build operations +- pnpm cache sufficient + +### changelog.yml, labeler.yml, check-links.yml, stale.yml +- Non-build workflows +- Don't require build caching + +## Best Practices Implemented + +1. **Consistent pnpm version** (10.31.0) across all workflows +2. **Turbo cache** for all build/test jobs +3. **Playwright cache** version-scoped to avoid stale browsers +4. **Conditional installation** to skip downloads when cached +5. **System dependencies** installed separately when using cached browsers +6. **Cache keys** properly scoped by OS and version/SHA + +## Recommendations for Future + +1. **Monitor cache hit rates** in GitHub Actions to ensure caches are being used effectively +2. **Consider adding cache size limits** to prevent excessive storage usage +3. **Review cache strategy** if Playwright version changes frequently +4. **Document cache invalidation strategy** for major dependency updates + +## Files Modified + +- `.github/workflows/ci.yml` + - Added Turbo cache to test job + - Added Turbo cache to e2e job + - Added Playwright cache to e2e job with conditional installation +- `.github/workflows/storybook-tests.yml` + - Added Playwright cache with conditional installation + +## Validation + +All changes follow GitHub Actions best practices: +- ✅ Cache paths are correct for each tool +- ✅ Cache keys include appropriate scope (OS, version, SHA) +- ✅ Restore keys allow fallback to previous caches +- ✅ Conditional steps prevent unnecessary operations +- ✅ All workflows maintain pnpm version consistency + +## Conclusion + +The audit successfully identified and resolved cache configuration gaps in the CI pipeline. The improvements will: +- Reduce CI execution time +- Lower bandwidth usage +- Improve developer experience with faster feedback +- Maintain consistent caching strategy across all workflows + +No issues were found with pnpm-lock.yaml - it is valid and healthy. From 7a4e907d9bc92a2931bf6861c556e1e36f43b17e Mon Sep 17 00:00:00 2001 From: Jack Zhuang <50353452+hotlong@users.noreply.github.com> Date: Mon, 13 Apr 2026 20:40:02 +0800 Subject: [PATCH 3/3] Delete .github/CI_CACHE_AUDIT.md --- .github/CI_CACHE_AUDIT.md | 191 -------------------------------------- 1 file changed, 191 deletions(-) delete mode 100644 .github/CI_CACHE_AUDIT.md diff --git a/.github/CI_CACHE_AUDIT.md b/.github/CI_CACHE_AUDIT.md deleted file mode 100644 index cccdf807d..000000000 --- a/.github/CI_CACHE_AUDIT.md +++ /dev/null @@ -1,191 +0,0 @@ -# CI Cache Configuration Audit Report - -**Date:** 2026-04-13 -**Repository:** objectstack-ai/objectui -**Branch:** claude/check-ci-cache-processes - -## Executive Summary - -This report documents a comprehensive audit of all GitHub Actions workflow cache configurations. The audit identified and fixed several missing cache configurations that were impacting CI performance. - -### Key Findings - -- ✅ **pnpm-lock.yaml:** Valid and healthy (lockfile version 9.0, 46 importers) -- ❌ **Missing Turbo caches:** 2 jobs were missing Turbo cache configuration -- ❌ **Missing Playwright caches:** 2 jobs were installing browsers from scratch every time -- ✅ **pnpm version:** Consistently set to 10.31.0 across all workflows -- ✅ **Cache keys:** Properly scoped and consistent - -## Issues Fixed - -### 1. ci.yml - Test Job -**Problem:** Missing Turbo cache -**Impact:** Tests ran without build cache, slowing down test execution -**Fix:** Added Turbo cache configuration with proper keys - -### 2. ci.yml - E2E Job -**Problem:** Missing both Turbo cache and Playwright browser cache -**Impact:** -- No build cache for E2E tests -- Playwright browsers (~200MB) downloaded and installed every run -**Fix:** -- Added Turbo cache configuration -- Added Playwright browser cache with version-based key -- Optimized installation steps to skip browser download when cached - -### 3. storybook-tests.yml -**Problem:** Missing Playwright browser cache -**Impact:** Playwright browsers downloaded every run -**Fix:** -- Added Playwright browser cache with version-based key -- Optimized installation with conditional steps - -## Cache Configuration Details - -### Turbo Cache -**Purpose:** Caches build outputs and computation results -**Path:** `node_modules/.cache/turbo` -**Key Strategy:** -- Primary key: `turbo-${{ runner.os }}-${{ github.sha }}` -- Restore keys: `turbo-${{ runner.os }}-` - -**Workflows Using Turbo Cache:** -- ✅ ci.yml (test, build, e2e, docs) -- ✅ lint.yml -- ✅ storybook-deploy.yml -- ✅ release.yml -- ✅ performance-budget.yml -- ✅ storybook-tests.yml -- ✅ changeset-release.yml - -### pnpm Cache -**Purpose:** Caches npm packages -**Implementation:** Built into `setup-node` action with `cache: 'pnpm'` -**Path:** `~/.pnpm-store` (managed by action) - -**All workflows properly configured with pnpm cache** ✅ - -### Playwright Browser Cache -**Purpose:** Caches installed browser binaries -**Path:** `~/.cache/ms-playwright` -**Key Strategy:** `playwright-${{ runner.os }}-${{ version }}` - -**Implementation Details:** -```yaml -- name: Get Playwright version - id: playwright-version - run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT - -- name: Cache Playwright browsers - uses: actions/cache@v5 - id: playwright-cache - with: - path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} - -- name: Install Playwright browsers - if: steps.playwright-cache.outputs.cache-hit != 'true' - run: pnpm exec playwright install --with-deps chromium - -- name: Install Playwright system dependencies - if: steps.playwright-cache.outputs.cache-hit == 'true' - run: pnpm exec playwright install-deps chromium -``` - -**Workflows Using Playwright Cache:** -- ✅ ci.yml (e2e job) -- ✅ storybook-tests.yml - -## Performance Impact - -### Before Optimization -- Test job: No build cache -- E2E job: No build cache + ~200MB browser download every run -- Storybook tests: ~200MB browser download every run - -### After Optimization -- Test job: Turbo cache enables incremental builds/tests -- E2E job: Build cache + browser cache (browser download only on version change) -- Storybook tests: Browser cache (browser download only on version change) - -**Estimated Time Savings:** -- Browser downloads: ~2-3 minutes per workflow run (when cached) -- Build cache: Variable, depends on changes (typically 30s-2min) - -## Lockfile Health Check - -``` -✅ pnpm-lock.yaml is valid YAML -✅ Lockfile version: 9.0 -✅ Total importers: 46 -✅ No YAML document separator issues -✅ No corruption detected -``` - -**Note on Error in Problem Statement:** -The error mentioned in the original issue appears to have been a transient problem, possibly caused by: -- Concurrent git operations creating a temporary conflict -- Network interruption during a previous workflow run -- Manual editing that was later corrected - -The current lockfile is completely valid. - -## Workflows Not Requiring Additional Caching - -### shadcn-check.yml -- Only runs analysis commands -- No build/test operations -- pnpm cache sufficient - -### dependabot-auto-merge.yml -- Only validates and approves PRs -- No build operations -- pnpm cache sufficient - -### changelog.yml, labeler.yml, check-links.yml, stale.yml -- Non-build workflows -- Don't require build caching - -## Best Practices Implemented - -1. **Consistent pnpm version** (10.31.0) across all workflows -2. **Turbo cache** for all build/test jobs -3. **Playwright cache** version-scoped to avoid stale browsers -4. **Conditional installation** to skip downloads when cached -5. **System dependencies** installed separately when using cached browsers -6. **Cache keys** properly scoped by OS and version/SHA - -## Recommendations for Future - -1. **Monitor cache hit rates** in GitHub Actions to ensure caches are being used effectively -2. **Consider adding cache size limits** to prevent excessive storage usage -3. **Review cache strategy** if Playwright version changes frequently -4. **Document cache invalidation strategy** for major dependency updates - -## Files Modified - -- `.github/workflows/ci.yml` - - Added Turbo cache to test job - - Added Turbo cache to e2e job - - Added Playwright cache to e2e job with conditional installation -- `.github/workflows/storybook-tests.yml` - - Added Playwright cache with conditional installation - -## Validation - -All changes follow GitHub Actions best practices: -- ✅ Cache paths are correct for each tool -- ✅ Cache keys include appropriate scope (OS, version, SHA) -- ✅ Restore keys allow fallback to previous caches -- ✅ Conditional steps prevent unnecessary operations -- ✅ All workflows maintain pnpm version consistency - -## Conclusion - -The audit successfully identified and resolved cache configuration gaps in the CI pipeline. The improvements will: -- Reduce CI execution time -- Lower bandwidth usage -- Improve developer experience with faster feedback -- Maintain consistent caching strategy across all workflows - -No issues were found with pnpm-lock.yaml - it is valid and healthy.