Skip to content

Add Turbo for Faster Compilation, Testing, and Build Times#1415

Merged
arkid15r merged 5 commits intoOWASP:mainfrom
Rajgupta36:main
Apr 23, 2025
Merged

Add Turbo for Faster Compilation, Testing, and Build Times#1415
arkid15r merged 5 commits intoOWASP:mainfrom
Rajgupta36:main

Conversation

@Rajgupta36
Copy link
Contributor

This PR integrates Turbo to significantly improve compilation, testing, and build times across the project.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 23, 2025

Summary by CodeRabbit

  • New Features

    • Added a new build script to support Turbo mode for faster builds.
    • Introduced new development dependencies for improved server-side package handling.
    • Enhanced server configuration with external package and custom extension resolution support, including .yaml.
  • Chores

    • Added and updated configuration files to support pnpm settings across build and test environments.
    • Expanded the custom dictionary for spell checking with additional terms.
    • Streamlined Dockerfile commands for more efficient builds.

Summary by CodeRabbit

  • New Features

    • Enhanced build and runtime configuration to support custom module resolution extensions and external server packages.
    • Turbo mode enabled for development and build scripts.
  • Chores

    • Added .pnpmrc configuration for consistent package management.
    • Updated Dockerfiles to include .pnpmrc and streamlined file copying.
    • Expanded custom dictionary for improved spell checking.
    • Added new development dependencies for module instrumentation.

Walkthrough

This set of changes introduces configuration and dependency updates for the frontend project. A .pnpmrc file is added to control pnpm's behavior, and corresponding Dockerfiles are updated to ensure this configuration is present in build and test environments. The Next.js configuration is extended to include Turbopack settings and external server packages. The package.json scripts are modified to use Turbo mode, and new development dependencies related to module interception are added. Additionally, the custom spell-check dictionary is expanded with two new terms relevant to the updated tooling.

Changes

Files/Group Change Summary
cspell/custom-dict.txt Added "pnpmrc" and "turbopack" to the custom spell-check dictionary.
frontend/.pnpmrc Introduced a new pnpm configuration file setting save-exact, legacy-peer-deps, and public-hoist-pattern.
frontend/docker/Dockerfile,
frontend/docker/Dockerfile.e2e.test,
frontend/docker/Dockerfile.unit.test
Updated Dockerfiles to copy the .pnpmrc file into the container; consolidated COPY commands in the unit test Dockerfile for efficiency; adjusted formatting in Dockerfile.
frontend/next.config.ts Extended Next.js config to include a turbopack section with custom resolve extensions and a serverExternalPackages array for externalizing specific modules; reordered devIndicators property.
frontend/package.json Updated dev and added build:turbo scripts using the --turbo flag; added import-in-the-middle and require-in-the-middle as development dependencies.
frontend/playwright.config.ts Changed Playwright web server build command to use pnpm run build:turbo.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d88bca5 and f479b36.

📒 Files selected for processing (6)
  • frontend/docker/Dockerfile (2 hunks)
  • frontend/docker/Dockerfile.e2e.test (1 hunks)
  • frontend/docker/Dockerfile.unit.test (1 hunks)
  • frontend/next.config.ts (2 hunks)
  • frontend/package.json (2 hunks)
  • frontend/playwright.config.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • frontend/docker/Dockerfile
  • frontend/playwright.config.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • frontend/package.json
  • frontend/next.config.ts
  • frontend/docker/Dockerfile.unit.test
  • frontend/docker/Dockerfile.e2e.test
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: Run backend tests
  • GitHub Check: Run frontend unit tests
  • GitHub Check: CodeQL (python)
  • GitHub Check: CodeQL (javascript-typescript)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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.

Documentation and Community

  • 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.

@github-actions github-actions bot added frontend docker Pull requests that update Docker code labels Apr 23, 2025
Copy link
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: 1

🧹 Nitpick comments (2)
frontend/docker/Dockerfile.unit.test (1)

13-13: Approve consolidated COPY with .pnpmrc
Combining the COPY commands reduces image layers and ensures .pnpmrc is available for unit-test installations.

Optional: For consistency with other Dockerfiles, consider adding --chmod=444 to protect config files from modification.

frontend/next.config.ts (1)

10-10: Consider adding a comment explaining the externalized packages

The externalization of 'import-in-the-middle' and 'require-in-the-middle' packages is correct, but it would be helpful to add a brief comment explaining why these specific packages need to be treated as external server packages. This would improve code maintainability.

-  serverExternalPackages: ['import-in-the-middle', 'require-in-the-middle'],
+  // These packages are used for module interception and need to be treated as external on the server
+  serverExternalPackages: ['import-in-the-middle', 'require-in-the-middle'],
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd7b995 and d248cea.

⛔ Files ignored due to path filters (1)
  • frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • cspell/custom-dict.txt (2 hunks)
  • frontend/.pnpmrc (1 hunks)
  • frontend/docker/Dockerfile (2 hunks)
  • frontend/docker/Dockerfile.e2e.test (1 hunks)
  • frontend/docker/Dockerfile.unit.test (1 hunks)
  • frontend/next.config.ts (1 hunks)
  • frontend/package.json (2 hunks)
🔇 Additional comments (9)
cspell/custom-dict.txt (2)

80-80: Approve addition of 'pnpmrc'
Adding 'pnpmrc' to the custom dictionary prevents false-positive spellcheck errors for the new .pnpmrc file.


99-99: Approve addition of 'turbopack'
Including 'turbopack' ensures the custom dictionary recognizes the new Turbo mode configuration term.

frontend/docker/Dockerfile (2)

14-14: Approve copying of .pnpmrc in build stage
Including .pnpmrc alongside other config files ensures consistent pnpm behavior during image builds.


31-31: Skip: minor formatting change
The indentation update for adduser simply aligns it under the previous addgroup command. No action required.

frontend/package.json (3)

6-7: Approve Turbo flags in scripts
Enabling --turbo for dev and build scripts correctly activates Turbopack mode. Please also verify that any project documentation (e.g., README) is updated to reflect these new commands.


94-94: Approve import-in-the-middle devDependency
Adding import-in-the-middle aligns with the serverExternalPackages configuration. Confirm it is only used at development/runtime interception and appropriately scoped as a devDependency.


102-102: Approve require-in-the-middle devDependency
Including require-in-the-middle complements the pnpm hoisting pattern and external package settings. Ensure it loads correctly in the server context.

frontend/docker/Dockerfile.e2e.test (1)

13-13: LGTM - Proper inclusion of .pnpmrc configuration file

Adding the .pnpmrc file to the Docker build correctly ensures that the e2e test environment uses the same pnpm configuration as other environments. This is essential for the Turbo integration to work consistently across all containerized environments.

frontend/next.config.ts (1)

7-9: Good configuration of Turbopack with file extensions

The Turbopack configuration with explicit file extensions looks good and will help optimize module resolution during builds. This is a key part of improving compilation speed as mentioned in the PR objectives.

@sonarqubecloud
Copy link

@arkid15r arkid15r enabled auto-merge April 23, 2025 23:19
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@arkid15r arkid15r moved this to In progress in Project Nest Apr 23, 2025
@arkid15r arkid15r added this pull request to the merge queue Apr 23, 2025
Merged via the queue into OWASP:main with commit e26c97e Apr 23, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Project Nest Apr 23, 2025
shdwcodr pushed a commit to shdwcodr/Nest that referenced this pull request Jun 5, 2025
* added turbo for improving build speed

* update

* rm dup

* Update code

---------

Co-authored-by: Arkadii Yakovets <arkadii.yakovets@owasp.org>
@coderabbitai coderabbitai bot mentioned this pull request Sep 29, 2025
2 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 7, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Pull requests that update Docker code frontend

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants

Comments