Skip to content

Refactor#48

Merged
enegalan merged 10 commits into
mainfrom
refactor
Jul 12, 2026
Merged

Refactor#48
enegalan merged 10 commits into
mainfrom
refactor

Conversation

@enegalan

Copy link
Copy Markdown
Owner

No description provided.

enegalan added 7 commits July 10, 2026 02:13
- Replaced repetitive error handling code with a new `writeRuntimeOrFail` function across multiple API handlers to improve code clarity and reduce duplication.
- Introduced `WriteOK` utility function for consistent success responses in JSON format.
- Updated various API endpoints to utilize the new error handling and response functions, enhancing maintainability and readability.
… export file names

- Updated CHANGELOG to reflect improvements in error messaging for image pushes to registries, enhancing user understanding during authentication failures.
- Ensured consistency in sanitizing file names for quick and scheduled volume exports, aligning behavior across functionalities.
… sources

- Introduced new formatting commands in the Makefile for Go and Dart sources, enhancing code consistency.
- Updated CI workflow to include formatting checks for backend and UI components, ensuring adherence to style guidelines.
- Improved help output in the Makefile to include new formatting commands for better developer guidance.
…tion standards

- Updated documentation in CLAUDE.md and calf.mdc to specify that all functions and methods must include doc comments, emphasizing clarity on functionality and rationale.
- Improved comment guidelines to discourage redundancy and promote concise explanations, ensuring better code readability and maintainability.
- Added detailed comments in main.go, watchdog_unix.go, and watchdog_windows.go to clarify the purpose and behavior of key functions, enhancing overall code documentation.
- Reorganized API handlers to utilize a new `Gateway` struct, enhancing modularity and clarity in routing.
- Replaced the `Server` struct with `Gateway` for improved HTTP route management and middleware integration.
- Introduced new `handleConfig` and `handleBuilds` methods, streamlining configuration and build management endpoints.
- Removed deprecated `handlers.go` file, consolidating functionality into more focused handler files.
- Updated various API methods to leverage new response utilities from `httpkit`, improving consistency in error handling and responses.
- Introduced new handler methods for builds and configuration, streamlining the API's endpoint management.
- Reorganized existing handlers to utilize a more modular approach with the `Gateway` struct, improving routing clarity.
- Updated documentation in CLAUDE.md and calf.mdc to reflect the addition of new routing helpers and methods.
- Enhanced error handling and response consistency across various API endpoints using updated utilities from `httpkit`.
- Added detailed comments to various API structs and functions, clarifying their purpose and expected JSON payloads for endpoints.
- Introduced new utility functions for managing Docker CLI interactions and Lima VM commands, improving modularity and reusability.
- Refactored existing code to utilize constants for timeout values and job statuses, enhancing maintainability and readability.
- Streamlined error handling in volume export and migration processes, ensuring consistent status reporting and improved user feedback.
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 167 files, which is 17 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c9797269-7442-4166-a669-53b5ecc3af41

📥 Commits

Reviewing files that changed from the base of the PR and between 0454e75 and 82b908b.

📒 Files selected for processing (167)
  • .cursor/rules/calf.mdc
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • CLAUDE.md
  • Makefile
  • backend/cmd/calf/main.go
  • backend/cmd/calf/watchdog_unix.go
  • backend/cmd/calf/watchdog_windows.go
  • backend/internal/api/builds.go
  • backend/internal/api/config.go
  • backend/internal/api/containers.go
  • backend/internal/api/docker_cli.go
  • backend/internal/api/exec.go
  • backend/internal/api/gateway.go
  • backend/internal/api/handlers.go
  • backend/internal/api/health.go
  • backend/internal/api/images.go
  • backend/internal/api/logs.go
  • backend/internal/api/middleware.go
  • backend/internal/api/migrate.go
  • backend/internal/api/networks.go
  • backend/internal/api/registry.go
  • backend/internal/api/registry_login.go
  • backend/internal/api/runtime_errors.go
  • backend/internal/api/server.go
  • backend/internal/api/status.go
  • backend/internal/api/volume_export_runner.go
  • backend/internal/api/volume_export_schedules.go
  • backend/internal/api/volume_exports.go
  • backend/internal/api/volumes.go
  • backend/internal/api/ws_writer.go
  • backend/internal/browser/open.go
  • backend/internal/buildhistory/artifacts.go
  • backend/internal/buildhistory/docker.go
  • backend/internal/buildhistory/history.go
  • backend/internal/buildhistory/inspect.go
  • backend/internal/buildhistory/logs.go
  • backend/internal/buildstore/store.go
  • backend/internal/config/config.go
  • backend/internal/config/logger.go
  • backend/internal/config/paths.go
  • backend/internal/config/validate_proxy.go
  • backend/internal/constants/constants.go
  • backend/internal/daemon/build_sync.go
  • backend/internal/daemon/builds.go
  • backend/internal/daemon/core.go
  • backend/internal/daemon/export_runner.go
  • backend/internal/daemon/export_scheduler.go
  • backend/internal/daemon/host.go
  • backend/internal/daemon/host_windows.go
  • backend/internal/daemon/log_broadcaster.go
  • backend/internal/daemon/migrate.go
  • backend/internal/daemon/registry_login.go
  • backend/internal/daemon/runtime_ready.go
  • backend/internal/dockercli/context.go
  • backend/internal/dockercli/manager.go
  • backend/internal/dockerexec/run.go
  • backend/internal/httpkit/json.go
  • backend/internal/httpkit/response.go
  • backend/internal/httpkit/route.go
  • backend/internal/httpkit/runtime_errors.go
  • backend/internal/httpkit/runtime_ready.go
  • backend/internal/httpkit/websocket.go
  • backend/internal/httpkit/ws_writer.go
  • backend/internal/limavm/env.go
  • backend/internal/limavm/shell.go
  • backend/internal/middleware/cors.go
  • backend/internal/middleware/logging.go
  • backend/internal/middleware/middleware.go
  • backend/internal/middleware/recovery.go
  • backend/internal/migration/compose_migration.go
  • backend/internal/migration/disk.go
  • backend/internal/migration/docker_desktop.go
  • backend/internal/migration/status.go
  • backend/internal/oauth/dockerhub/device.go
  • backend/internal/runtime/build.go
  • backend/internal/runtime/build_enrich.go
  • backend/internal/runtime/build_parser.go
  • backend/internal/runtime/command_error.go
  • backend/internal/runtime/container_detail.go
  • backend/internal/runtime/errors.go
  • backend/internal/runtime/exec.go
  • backend/internal/runtime/exec_attach.go
  • backend/internal/runtime/inspect_decode.go
  • backend/internal/runtime/lima.go
  • backend/internal/runtime/lima.yaml
  • backend/internal/runtime/localhost_proxy.go
  • backend/internal/runtime/mock.go
  • backend/internal/runtime/native.go
  • backend/internal/runtime/nerdctl.go
  • backend/internal/runtime/network.go
  • backend/internal/runtime/ports.go
  • backend/internal/runtime/proxy.go
  • backend/internal/runtime/registry.go
  • backend/internal/runtime/runtime.go
  • backend/internal/runtime/volume_detail.go
  • backend/internal/runtime/volume_export.go
  • backend/internal/utils/bytes.go
  • backend/internal/utils/format.go
  • backend/internal/utils/http_response.go
  • backend/internal/utils/int.go
  • backend/internal/utils/lines.go
  • backend/internal/utils/sanitize.go
  • backend/internal/utils/size.go
  • backend/internal/volumeexport/id.go
  • backend/internal/volumeexport/name_pattern.go
  • backend/internal/volumeexport/schedule.go
  • backend/internal/volumeexport/schedule_input.go
  • backend/internal/volumeexport/schedule_timing.go
  • backend/internal/volumeexport/store.go
  • backend/test/api/api_test.go
  • backend/test/api/builds_test.go
  • backend/test/buildhistory/inspect_test.go
  • backend/test/config/config_test.go
  • backend/test/config/validate_proxy_test.go
  • backend/test/httpkit/route_test.go
  • backend/test/utils/size_test.go
  • backend/test/volumeexport/name_pattern_test.go
  • backend/test/volumeexport/schedule_timing_test.go
  • backend/version/version.go
  • ui/lib/api/client.dart
  • ui/lib/app_shell.dart
  • ui/lib/constants/calf_constants.dart
  • ui/lib/export_name_pattern.dart
  • ui/lib/main.dart
  • ui/lib/platform/launch_at_login.dart
  • ui/lib/platform/macos_menu.dart
  • ui/lib/platform/open_url.dart
  • ui/lib/screens/build_detail_screen.dart
  • ui/lib/screens/builds_screen.dart
  • ui/lib/screens/compose_group_detail_screen.dart
  • ui/lib/screens/container_detail_screen.dart
  • ui/lib/screens/containers_screen.dart
  • ui/lib/screens/images_screen.dart
  • ui/lib/screens/networks_screen.dart
  • ui/lib/screens/resources_screen.dart
  • ui/lib/screens/volume_detail_screen.dart
  • ui/lib/screens/volume_quick_export_screen.dart
  • ui/lib/screens/volume_schedule_export_screen.dart
  • ui/lib/screens/volumes_screen.dart
  • ui/lib/storage/calf_ui_storage.dart
  • ui/lib/storage/container_groups.dart
  • ui/lib/storage/logs_viewer_preferences.dart
  • ui/lib/storage/sidebar_preferences.dart
  • ui/lib/storage/update_preferences.dart
  • ui/lib/updates/update_checker.dart
  • ui/lib/updates/update_dialog.dart
  • ui/lib/updates/update_info.dart
  • ui/lib/widgets/about_dialog.dart
  • ui/lib/widgets/app_top_bar.dart
  • ui/lib/widgets/calf_button.dart
  • ui/lib/widgets/calf_tab_bar.dart
  • ui/lib/widgets/confirm_dialog.dart
  • ui/lib/widgets/detail_breadcrumb.dart
  • ui/lib/widgets/error_text.dart
  • ui/lib/widgets/files_panel.dart
  • ui/lib/widgets/hover_list_row.dart
  • ui/lib/widgets/logs_panel.dart
  • ui/lib/widgets/poll_interval_mixin.dart
  • ui/lib/widgets/resource_list_scaffold.dart
  • ui/lib/widgets/running_filter_switch.dart
  • ui/lib/widgets/status_dot.dart
  • ui/lib/widgets/volume_export_form.dart
  • ui/macos/Runner.xcodeproj/project.pbxproj
  • ui/macos/Runner/DebugProfile.entitlements
  • ui/test/launch_at_login_test.dart
  • ui/test/widget_test.dart

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor

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.

enegalan added 3 commits July 12, 2026 16:59
…eliability

- Updated the `runCommandWithRetry` and `runCommandWithRetryEnv` functions to include custom environment handling, improving flexibility in command execution.
- Introduced retry logic for transient errors in shell commands executed within the Lima VM, enhancing robustness against temporary failures.
- Refactored volume export and image loading functions to ensure proper error mapping for VM path resolutions, improving user feedback during operations.
- Enhanced logging for container log streaming to provide clearer insights into transient errors and operational states.
- Added new tests for parsing Docker inspect details and validating proxy configurations, ensuring correctness and reliability in handling various scenarios.
…mponents

- Updated the DetailBreadcrumb and ResourceListScaffold widgets to use the null-aware operator for trailing and headerActions, respectively, enhancing code readability and reducing verbosity.
…kflow

- Documented changes in version 0.9.2, including improved settings validation and startup port handling.
- Fixed shutdown behavior for background migrations and Docker Hub sign-in.
- Enhanced error messaging for container operations in API responses.
- Updated CI workflow to include Go setup with dependency caching for improved build efficiency.
@enegalan enegalan merged commit 0df967a into main Jul 12, 2026
3 checks passed
@enegalan enegalan deleted the refactor branch July 12, 2026 17:11
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