Skip to content

perf: Turborepo caching for app-store CLI build#23515

Merged
emrysal merged 6 commits intomainfrom
devin/app-store-turbo-cache-1756820416
Sep 3, 2025
Merged

perf: Turborepo caching for app-store CLI build#23515
emrysal merged 6 commits intomainfrom
devin/app-store-turbo-cache-1756820416

Conversation

@keithwillcode
Copy link
Copy Markdown
Contributor

@keithwillcode keithwillcode commented Sep 2, 2025

What does this PR do?

Fixes Turborepo caching for the @calcom/app-store-cli#build task to improve local development experience. The build previously took ~3.1 seconds on every run due to caching being disabled and incorrect configuration. With these changes, subsequent builds with unchanged inputs complete almost instantly via cache hits.

Key Changes:

  • ✅ Enabled caching by removing cache: false
  • ✅ Fixed incorrect file paths from ../../app-store/** to ../../packages/app-store/**
  • ✅ Added all 11 generated files to outputs array (was only 2 before)
  • ✅ Replaced broad glob inputs with specific patterns to prevent cache invalidation from generated files

Performance Impact:

  • Cache miss: ~3.1 seconds (when inputs change)
  • Cache hit: <1 second (when inputs unchanged)

How should this be tested?

Local Testing

# Test cache miss (first build)
time yarn app-store:build

# Test cache hit (second build, should be much faster)  
time yarn app-store:build

# Test cache invalidation
touch packages/app-store/*/package.json
time yarn app-store:build

Verification Points

  1. Generated files: Verify all 11 files are created in packages/app-store/:

    • analytics.services.generated.ts
    • apps.metadata.generated.ts
    • apps.server.generated.ts
    • apps.browser.generated.tsx
    • apps.schemas.generated.ts
    • apps.keys-schemas.generated.ts
    • bookerApps.metadata.generated.ts
    • crm.apps.generated.ts
    • calendar.services.generated.ts
    • payment.services.generated.ts
    • video.adapters.generated.ts
  2. Cache behavior: Use yarn turbo build --filter=@calcom/app-store-cli --verbosity=2 to verify cache hits/misses

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

N/A - This is a build configuration change that doesn't require documentation updates.

Checklist

  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings
  • This is a configuration-only change with no functional code modifications

Link to Devin run: https://app.devin.ai/sessions/940987ca48bc4adab1b2771f7a8dc12c
Requested by: @keithwillcode

⚠️ Review Focus Areas

  1. Path correctness: Verify ../../packages/app-store/** paths are correct vs original ../../app-store/**
  2. Input coverage: Check that the specific input patterns capture all files that should trigger cache invalidation
  3. Generated files completeness: Confirm all 11 output files match what the CLI actually generates
  4. Environment variable impact: Verify NEXT_PUBLIC_IS_E2E dependency doesn't cause unintended side effects

- Fix incorrect output paths from app-store/ to packages/app-store/
- Fix incorrect input paths to match actual file locations
- Remove cache: false to enable caching
- Add all 11 generated files to outputs array
- Add NEXT_PUBLIC_IS_E2E env var for proper cache invalidation
- Add specific input patterns to avoid cache invalidation from generated files
- Improves local dev experience with cache hits vs ~3.1s cache misses

Performance improvement: builds go from ~3.1 seconds (cache miss) to
instant cache hits when inputs haven't changed.

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 2, 2025

Warning

Rate limit exceeded

@keithwillcode has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 16 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7e6d64c and bb9396e.

📒 Files selected for processing (1)
  • turbo.json (1 hunks)

Walkthrough

  • In package.json, the script app-store:build now runs "yarn turbo build --filter=@calcom/app-store-cli" instead of "yarn app-store-cli build".
  • In turbo.json, the @calcom/app-store-cli#build target was redefined:
    • Removed cache: false.
    • Expanded inputs to cover multiple app-store subpaths and app-store-cli/src.
    • Expanded outputs to a broader set of generated files (analytics, apps, bookerApps, crm, calendar, payment, video).
    • Added env: NEXT_PUBLIC_IS_E2E.

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/app-store-turbo-cache-1756820416

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@keithwillcode keithwillcode marked this pull request as ready for review September 3, 2025 00:21
@vercel
Copy link
Copy Markdown

vercel bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Sep 3, 2025 0:30am
cal-eu Ignored Ignored Sep 3, 2025 0:30am

@keithwillcode keithwillcode requested a review from a team as a code owner September 3, 2025 00:21
@dosubot dosubot bot added app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar 🧹 Improvements Improvements to existing features. Mostly UX/UI labels Sep 3, 2025
joeauyeung
joeauyeung previously approved these changes Sep 3, 2025
volnei
volnei previously approved these changes Sep 3, 2025
@keithwillcode keithwillcode dismissed stale reviews from volnei and joeauyeung via 982b400 September 3, 2025 00:24
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
turbo.json (3)

470-478: Consider adding root-level entry files to inputs to avoid stale caches

If the generator consumes each app’s root entry (commonly index.ts/tsx/js) for metadata, changes there won’t currently invalidate the cache. Add these patterns:

       "inputs": [
         "../../packages/app-store/**/package.json",
         "../../packages/app-store/**/config.json",
+        "../../packages/app-store/**/index.ts",
+        "../../packages/app-store/**/index.tsx",
+        "../../packages/app-store/**/index.js",
         "../../packages/app-store/**/api/**",
         "../../packages/app-store/**/components/**",
         "../../packages/app-store/**/lib/**",
         "../../packages/app-store/**/pages/**",
         "../../packages/app-store-cli/src/**"
       ],

Please confirm whether the CLI reads root-level entry files; if not, feel free to ignore this.


470-478: Inputs set is appropriately specific (good) — excluding static assets is fine

Given Cal.com’s separate copy script for app-store static assets, it’s correct not to include packages/app-store/**/static/** here; those shouldn’t affect codegen cache keys.

Optional: shorten paths to ../app-store/** (from the CLI workspace) for readability; functionally identical.


492-492: Redundant env entry; already covered by globalEnv

NEXT_PUBLIC_IS_E2E is in globalEnv, so this per-task env is unnecessary. Remove to reduce duplication.

       ],
-      "env": ["NEXT_PUBLIC_IS_E2E"]
+      
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a1fab0e and 7e6d64c.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • turbo.json (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: calcom/cal.com#0
File: AGENTS.md:0-0
Timestamp: 2025-09-02T12:29:32.584Z
Learning: Use `yarn build` to build all packages
Learnt from: saurabhraghuvanshii
PR: calcom/cal.com#23460
File: packages/app-store/paypal/components/PaypalPaymentComponent.tsx:55-55
Timestamp: 2025-08-30T00:30:44.208Z
Learning: Cal.com uses a build-time script `apps/web/scripts/copy-app-store-static.js` that automatically copies static assets from `packages/app-store/**/static/**/*` to `apps/web/public/app-store/` during both development and build processes.
📚 Learning: 2025-09-02T12:29:32.584Z
Learnt from: CR
PR: calcom/cal.com#0
File: AGENTS.md:0-0
Timestamp: 2025-09-02T12:29:32.584Z
Learning: Use `yarn build` to build all packages

Applied to files:

  • package.json
📚 Learning: 2025-08-30T00:30:44.208Z
Learnt from: saurabhraghuvanshii
PR: calcom/cal.com#23460
File: packages/app-store/paypal/components/PaypalPaymentComponent.tsx:55-55
Timestamp: 2025-08-30T00:30:44.208Z
Learning: Cal.com uses a build-time script `apps/web/scripts/copy-app-store-static.js` that automatically copies static assets from `packages/app-store/**/static/**/*` to `apps/web/public/app-store/` during both development and build processes.

Applied to files:

  • package.json
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Install dependencies / Yarn install & cache
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
package.json (1)

19-19: Approve switching to Turbo for app-store builds
Confirmed that @calcom/app-store-cli exposes a build script (packages/app-store-cli/package.json: line 11). Update any docs or CI steps still invoking yarn app-store-cli build.

turbo.json (1)

480-491: All 11 generated artifacts verified present
All expected files were found after a cache-miss build—no missing outputs.

Copy link
Copy Markdown
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀

@keithwillcode keithwillcode changed the title feat: fix Turborepo caching for app-store CLI build perf: fix Turborepo caching for app-store CLI build Sep 3, 2025
@emrysal emrysal enabled auto-merge (squash) September 3, 2025 00:37
@keithwillcode keithwillcode changed the title perf: fix Turborepo caching for app-store CLI build perf: Turborepo caching for app-store CLI build Sep 3, 2025
Copy link
Copy Markdown
Contributor

@hbjORbj hbjORbj left a comment

Choose a reason for hiding this comment

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

lets goo

Copy link
Copy Markdown
Contributor

@hbjORbj hbjORbj left a comment

Choose a reason for hiding this comment

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

lets goo

@emrysal emrysal merged commit e1def88 into main Sep 3, 2025
44 of 45 checks passed
@emrysal emrysal deleted the devin/app-store-turbo-cache-1756820416 branch September 3, 2025 00:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 3, 2025

E2E results are ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar core area: core, team members only foundation 🧹 Improvements Improvements to existing features. Mostly UX/UI ready-for-e2e size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants