Skip to content

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Nov 19, 2025

Summary

Add error state awareness to build time logging to distinguish between successful and failed builds.

  • Succeed: built in xx s
  • Failed: build failed in xx s

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 19, 2025 02:03
@netlify
Copy link

netlify bot commented Nov 19, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 7a0e2b4
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/691d2a4369af2a00088cb1ca
😎 Deploy Preview https://deploy-preview-6608--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 72 (🟢 up 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances build time logging by adding error state awareness to distinguish between successful and failed builds. When a build fails, the log message will now indicate the failure state and use the error logger instead of the ready logger.

Key Changes

  • Modified printTime function to accept a hasErrors parameter and adjust the log message and logger method accordingly
  • Moved the printTime call after error/warning message formatting to ensure proper message ordering
  • Added comprehensive test coverage for both successful and failed builds in dev and build modes

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/core/src/provider/createCompiler.ts Updated printTime function to handle error states with conditional logger and message formatting; reordered execution to print time after error messages
e2e/cases/diagnostic/build-time/src/index.js Added empty source file for successful build time test
e2e/cases/diagnostic/build-time/index.test.ts Added tests to verify build time is logged correctly for successful builds
e2e/cases/diagnostic/build-failed-time/src/index.js Added source file with invalid import to trigger build failure
e2e/cases/diagnostic/build-failed-time/index.test.ts Added tests to verify build failed time is logged correctly for failed builds

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chenjiahan chenjiahan merged commit 6f23494 into main Nov 19, 2025
11 checks passed
@chenjiahan chenjiahan deleted the build_failed_time_1119 branch November 19, 2025 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants