Skip to content

Conversation

@tab
Copy link
Owner

@tab tab commented Jan 25, 2026

  • Implemented IsNil() to check for nil service or FSM
  • Updated service nil checks to use IsNil() in controllers and models
  • Added unit tests for IsNil() method

- Implemented IsNil() to check for nil service or FSM
- Updated service nil checks to use IsNil() in controllers and models
- Added unit tests for IsNil() method
@tab tab requested a review from Copilot January 25, 2026 14:50
@tab tab self-assigned this Jan 25, 2026
Copy link

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 introduces a new IsNil() method to the ServiceState struct to encapsulate nil checks for both the service instance and its FSM field. The implementation replaces multiple repetitive nil check patterns throughout the codebase with a single, centralized method call.

Changes:

  • Added IsNil() method to ServiceState that checks if the service or its FSM is nil
  • Refactored controller methods (Start, Stop, Restart) to use IsNil() instead of inline nil checks
  • Updated UI handler methods (handleStopKey, handleRestartKey) to use IsNil()

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
internal/app/ui/services/model.go Implements the new IsNil() method on ServiceState
internal/app/ui/services/model_test.go Adds comprehensive unit tests for the IsNil() method covering nil service, nil FSM, and valid service scenarios
internal/app/ui/services/controller.go Replaces inline nil checks with IsNil() calls in Start, Stop, and Restart methods
internal/app/ui/services/update.go Replaces inline nil checks with IsNil() calls in handleStopKey and handleRestartKey methods

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

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.46%. Comparing base (8a0b32a) to head (f202a66).

Files with missing lines Patch % Lines
internal/app/ui/services/update.go 0.00% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (71.42%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #47   +/-   ##
=======================================
  Coverage   87.45%   87.46%           
=======================================
  Files          34       34           
  Lines        2582     2584    +2     
=======================================
+ Hits         2258     2260    +2     
  Misses        285      285           
  Partials       39       39           
Files with missing lines Coverage Δ
internal/app/ui/services/controller.go 96.87% <100.00%> (ø)
internal/app/ui/services/model.go 57.01% <100.00%> (+0.76%) ⬆️
internal/app/ui/services/update.go 50.45% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tab tab merged commit 7947e7c into master Jan 25, 2026
5 checks passed
@tab tab deleted the fix/ui-services branch January 25, 2026 15:23
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.

3 participants