Skip to content

chore: some updates#10

Merged
hmbanan666 merged 3 commits into
mainfrom
update
Jul 18, 2025
Merged

chore: some updates#10
hmbanan666 merged 3 commits into
mainfrom
update

Conversation

@hmbanan666
Copy link
Copy Markdown
Collaborator

@hmbanan666 hmbanan666 commented Jul 18, 2025

Summary by CodeRabbit

  • Chores
    • Updated Docker build process for improved environment variable handling and browser binary copying.
    • Adjusted health check script to use a new endpoint for status checks.

@hmbanan666 hmbanan666 self-assigned this Jul 18, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 18, 2025

Warning

Rate limit exceeded

@hmbanan666 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 28 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 004e808 and 093b51f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • apps/web-parser/package.json (0 hunks)
  • docker/web-parser/Dockerfile (2 hunks)
  • pnpm-workspace.yaml (0 hunks)

Walkthrough

The Dockerfile for the web-parser service was updated to set the Playwright browser path environment variable earlier and streamline the copying of browser binaries between build stages. The health check script was also changed to query a different endpoint, updating the URL from /health to /api/health.

Changes

File(s) Change Summary
docker/web-parser/Dockerfile Set PLAYWRIGHT_BROWSERS_PATH earlier; changed browser binaries copy path; removed redundant ENV.
docker/web-parser/health-check.sh Changed health check URL from /health to /api/health.

Sequence Diagram(s)

sequenceDiagram
    participant HealthCheckScript as health-check.sh
    participant WebParserService as web-parser (localhost:3000)
    HealthCheckScript->>WebParserService: GET /api/health
    WebParserService-->>HealthCheckScript: 200 OK or error
Loading

Possibly related PRs

  • sushi-love/roll-stack#9: Also modifies the health-check script's endpoint, but in the opposite direction.
  • sushi-love/roll-stack#5: Introduces the web-parser service, including its Dockerfile and health-check logic, directly relating to these files.
  • sushi-love/roll-stack#8: Alters Playwright cache handling in the Dockerfile, similar to the changes in this PR.

Poem

In Docker’s warren, paths realigned,
Playwright’s cache, now better defined.
Health checks hop to a brand new gate,
/api/health—no time to wait!
With scripts refreshed and builds anew,
This bunny’s code is swift and true.
🐇✨


🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

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

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link
Copy Markdown

@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)
docker/web-parser/Dockerfile (1)

2-2: Environment variable placement looks good – consider also skipping browser re-downloads.

Defining PLAYWRIGHT_BROWSERS_PATH in the base stage is spot-on.
To shave ~40 MB and avoid any surprise network calls during later pnpm i/node invocations, it’s usually worth adding:

ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1

right next to this line. The builder stage already ships the browsers, so forcing Playwright to skip the download is safe and speeds up CI/CD.

docker/web-parser/health-check.sh (1)

2-2: Harden the health-check curl invocation.

Minor robustness tweaks:

-curl -f http://localhost:3000/api/health || exit 1
+curl --fail --silent --show-error --max-time 3 http://localhost:3000/api/health || exit 1

--silent --show-error removes noise while still surfacing real issues.
--max-time 3 prevents the container from hanging if the service half-opens a socket.
• Behaviour otherwise identical (non-200 ⇒ exit 1).
Feel free to ignore if the current script already meets your SLOs.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e0c6fc and 004e808.

📒 Files selected for processing (2)
  • docker/web-parser/Dockerfile (2 hunks)
  • docker/web-parser/health-check.sh (1 hunks)

COPY --from=builder /root/.cache/ms-playwright /opt/ms-playwright
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright

COPY --from=builder /opt/ms-playwright /opt/ms-playwright
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

COPY as non-root to prevent permission quirks.

All files under /opt/ms-playwright are currently owned by root.
Running the app as appuser works for read-only access, but Playwright occasionally writes temporary data (e.g., user-data-dir). A safer pattern is:

-COPY --from=builder /opt/ms-playwright /opt/ms-playwright
+COPY --chown=appuser:appgroup --from=builder /opt/ms-playwright /opt/ms-playwright

That keeps the container 100 % read-/write consistent and avoids subtle “permission denied” crashes when upgrading Playwright in the future.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
COPY --from=builder /opt/ms-playwright /opt/ms-playwright
COPY --chown=appuser:appgroup --from=builder /opt/ms-playwright /opt/ms-playwright
🤖 Prompt for AI Agents
In docker/web-parser/Dockerfile at line 21, the COPY command copies files owned
by root, causing permission issues when the app runs as a non-root user. To fix
this, copy the files as the non-root user or adjust ownership after copying so
that /opt/ms-playwright and its contents are owned by the appuser. This ensures
consistent read/write permissions and prevents permission denied errors during
runtime.

@sonarqubecloud
Copy link
Copy Markdown

@hmbanan666 hmbanan666 merged commit 43dd52f into main Jul 18, 2025
8 checks passed
@hmbanan666 hmbanan666 deleted the update branch July 18, 2025 14:09
@coderabbitai coderabbitai Bot mentioned this pull request Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant