Skip to content

Conversation

@pilat
Copy link
Owner

@pilat pilat commented Dec 22, 2025

  • Automatically limit container logs to 10MB per service to prevent disk exhaustion
  • Services with explicit logging: config are not affected
  • Updated docs

Summary by CodeRabbit

  • New Features

    • Container logs are now limited by default to 10MB per service to help prevent disk space exhaustion.
    • Services without explicit logging configuration automatically inherit this default.
  • Documentation

    • Added guidance on log size limits and how to override the default via compose logging settings.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Walkthrough

Adds a default LoggingConfig (max-size=10m, max-file=1) to services that lack explicit logging during project initialization; documents the default and how to override it in docs.

Changes

Cohort / File(s) Summary
Documentation
docs/index.md, docs/logs.md
New sections describing the "Sensible Defaults" and "Log Size Limits" with a 10MB per-service default and example showing how to override via logging.max-size in docker-compose.yaml.
Default logging implementation
internal/project/project.go
Added applyDefaultLogging(p *Project) error that sets LoggingConfig{max-size: "10m", max-file: 1} on services missing logging, and invoked it during New project initialization before label application.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify applyDefaultLogging is invoked at the correct point in New and does not overwrite existing LoggingConfig values.
  • Confirm the logging config representation and units ("10m") match the code that serializes/consumes logging settings.
  • Check error handling and nil-pointer safety when iterating services and assigning the default.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: default log size per service' directly and clearly describes the main change: implementing a default 10MB log size limit per service to prevent disk exhaustion.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/default-log-size

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@pilat pilat self-assigned this Dec 22, 2025
Copy link

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8adaa67 and f978c8b.

📒 Files selected for processing (3)
  • docs/index.md
  • docs/logs.md
  • internal/project/project.go
🧰 Additional context used
📓 Path-based instructions (2)
internal/**/*.go

⚙️ CodeRabbit configuration file

internal/**/*.go: Core packages providing project functionality:

  • project/: Project configuration, Docker Compose extensions (x-devbox-*)
  • manager/: Project/service autodetection from current directory
  • git/: Git operations (clone, sparse checkout, sync)
  • cert/: SSL certificate generation
  • hosts/: /etc/hosts management with project-scoped markers
  • table/: CLI table output formatting

Review for:

  • Clean interfaces and proper encapsulation
  • Error wrapping with context
  • No interface{} - use 'any' instead (enforced by linter)
  • YAGNI principle - no speculative features or premature abstractions
  • Security considerations for host file and certificate operations

Files:

  • internal/project/project.go
internal/project/**/*.go

⚙️ CodeRabbit configuration file

internal/project/**/*.go: Project configuration extending Docker Compose with x-devbox extensions:

  • x-devbox-sources: Repository definitions with branch and sparse checkout
  • x-devbox-scenarios: Named command shortcuts
  • x-devbox-hosts: /etc/hosts entries
  • x-devbox-cert: SSL certificate domains

State is persisted in .devboxstate JSON file.
Mount system replaces volume binds with local paths.

Review for proper parsing and validation of compose extensions.

Files:

  • internal/project/project.go
⏰ 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: E2E Tests
🔇 Additional comments (2)
docs/index.md (1)

39-40: LGTM!

Documentation accurately reflects the implemented default logging behavior and clearly explains the benefit.

internal/project/project.go (1)

95-95: Correct pipeline position.

Placing applyDefaultLogging after configuration loading and before label application is appropriate.

@pilat pilat force-pushed the feat/default-log-size branch from f978c8b to d246a10 Compare December 22, 2025 09:43
Copy link

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f978c8b and d246a10.

📒 Files selected for processing (3)
  • docs/index.md
  • docs/logs.md
  • internal/project/project.go
🧰 Additional context used
📓 Path-based instructions (2)
internal/**/*.go

⚙️ CodeRabbit configuration file

internal/**/*.go: Core packages providing project functionality:

  • project/: Project configuration, Docker Compose extensions (x-devbox-*)
  • manager/: Project/service autodetection from current directory
  • git/: Git operations (clone, sparse checkout, sync)
  • cert/: SSL certificate generation
  • hosts/: /etc/hosts management with project-scoped markers
  • table/: CLI table output formatting

Review for:

  • Clean interfaces and proper encapsulation
  • Error wrapping with context
  • No interface{} - use 'any' instead (enforced by linter)
  • YAGNI principle - no speculative features or premature abstractions
  • Security considerations for host file and certificate operations

Files:

  • internal/project/project.go
internal/project/**/*.go

⚙️ CodeRabbit configuration file

internal/project/**/*.go: Project configuration extending Docker Compose with x-devbox extensions:

  • x-devbox-sources: Repository definitions with branch and sparse checkout
  • x-devbox-scenarios: Named command shortcuts
  • x-devbox-hosts: /etc/hosts entries
  • x-devbox-cert: SSL certificate domains

State is persisted in .devboxstate JSON file.
Mount system replaces volume binds with local paths.

Review for proper parsing and validation of compose extensions.

Files:

  • internal/project/project.go
🪛 markdownlint-cli2 (0.18.1)
docs/logs.md

30-30: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


33-33: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


36-36: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


39-39: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

docs/index.md

39-39: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

⏰ 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: E2E Tests
🔇 Additional comments (2)
docs/logs.md (1)

30-43: Documentation is clear and complete.

The new "Log Size Limits" section accurately describes the 10MB default and provides a complete override example including the driver field. This addresses the previous review feedback.

internal/project/project.go (1)

95-95: Correct placement in initialization pipeline.

Applying default logging after configuration loading but before labels ensures services without explicit logging configuration receive the 10MB limit default.

@pilat pilat merged commit bae7621 into main Dec 22, 2025
3 checks passed
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.

2 participants