Skip to content

Comments

feat: add ability to restart single service#654

Draft
wakonig wants to merge 3 commits intomainfrom
feature/restart_service
Draft

feat: add ability to restart single service#654
wakonig wants to merge 3 commits intomainfrom
feature/restart_service

Conversation

@wakonig
Copy link
Member

@wakonig wakonig commented Nov 18, 2025

This PR refactors the tmux launch utils and adds the option to restart a single service, either through the cli or through BEC messages. This will enable us to restart single services through the GUI.

@wakonig wakonig force-pushed the feature/restart_service branch 3 times, most recently from 37aa94f to d382a5d Compare November 18, 2025 16:22
@codecov
Copy link

codecov bot commented Nov 18, 2025

@wakonig wakonig force-pushed the feature/restart_service branch from d382a5d to 043ee8e Compare November 18, 2025 16:52
@wakonig wakonig marked this pull request as ready for review November 18, 2025 16:54
Copilot AI review requested due to automatic review settings November 18, 2025 16:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the ability to restart individual services in the BEC server infrastructure. Previously, only full server restarts were supported.

Key changes:

  • Added service_name parameter to ServiceRequestMessage to specify which service to restart
  • Implemented service-level start/stop/restart operations in the CLI service handler and tmux launcher
  • Added --service command-line argument to start, stop, and restart commands

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
bec_lib/bec_lib/messages.py Added optional service_name field to ServiceRequestMessage
bec_server/bec_server/scihub/service_handler/service_handler.py Enhanced service handler to support single service restarts via message requests
bec_server/bec_server/bec_server_utils/service_handler.py Added ServiceOperation enum and methods for starting, stopping, and restarting individual services
bec_server/bec_server/bec_server_utils/tmux_launch.py Implemented tmux-specific functions for managing individual service panes
bec_server/bec_server/bec_server_utils/launch.py Added --service argument to CLI commands and routing logic
bec_server/tests/tests_scihub/test_service_handler.py Added comprehensive test coverage for service handler message processing
bec_server/tests/tests_bec_server_utils/test_cli_service_handler.py Added tests for CLI service handler restart operations
bec_server/tests/tests_bec_server_utils/test_tmux_launch.py Added tests for tmux service management functions
bec_server/tests/tests_bec_server_utils/test_main.py Updated existing tests to include new service argument
Comments suppressed due to low confidence (1)

bec_server/bec_server/bec_server_utils/tmux_launch.py:1

  • The assertion checks for '--service scan_server' as a substring in the command string, but the command is constructed as f'{self.command} restart --service {service_name}'. This creates a space-separated command where the substring check may fail if the command is split into a list or formatted differently. Consider checking for both '--service' and 'scan_server' separately, or verify the exact command construction pattern.
import os

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wakonig wakonig marked this pull request as draft November 19, 2025 13:05
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