Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Aug 13, 2025

Link issues

fixes #6614

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Enable PuppeteerSharp support in the Docker setup by installing Google Chrome and required fonts, updating the build process, and adjusting CI triggers

Enhancements:

  • Install Google Chrome and Chinese fonts in the Docker image for headless browser support
  • Change exposed container port from 80 to 8080
  • Add a dotnet build step in the Docker build pipeline before publishing

CI:

  • Add “docker” branch to Docker workflow triggers

@bb-auto bb-auto bot added the chore This are tasks or bot action label Aug 13, 2025
@bb-auto bb-auto bot added this to the 9.9.0 milestone Aug 13, 2025
@ArgoZhang ArgoZhang merged commit 2040c95 into main Aug 13, 2025
6 checks passed
@ArgoZhang ArgoZhang deleted the docker branch August 13, 2025 01:20
Copy link
Contributor

sourcery-ai bot commented Aug 13, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR configures the Docker environment and CI workflow to support PuppeteerSharp by installing Chrome and necessary fonts, adjusting ports, adding a build step, updating workflow triggers, and introducing the PuppeteerSharp dependency.

Class diagram for PuppeteerSharp dependency addition

classDiagram
    class BootstrapBlazor {
    }
    class PuppeteerSharp {
    }
    BootstrapBlazor --> PuppeteerSharp : uses
    PuppeteerSharp : +Google Chrome dependency
    PuppeteerSharp : +Font support
    PuppeteerSharp : +Headless browser automation
Loading

File-Level Changes

Change Details Files
Configure Docker base image for PuppeteerSharp support
  • Expose port 8080 instead of 80
  • Install wget via apt
  • Download and install Google Chrome
  • Remove Chrome .deb after installation
  • Install Chinese font package
src/BootstrapBlazor.Server/Dockerfile
Ensure build step runs before publish in Docker build stage
  • Add dotnet build before dotnet publish
src/BootstrapBlazor.Server/Dockerfile
Extend CI workflow triggers to include docker branch
  • Add docker branch to workflow on.branches list
.github/workflows/docker.yml
Add PuppeteerSharp dependency
  • Introduce PuppeteerSharp package reference to project file
src/BootstrapBlazor/BootstrapBlazor.csproj

Assessment against linked issues

Issue Objective Addressed Explanation
#6614 Add PuppeteerSharp support to the Docker environment for the project.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7504bbd) to head (23a622c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #6615   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          739       739           
  Lines        31672     31672           
  Branches      4458      4458           
=========================================
  Hits         31672     31672           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @ArgoZhang - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/BootstrapBlazor.Server/Dockerfile:10` </location>
<code_context>
+
+RUN apt-get update && apt-get install -y wget
+RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+RUN apt install -y ./google-chrome-stable_current_amd64.deb
+RUN rm ./google-chrome-stable_current_amd64.deb
+RUN apt install -y fonts-wqy-microhei
</code_context>

<issue_to_address>
Installing Chrome via a downloaded .deb may introduce dependency issues if not handled explicitly.

Add 'apt-get -f install' after installing the .deb to automatically resolve any missing dependencies.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
RUN apt install -y ./google-chrome-stable_current_amd64.deb
RUN rm ./google-chrome-stable_current_amd64.deb
=======
RUN apt install -y ./google-chrome-stable_current_amd64.deb
RUN apt-get -f install -y
RUN rm ./google-chrome-stable_current_amd64.deb
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `src/BootstrapBlazor.Server/Dockerfile:20` </location>
<code_context>

 WORKDIR "src/BootstrapBlazor.Server"
 FROM build AS publish
+RUN dotnet build
 RUN dotnet publish -c Release -o /app

</code_context>

<issue_to_address>
Running 'dotnet build' before 'dotnet publish' may be redundant.

Consider removing the separate 'dotnet build' step to simplify the process, as 'dotnet publish' already includes a build.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
WORKDIR "src/BootstrapBlazor.Server"
FROM build AS publish
+RUN dotnet build
RUN dotnet publish -c Release -o /app
=======
WORKDIR "src/BootstrapBlazor.Server"
FROM build AS publish
RUN dotnet publish -c Release -o /app
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +10 to +11
RUN apt install -y ./google-chrome-stable_current_amd64.deb
RUN rm ./google-chrome-stable_current_amd64.deb
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (bug_risk): Installing Chrome via a downloaded .deb may introduce dependency issues if not handled explicitly.

Add 'apt-get -f install' after installing the .deb to automatically resolve any missing dependencies.

Suggested change
RUN apt install -y ./google-chrome-stable_current_amd64.deb
RUN rm ./google-chrome-stable_current_amd64.deb
RUN apt install -y ./google-chrome-stable_current_amd64.deb
RUN apt-get -f install -y
RUN rm ./google-chrome-stable_current_amd64.deb

Comment on lines 18 to 21
WORKDIR "src/BootstrapBlazor.Server"
FROM build AS publish
RUN dotnet build
RUN dotnet publish -c Release -o /app
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Running 'dotnet build' before 'dotnet publish' may be redundant.

Consider removing the separate 'dotnet build' step to simplify the process, as 'dotnet publish' already includes a build.

Suggested change
WORKDIR "src/BootstrapBlazor.Server"
FROM build AS publish
RUN dotnet build
RUN dotnet publish -c Release -o /app
WORKDIR "src/BootstrapBlazor.Server"
FROM build AS publish
RUN dotnet publish -c Release -o /app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore This are tasks or bot action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore(Docker): add pupeteersharp support
1 participant