Skip to content

feat: web-parser as service#5

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

feat: web-parser as service#5
hmbanan666 merged 3 commits into
mainfrom
parser

Conversation

@hmbanan666
Copy link
Copy Markdown
Collaborator

@hmbanan666 hmbanan666 commented Jul 18, 2025

Summary by CodeRabbit

  • New Features

    • Added Docker support for the "web-parser" application, including a dedicated Dockerfile and health check script.
    • Introduced a health check API endpoint for the "web-parser" service to report operational status.
    • Deployed the "web-parser" application with a new Kubernetes deployment and secret configuration.
  • Chores

    • Updated nightly and release build workflows to include the "web-parser" application in automated processes.

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

coderabbitai Bot commented Jul 18, 2025

Walkthrough

The changes introduce support for a new application, "web-parser," across CI workflows and Docker infrastructure. A dedicated Dockerfile and health check script are added for "web-parser." The server's health check route is implemented, replacing a previous static endpoint, and workflows are updated to recognize and process the new app.

Changes

Files/Paths Change Summary
.github/workflows/docker-nightly.yml,
.github/workflows/docker-release.yml
Updated CI workflows to include "web-parser" in the list of recognized apps for build and release processes.
apps/web-parser/server/routes/health.get.ts Added a health check GET route handler that verifies repository health and returns a JSON status.
apps/web-parser/server/routes/index.ts Removed a static health check endpoint that always returned { ok: true }.
docker/web-parser/Dockerfile Added a new multi-stage Dockerfile for building and running the "web-parser" Node.js application.
docker/web-parser/health-check.sh Added a shell script to perform HTTP health checks for the "web-parser" service.
k8s/web-parser/deployment.yaml Added a Kubernetes Deployment manifest for the "web-parser" application with security, probes, and resources.
k8s/web-parser/secret.yaml Added a Kubernetes Secret manifest for the "web-parser" application containing a DATABASE_URL key.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Web-Parser Server
    participant Repository
    participant ErrorResolver

    Client->>Web-Parser Server: GET /api/health
    Web-Parser Server->>Repository: checkHealth()
    alt Success
        Repository-->>Web-Parser Server: Health OK
        Web-Parser Server-->>Client: { ok: true }
    else Error
        Repository-->>Web-Parser Server: Error
        Web-Parser Server->>ErrorResolver: resolve(error)
        ErrorResolver-->>Web-Parser Server: throws resolved error
        Web-Parser Server-->>Client: Error Response
    end
Loading

Poem

In the warren of code, a parser appears,
With Docker and scripts, it conquers new frontiers.
Health checks abound, so robust and so bright,
The workflows now spot it each day and each night.
🐇 Hopping with joy, this rabbit declares:
"Web-parser is live! Deploy if you dare!"


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5028edb and 5dcd0d1.

📒 Files selected for processing (3)
  • docker/web-parser/Dockerfile (1 hunks)
  • k8s/web-parser/deployment.yaml (1 hunks)
  • k8s/web-parser/secret.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • k8s/web-parser/secret.yaml
  • docker/web-parser/Dockerfile
  • k8s/web-parser/deployment.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

🪧 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: 2

🧹 Nitpick comments (1)
docker/web-parser/Dockerfile (1)

1-3: Consider the high memory allocation setting.

The 4GB memory allocation seems quite high for a typical web parser service. Consider if this is actually needed or if it could be reduced for better resource efficiency.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 51dee73 and 5028edb.

📒 Files selected for processing (6)
  • .github/workflows/docker-nightly.yml (1 hunks)
  • .github/workflows/docker-release.yml (1 hunks)
  • apps/web-parser/server/routes/health.get.ts (1 hunks)
  • apps/web-parser/server/routes/index.ts (0 hunks)
  • docker/web-parser/Dockerfile (1 hunks)
  • docker/web-parser/health-check.sh (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/web-parser/server/routes/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (4)
docker/web-parser/health-check.sh (1)

1-2: LGTM! Clean and effective health check implementation.

The script follows Docker health check best practices with proper error handling using the -f flag and explicit exit codes.

.github/workflows/docker-release.yml (1)

36-36: LGTM! Consistent addition of web-parser to release workflow.

The change properly extends the release workflow to support the new web-parser service while maintaining consistency with existing applications.

.github/workflows/docker-nightly.yml (1)

29-29: LGTM! Consistent addition of web-parser to nightly workflow.

The change maintains consistency with the release workflow and properly enables nightly builds for the new web-parser service.

docker/web-parser/Dockerfile (1)

20-28: LGTM! Excellent security practices implemented.

The Dockerfile properly implements security best practices by:

  • Copying built artifacts from builder stage
  • Creating and using a non-root user
  • Making the health check script executable
  • Following the principle of least privilege

Comment on lines +1 to +11
import { repository } from '@roll-stack/database'

export default defineEventHandler(async () => {
try {
await repository.checkHealth()

return { ok: true }
} catch (error) {
throw errorResolver(error)
}
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix missing imports for runtime functions.

The code uses defineEventHandler and errorResolver without importing them, which will cause runtime errors.

Apply this diff to add the missing imports:

 import { repository } from '@roll-stack/database'
+import { defineEventHandler, errorResolver } from '#imports'

Alternatively, if these are auto-imported in your framework, consider adding explicit imports for better code clarity and IDE support.

📝 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
import { repository } from '@roll-stack/database'
export default defineEventHandler(async () => {
try {
await repository.checkHealth()
return { ok: true }
} catch (error) {
throw errorResolver(error)
}
})
import { repository } from '@roll-stack/database'
import { defineEventHandler, errorResolver } from '#imports'
export default defineEventHandler(async () => {
try {
await repository.checkHealth()
return { ok: true }
} catch (error) {
throw errorResolver(error)
}
})
🤖 Prompt for AI Agents
In apps/web-parser/server/routes/health.get.ts lines 1 to 11, the functions
defineEventHandler and errorResolver are used but not imported, causing runtime
errors. Fix this by adding explicit import statements for defineEventHandler and
errorResolver from their respective modules at the top of the file to ensure
they are properly recognized and avoid runtime failures.

Comment thread docker/web-parser/Dockerfile Outdated
@sonarqubecloud
Copy link
Copy Markdown

@hmbanan666 hmbanan666 merged commit 2801910 into main Jul 18, 2025
8 checks passed
@hmbanan666 hmbanan666 deleted the parser branch July 18, 2025 08:40
This was referenced 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